PageRenderTime 43ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/ruby/simple/runme.rb

#
Ruby | 21 lines | 8 code | 7 blank | 6 comment | 0 complexity | 1adf5cbde038cc123a86c90a7107ec11 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. # file: runme.rb
  2. require 'example'
  3. # Call our gcd() function
  4. x = 42
  5. y = 105
  6. g = Example.gcd(x,y)
  7. printf "The gcd of %d and %d is %d\n",x,y,g
  8. # Manipulate the Foo global variable
  9. # Output its current value
  10. print "Foo = ", Example.Foo, "\n"
  11. # Change its value
  12. Example.Foo = 3.1415926
  13. # See if the change took effect
  14. print "Foo = ", Example.Foo, "\n"