11.4 Exercises

  1. The game of Go is often played online. Many users save their game data for later analysis. The game is played by two players who take turns placing stones (one player using black stones and the other using white stones) on the intersections of a 19  × 19 board. Create a program to enter each move of a game and save that information to a file.

  2. Write a program that quizzes the user on her or his vocabulary. Make the program read a set of words and definitions from a file; display definitions one at a time, in random order; and prompt for the appropriate word.

  3. Write a program that will keep track of the mileage for oil changes for your car.

  4. Write a program that reads the content of a file and outputs it to the screen.

  5. Write a program that takes input from the user and saves it to a file.

  6. Write a program that creates and stores a simple address book.

Get Computer Science Programming Basics in Ruby now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.