Skip to main content
ICT
Lesson A12 - Iterations
 
Main   Previous
 

LAB ASSIGNMENT A12.7 page 18 of 18

GameLand

Background:

This exercise is based on the American Computer Science League - Intermediate Division, Contest #1, 1989-90.

  1. The board game GameLand is a very simple one that you will simulate on the computer.

  2. Two players begin the game on a square labeled as “START.” The goal of the game is to be the first player to reach the square labeled “FINISH.” There are 100 squares between START and FINISH.

  3. The two players take turns rolling two six-sided dice. A roll of 2 or 12 means that the player loses that turn and cannot move. Getting a roll of 7 means that the player moves backwards 7 spaces (but not beyond START). On all other rolls, the players must move forward an amount equal to the number of the roll.

  4. If one player lands on a square occupied by the other player, the player originally on that square gets bumped back to the START square.

  5. The game ends when one player wins by landing on or beyond the FINISH square.

Assignment:

  1. Write a program that simulates the activities of GameLand.

  2. Make sure your two dice rolls are realistic. Remember, the results are not simply 1 through 12.

 

Main   Previous
Contact
 © ICT 2006, All Rights Reserved.