Skip to main content
ICT
Lesson A12 - Iterations
 
Main Previous
Title Page >  
Summary >  
Lesson A1 >  
Lesson A2 >  
Lesson A3 >  
Lesson A4 >  
Lesson A5 >  
Lesson A6 >  
Lesson A7 >  
Lesson A8 >  
Lesson A9 >  
Lesson A10 >  
Lesson A11 >  
Lesson A12 >  
Lesson A13 >  
Lesson A14 >  
Lesson A15 >  
Lesson A16 >  
Lesson A17 >  
Lesson A18 >  
Lesson A19 >  
Lesson A20 >  
Lesson A21 >  
Lesson A22 >  
Lesson AB23 >  
Lesson AB24 >  
Lesson AB25 >  
Lesson AB26 >  
Lesson AB27 >  
Lesson AB28 >  
Lesson AB29 >  
Lesson AB30 >  
Lesson AB31 >  
Lesson AB32 >  
Lesson AB33 >  
Vocabulary >  
 

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.