#!/usr/bin/ruby

# Program to find the factorial of a number
def fact(n)
    if n == 0
        1
    else
        n * fact(n-1)
    end
end

puts fact(ARGV[0].to_i)

class Range
  def to_json(*a)
    {
      'json_class'   => self.class.name, # = 'Range'
      'data'         => [ first, last, exclude_end? ]
    }.to_json(*a)
  end
end

{:id => 34, :key => "value"}


    herDocs = [<<'FOO', <<BAR, <<-BAZ, <<-`EXEC`] #comment
  FOO #{literal}
FOO
  BAR #{fact(10)}
BAR
  BAZ indented
    BAZ
        echo hi
    EXEC
puts herDocs

Simple Ruby Editor

Privacy of Users’ Data

At OnlineWebToolKit, we offer a variety of online tools, and we take the privacy of our users' data very seriously. With so many online scams, many people are concerned about their sensitive information being compromised when using online tools. However, our website provides a secure and safe tool that prevents hackers from accessing or intentionally sharing users' information with third parties. The text you input into our tool is only stored temporarily on the client side within your browser until the formatting process is complete. Once the results are displayed or you refresh or close the browser, your data is deleted from our site.

Share this page