BasketballThis program simulates a game of basketball between Dartmouth College and an opponent of your choice. You are the Dartmouth captain and control the type of shot and defense during the course of the game. There are four types of shots: 1. Long Jump Shot (30 ft.), 2. Short Jump Shot (15 ft), 3. Lay Up, and 4. Set Shot. Both teams use the same defense, but you may call it: Press (6), Man-to-man (6.5), Zone (7), or None (7.5). To change defense, type 0 as your next shot. Note: The game is biased slightly in favor of Dartmouth. The average probability of a Dartmouth shot being good is 62.95% compared to a probability of 61.85% for their opponent (This makes the sample run slightly remarkable in that Cornell won by a score of 45 to 42. Hooray for the Big Red!) Charles Bacheller of Dartmouth College was the original author of this game. Code Listing (Small Basic File: basketbl.sb): |
This chapter is adapted from the book Basic Computer Games Small Basic Edition published by BibleByte Books. To purchase this book in its entirety, please see the Computer Science For Kids web site. |
Sample Run: © Copyright 2010 By BibleByte Books. All Rights Reserved. BibleByte Books, the BibleByte Books Logo, Computer Science For Kids, the Computer Science For Kids logo, and related trade dress are trademarks or registered trademarks of BibleByte Books. |