Appendix A. What’s on the Companion Website?

As is the case with any programming language, to become proficient you must practice, practice, practice. While this may mean spending time creating new game scripts, like the ones demonstrated in this book, more than likely you’ll want to begin focusing on developing all kinds of different scripts. For example, you may want to begin creating scripts that help you to become more efficient by automating tasks like file and folder management.

To get off to a good start, it helps to have a collection of sample code that you can reference and borrow from, copying and then pasting code statements into your new Ruby scripts. This book has provided you with hundreds of working examples, including everything from small one-liners to examples that demonstrate how to exercise specific language features and to perform specific tasks. For example, Chapter 6 is packed with examples of how to create and work with arrays and hashes, and Chapter 7 provides you with dozens of examples of how to work with regular expressions. Chapter 9, on the other hand, offers examples that demonstrate how to work with files and interact with system resources.

In addition to the code samples, each chapter in this book ended by providing you with a working example of a computer game. Within these game scripts, you will find no shortage of examples demonstrating how to work with many of the language features and programming techniques presented in this book. By drawing upon the script statements found in the script files, you have access to small templates that you can copy and then paste into new scripts to build more advanced and functional Ruby scripts.

If you have been creating and experimenting with this book’s game scripts, then you already have access to a good collection of source code. However, if you have skipped around a bit when reading this book, then you may have also missed out on creating one or more of the game scripts. But don’t fret; you can download all of the game scripts presented in this book from the book’s companion website, located at www.courseptr.com/downloads.

Table A.1 provides you with a brief review of the game scripts that were presented in this book.

Table A.1. Ruby Script Files Available on the Companion Website

Chapter

Application

Description

Chapter 1

Ruby Joke game

This Ruby script serves as the book’s initial example on how to create and execute a Ruby script and demonstrates how to display text and perform basic user interaction.

Chapter 2

Ruby Tall Tale game

This Ruby script demonstrates how to collect and process user input through the development of an interactive storytelling game.

Chapter 3

Ruby Virtual Crazy 8 Ball game

This Ruby script demonstrates how to work with variables and to generate random numbers to create a game that provides randomly selected answers to player questions.

Chapter 4

Ruby Typing Challenge game

This Ruby script demonstrates how to apply conditional logic to analyze user input and control script execution flow through the development of a computer typing game that evaluates the player’s typing skills.

Chapter 5

Superman Movie Trivia Quiz

This Ruby script demonstrates how to work with loops when collecting user input through the creation of an interactive quiz that evaluates the player’s knowledge of the Superman movie series.

Chapter 6

Ruby Number Guessing game

This Ruby script is a number-guessing game that challenges the player to guess a randomly generated number in as few guesses as possible.

Chapter 7

Word Guessing game

This Ruby script demonstrates how to work with regular expressions through the development of a computer game that challenges the player to guess a mystery word after being first allowed to guess five consonants and one vowel.

Chapter 8

Ruby Rock, Paper, Scissors game

This Ruby game is a computerized version of the Rock, Paper, Scissors game in which the player goes head to head against the computer.

Chapter 9

Ruby Blackjack game

This Ruby game is a virtualized casino card game in which the player competes against the dealer (computer) in an effort to build a hand that comes as close as possible to 21 without going over.

Chapter 10

Ruby Tic-Tac-Toe game

This Ruby script is designed to bring together all of the programming concepts presented throughout the book through the development of a two player Tic-Tac-Toe computer game.

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset