Bowling Champ
Copyright/Publisher: Compute! Gazette, Programmed By: Joseph Ganci,
Genre: Bowling, Release Year: 1983, Number Of Players: 1 to 3

INTRODUCTION

"Bowling Champ," for one to three players, was originally written for the unexpanded VIC-20. We've included a version for the Commodore 64.

INSTRUCTIONS

Some games like Space Invaders or Adventure create their own fantasy worlds, while others are simulations of reality. "Bowling Champ" is one of the latter.

Up to three people can play " Bowling Champ"

It's not easy to take a game with countless physical variables, such as bowling, and reduce it to numbers so it can be re-created by a computer — especially a small computer. Compromises must be made. But Bowling Champ is a reasonable simulation of a game of ten pins, given the limitations imposed by the unexpanded VIC-20's 3.5K of free memory. The elements of skill and luck have been preserved, and the scoring is authentic.

Up To Three Players

When you first run Bowling Champ, it asks for the number of players. One, two, or three people can play.

Next you type in the players' names. To fit the names on the screen, the program truncates them to five characters (six on the Commodore 64).

Now you're ready for the first frame. The bowling ball rapidly moves up and down across the alley until you press the space bar. This rolls the ball down the alley and knocks over the pins, unless you've thrown a gutter ball. The trick is to time your release so the ball rolls down the center of the alley to score a strike.

In case you're unfamiliar with how a game of ten pins is scored, here's a brief summary:

A game consists of ten frames or turns. Each player gets one or two halls per frame. If you roll a strike- knocking down all ten pins with the first ball — you don't get a second ball, but the current ball's score is ten plus the total of your next two throws.

If some pins are left standing after your first ball, you get a second ball. If you knock down all the remaining pins, it counts as a spare, and the current ball's score is ten plus your next throw.

If any pins remain after your second ball (no strike or spare), the number of pins knocked down in that frame is added to your previous score.

Rolling a spare in the tenth (last) frame gains you one extra ball; rolling a strike in the tenth frame gains two extra balls.

Therefore, a perfect game — ten strikes during regular play plus two strikes with the extra bowling balls — scores 300 points. Needless to say, this doesn't happen very often, either in real bowling or in Bowling Champ.

Programming The Game

Bowling Champ was my first real attempt to write a good game in BASIC for my VIC-20. At first I thought it would be fairly simple to simulate a game like bowling, but I found myself quickly running out of memory as I tried to tell the VIC how to keep track of strikes and spares, how to calculate scores in bowling, and how to keep track of everything at the same time.

Another problem I found was the VIC's small screen size. I wanted to keep a constant log on the screen of each ball thrown, just as you would see on a regular bowling score sheet. But alas, with only 22 characters horizontally across the screen, I just wasn't able to record 20 hall scores with a box around each one. That's when I found a useful application for the REVERSE function (reverse video). At first I thought of it as just a way to pretty things up, but then I realized I could use it to reverse every other ball score on the screen so that each one could be easily distinguished from the one next to it.

With that problem solved, I attacked the next: how to keep track of strikes and spares and tally the scores correctly. At first I thought of just using a flag, a number that would tell the computer when to add extra points. But that got quite confusing and memory-consuming as I tried to keep track of each player's strikes and spares.

It took awhile, but finally the concept of screen memory clicked for me. If the screen locations were also memory locations, then I could tell if a strike or spare had been thrown simply by checking the correct spot on the screen where the symbol for a strike/spare had been recorded. This made things a lot easier and saved a lot of memory.

In short, the program counts the number of pins knocked down, checks for a strike or spare, and records the corresponding symbol on the score sheet. The program then checks to see if the last ball thrown was a spare or a strike; if either, calculations are performed according to standard bowling scoring rules. If a strike or spare is thrown in the tenth frame, the player is allowed to throw one or two extra balls. Every rule of scoring for regular bowling is followed. The only difference is that the computer does not wait until the end of a frame to update the score — it updates it after every ball.

Some nee, players find the ball moves too fast for them to aim. To slow it down, insert a delay loop (such as FOR X=I TO 100:NEXT) at the beginning of line 440.

Program Outline

Heree is a breakdown of both the VIC and 64 versions of the program:

10-110 Initialization; title is printed.

112-113 How many players? Up to three can play.

118-123 Players' names are typed in and are cut off after the first five letters (six letters on the 64) to fit the screen.

128-156 Screen setup.

60-225 Main part of the program. This includes:

166 Change the screen and border colors for each player.

174-194 Check to see it a spare has been thrown in the tenth frame and, if so, let the player throw one more ball. 195-214 Check to see it a strike has been thrown in the tenth frame and, if so, let the player throw two more balls.

882-896 Final scores and an option to repeat the game are printed.

The program contains the following subroutines:

430-460 Bowling ball moves up and down until a key is pressed.

550-612 Roll the ball toward the pins, knock them down, and count to see how many have been knocked down.

1000-1100 Keep score on the screen with the proper symbol - the number of pins knocked down, the spare symbol, or the strike symbol.

1200-1300 Tally current core.

The VIC version takes up most of the memory, so don't add anything extra until you've typed it in as is. Consider the quotes at the ends of PRINT statements optional where they are not included.