Ruby – Simple examples
Let’s write a function to compute factorials. The mathematical definition of n factorial is: In ruby, this can be written as: You may notice the repeated occurrence of end. Ruby has been called “Algol-like” because of this. (Actually, the syntax of ruby more closely mimics that of a langage named Eiffel.) You may also notice the lack…