O'Reilly logo

Ruby Programming for the Absolute Beginner by Jerry Lee Ford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Implementing Conditional Logic

As has already been demonstrated in each of the game scripts that you have worked on in this book, it is virtually impossible to create Ruby scripts of any level of complexity without performing some degree of conditional analysis. This analysis might involve examining things like player input or the value of a randomly generated number. To perform this analysis, Ruby provides you with access to a number of conditional expressions, modifiers, and logical operators that you can use to compare different values and control the logical execution of different script statements. This will allow you to create Ruby scripts that are capable of altering their execution based on the data that they are presented with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required