Books > The Rainbow Book of BASIC Programs

**The Rainbow Book of BASIC Programs** (GB)

Maynard (Ed.)

Grisewood & Dempsey, 1984

__Download all programs from this book on one disk__:

Rainbow Book.d64 |

49 programs (100% complete)

__Chapter 3: Library of Subroutines__

Program |
Author |
Requirements |
Files |
Info |

SubroutinesPage 20. |
? | Unexpanded | subroutines.prg Screenshot |
A library of subroutines that perform various functions.Controls:None. |

__Chapter 4: Games of Fun__

Program |
Author |
Requirements |
Files |
Info |

BomberPages 22-23. |
? | Unexpanded | bomber.prg Screenshot |
Blitz-style game. Drop bombs to flatten the New York skyscrapers so you can land your UFO.Controls:Space (drop bomb). |

Stupid FishPages 24-25. |
? | Unexpanded | stupid fish.prg Screenshot |
A fish is hidden somewhere in a 9x9x9 grid. To catch it you must land your baited hook right on top of it, and after each attempt your sonar will tell you how close you were. Try to catch it in the fewest possible moves.Controls:Type the coordinates for each guess, three numbers from 1-9. |

Swiss NavyPages 26-27. |
? | Unexpanded | swiss navy.prg Screenshot |
Battleships-style game. The Swiss navy consists of 1 Battleship (BBBB), 1 Cruiser (CCC), 1 Destroyer (DD) and 2 Patrol Boats (P), which are hidden on a grid. Try to find and destroy all the ships using as few bombs as possible, but don't hit any mountains (M).Controls:Type the row (1-6) and column (A-H) for each shot. |

Hit or MissPages 28-29. |
? | Unexpanded | hit or miss.prg Screenshot |
Destroy as many targets as you can, at distances from 500m to 15,000m, by entering the trajectory of each shot.Controls:Type the angle (1-90) for each shot. |

Fruit MachinePages 30-31. |
? | Unexpanded | fruit machine.prg Screenshot |
Fruit machine game. Start with $10, and try to win $100 to break the bank.Controls:Type your bet for each spin. |

Zigzag GolfPages 32-33. |
? | Unexpanded | zigzag golf.prg Screenshot |
Golf game where you can only play one kind of shot, the ZigZag shot. Try to complete nine holes using the fewest strokes.Controls:Type the zig (height) and zag (distance) for each shot. |

RoadracePages 34-35. |
? | Unexpanded | roadrace.prg Screenshot |
Vertically scrolling car game. Drive your rally car as far as you can without hitting the edge of the road.Controls:Z (left), X (right). |

SquashPages 36-37. |
? | Unexpanded | squash.prg Screenshot |
Bat-and-ball game. Use your bat to keep the squash ball on the court for as long as possible.Controls:Z (left), X (right). |

XmasPages 38-39. |
? | Unexpanded | xmas.prg Screenshot |
Help Santa deliver the presents by dropping them down the chimney as he flies overhead.Controls:Space (drop present). |

ZombiesPages 40-41. |
? | Unexpanded | zombies.prg Screenshot |
You are 'H'. Try to lure the zombies (Z) into the quicksand (*), without getting caught or falling into the quicksand yourself.Controls:2 (up), 8 (down), 4 (left), 6 (right), 1/3/7/9 (diagonal), 5 (don't move). |

__Chapter 5: Thinking Games__

Program |
Author |
Requirements |
Files |
Info |

Pyramid RacePages 42-43. |
? | Unexpanded | pyramid race.prg Screenshot |
Mental agility game played against the computer. Start by entering ten digits for the bottom row of the pyramid. Each pair of digits is added together and entered into the box above them, and if the answer has two digits then those are also added together. For example, if two boxes contain 8 & 3 then add these together to get 11, then add 1+1 to get 2, and put this in the box above 8 & 3. Do this for every box on the pyramid to work out what number appears in the single box at the top, and see if you can get the right answer before the computer does.Controls:Follow on-screen prompts. There is a shortcut to solve the puzzle: Add the digits from boxes 4 and 7 together, multiply this by 3, add the digits from boxes 4 and 10, and then add the two digits together. |

DungeonPages 44-45. |
? | Unexpanded | dungeon.prg Screenshot |
A princess and monster are trapped in an underground maze. They each move an agreed number of cells on each turn (from 1 to 9), moving at right-angles to each other, and the princess must pass through every cell to escape. Can you find a combination that will allow the princess to escape without encountering the monster?Controls:Follow on-screen prompts. |

Sum TroublePages 46-47. |
? | Unexpanded | sum trouble.t64 Screenshot |
Programs that solve four mathematical puzzles. Basil Byte's Problem: Find a four digit square number that, if torn in two, will result in two numbers that are both a perfect square. Cynthia Cube's Problem: Find a four digit number that, when multiplied by itself, gives an eight digit number ending in the original four numbers. Darrell Digit's Problem: Darrell's wife's age is the same as his but with the digits reversed, and the sum of their ages is eleven times greater than the difference, so how old are they? Ernest Euclid's Problem: A child answers 300 questions, earning 11p for each correct answer and losing 14p for each wrong answer. Afterwards he owes the same amount that he earned, so how many questions did he get right and wrong?Controls:None. |

PrimesPages 48-49. |
? | Unexpanded | primes.prg Screenshot |
Enter a number between 1 and 1,000,000, and this program will calculate if it is a prime number.Controls:Follow on-screen prompts. |

Madam I'm AdamPages 50-51. |
? | Unexpanded | palin1.prg palin2.prg Screenshot |
A palindrome is a number that reads the same backwards as forwards. Palin1 finds the three smallest palindromes that are perfect squares, which do not have square roots that are palindromes. Palin2 finds the smallest perfect square with an even number of digits that is also a palindrome.Controls:None. |

Steps and LeapsPages 52-53. |
? | Unexpanded | steps and leaps.prg Screenshot |
Reverse the order of the counters in the fewest possible moves, finishing with the empty box on the left-hand side. A piece can be moved into an adjacent empty square, or by leaping over one counter into the empty square.Controls:1-6 (number that you want to move), S (solve game). |

Crossnumber 1Pages 54-55. |
? | Unexpanded | cn1-chairman.prg Screenshot |
This program calculates the age of the Huggett's chairman, where his age and birth year are both prime numbers. The correct answer fits into a crossword on page 55 of the book.Controls:Press any key to continue after a value is found. |

Crossnumber 2Pages 56-57. |
? | Unexpanded | cn2-nougat.prg cn2-employees.prg Screenshot |
Nougat calculates how many pieces of nougat fit inside a 2lb box. Employees calculates the original number of employees at Huggett's. The correct answers fit into a crossword on page 55 of the book.Controls:None. |

Midsummer's EvePages 58-59. |
? | Unexpanded | twelve.prg Screenshot |
Calculate the square root of TWELVE by substituting each letter with a number. Use the same substitution to convert the answer back into letters, and only one answer will spell a common word. What is that word?Controls:Press any key to continue after a value is found. |

CodemakerPages 60-61. |
? | Unexpanded | codemaker.prg Screenshot |
Code and decode secret messages. Use '/' to indicate where the spaces occur.Controls:Follow on-screen prompts. |

__Chapter 6: Number Puzzles__

Program |
Author |
Requirements |
Files |
Info |

High-LowPages 62-63. |
? | Unexpanded | high low.prg Screenshot |
Enter an upper limit, e.g. 100, and the computer will choose a random number between one and the selected value. Try to work out the number in the fewest guesses.Controls:Type your guess. |

Magic SquaresPages 64-65. |
? | Unexpanded | magic square.prg Screenshot |
Try to work out the missing values in the grid, so that every row and column adds up to 34.Controls:Type the column (A-D), row (1,4) and value of each guess, pressing Return after every number. |

MindreadPages 66-67. |
? | Unexpanded | mindread.prg Screenshot |
Choose a number between 1 and 100, and the computer will try to work out your number by asking a series of questions. Each question involves dividing your number by a value and entering the remainder, e.g. if your number is 10 and you are asked to divide it by 3 then the remainder is 1.Controls:Follow on-screen prompts. |

Air RescuePages 68-69. |
? | Unexpanded | air rescue.prg Screenshot |
You are an Air Force general planning to send emergency supplies to various locations outside the maximum range of your planes. During the flight the point will come where the fuel in one plane will be enough to top up the others, then the empty plane will drop away while the others continue. Another plane will repeat the same process at the next refueling point, and so on until there is only one plane left to deliver the supplies. On each flight, how many planes and refuelling points will be needed?Controls:Follow on-screen prompts. Hint: The number of refuelling points is always one less than the number of planes required. |

SwapPages 70-71. |
? | Unexpanded | swap.prg Screenshot |
Six numbers are displayed in random order, e.g. 10, 20, 50, 30, 60, 40. The computer asks how many numbers you want to reverse, entering '3' will reverse the first three numbers to give you 50, 20, 10, 30, 60, 40. Try to put them into numerical order in the fewest possible moves.Controls:For each move, type how many numbers you would like to reverse. |

AnydayPages 72-73. |
? | Unexpanded | anyday.prg Screenshot |
Enter today's date and a date of interest, and the computer will calculate how much time has/will elapsed between them plus the day of the week for that date.Controls:Follow on-screen prompts. |

The Dishonest GovernorPages 74-75. |
? | Unexpanded | governor.prg Screenshot |
The King's five governors deliver taxes in bars that weigh 1000g each. One governor is dishonest and clips his bars, so that each bar is 10g short in weight. The King takes one bar from the first governor, two bars from the second governor, and so on, and calculates their total weight. The shortfall will reveal which governor is dishonest - who should the King behead?Controls:Work out which governor is dishonest, and type their number (1-5). |

MastermindPages 76-77. |
? | Unexpanded | mastermind.prg Screenshot |
Mastermind-style game. The computer picks a three-digit random number (111-999), and you have 20 guesses to work out the number. After each guess the computer will tell you how many digits are correct, and how many are the right number but in the wrong position.Controls:Type your guess. |

Pickup SticksPages 78-79. |
? | Unexpanded | pickup sticks.prg Screenshot |
There are 21 brightly coloured sticks. You and the computer take it in turns to remove between one and seven sticks. To win, you must force the computer to pick up the last stick.Controls:Type how many sticks you want to remove (1-7). |

Star CoursePages 80-81. |
? | Unexpanded | star course.prg Screenshot |
The galaxy is divided into 100 grid locations, and you must travel to a randomly chosen secret location in the fewest possible moves to conserve fuel. After each guess the computer displays a row of stars indicating how close you are to the target, where *=2, **=4, ***=8, and so on.Controls:Type your guess for the target location (1-100). |

__Chapter 7: Science Problems__

Program |
Author |
Requirements |
Files |
Info |

ConversionPages 82-83. |
? | Unexpanded | conversion.prg Screenshot |
Conversion calculator, converts lengths from metric to imperial and vice versa.Controls:Follow on-screen prompts. |

Average SpeedPages 84-85. |
? | Unexpanded | average speed.prg Screenshot |
Enter the start time, end time and distance travelled for a journey, and this program will calculate your average speed.Controls:Follow on-screen prompts. |

Fly BallPages 86-87. |
? | Unexpanded | fly ball.prg Screenshot |
Test your knowledge of gravity. A ball is thrown in the air with a random velocity. Can you use this to work out how long the ball spends in the air, and the maximum height it will reach?Controls:Follow on-screen prompts. |

Hot & Cold TemperaturesPages 88-89. |
? | Unexpanded | hot cold temp.prg Screenshot |
Convert temperatures from Celsius to Fahrenheit, and vice versa.Controls:Follow on-screen prompts. |

TumbledicePages 90-91. |
? | Unexpanded | tumbledice.prg Screenshot |
This program simulates rolling two dice 180 times and displays the results on a bar chart, to show that some numbers will arise more often than others.Controls:None. |

Fast BrakesPages 92-93. |
? | Unexpanded | fast brakes.prg Screenshot |
Enter a speed in KP/H, and this program will calculate your braking distance.Controls:Follow on-screen prompts. |

Pay As You GoPages 94-95. |
? | Unexpanded | pay as you go.prg Screenshot |
Interest calculator. Enter the amount of a loan, interest rate and number of years to repay, and it will calculate the total repayment using simple and compound interest.Controls:Follow on-screen prompts. |

MoonPages 96-97. |
? | Unexpanded | moon.prg Screenshot |
Moon phase calculator. Enter a date and this program will display the moon's age, i.e. the number of days since the previous new moon. Note: The calculations appear to be a day out after 1999.Controls:Follow on-screen prompts. |

PinballPages 98-99. |
? | Unexpanded | pinball.prg Screenshot |
Simulates an old fashioned pinball machine, where a ball bounces down a triangle of nails. A ball is dropped 64 times to see if the results are consistent with Pascal's Triangle.Controls:None. |

__Chapter 8: Word Problems__

Program |
Author |
Requirements |
Files |
Info |

CanutePages 100-101. |
? | Unexpanded | canute.prg Screenshot |
Hangman-style game for two players. The first player enters a secret word, which the second player must guess before King Canute drowns in the rising tide.Controls:Type your guess for each letter. |

LastwordPages 102-103. |
? | Unexpanded | lastword.prg Screenshot |
Word ladders game for two or more players. The first player enters a four-letter word, and each player must then enter a new word by changing just one letter of the previous word.Controls:Follow on-screen prompts. |

CodePages 104-105. |
? | Unexpanded | code.prg Screenshot |
Code breaking puzzle for two players. The first player enters a secret word or phrase, which the computer will encode with a random letter substitution cipher. The letter 'S' in the original message might be changed into a 'Q', for example. The second player must then attempt to decode the message.Controls:If you think you that the letter 'Q' in the coded message stands for 'S' in the original message, then press Q followed by S. If you are correct then the decoded letters will be displayed. Continue doing this until the whole message has been decoded. |

WordgridPages 106-107. |
? | Unexpanded | wordgrid.prg Screenshot |
Two players take it in turns to place a letter in one of the columns of a 7x7 grid. Each time a player completes one or more words, either horizontally or vertically, they score as follows: 3 letter word = 1 point, 4 letter word = 3 points, 5 letter word = 5 points, 6 letter word = 10 points, 7 letter word = 20 points.Controls:For each move type the column number, the letter that you want to play, and how many points you scored. |

AnagramPages 108-109. |
? | Unexpanded | anagram.prg Screenshot |
Anagram puzzle for two players. The first player enters up to ten words, so the computer can make an anagram of each word by scrambling the letters into random order. The second player then tries to solve the anagrams one at a time.Controls:Enter your guess for each anagram. |

WordkingPages 110-111. |
? | Unexpanded | wordking.prg Screenshot |
You are trying to impress the eccentric King of Wordomania by giving him gifts, but he only accepts objects that contain his favourite letter of the alphabet. Unfortunately his favourite letter is a secret so you must work it out by offering various gifts to deduce what it is, before he grows too angry.Controls:Follow on-screen prompts. |

JottoPages 112-113. |
? | Unexpanded | jotto.prg Screenshot |
Deductive thinking test for two players. The first player enters a secret word, ideally around 4-5 letters long. The second player must discover this word in the fewest possible guesses. For each guess you must type a word of the required length, and the computer will give one point for each correct letter regardless of whether it is in the correct place. If you get a full score without winning then it means you have entered an anagram of the secret word.Controls:Follow on-screen prompts. |

SquaresPages 114-115. |
? | Unexpanded | squares.prg Screenshot |
Sliding tile puzzle game. Slide the tiles around the grid to put the letters back into alphabetical order.Controls:U (up), D (down), L (left), R (right). |

LettersPages 116-117. |
? | Unexpanded | letters.prg Screenshot |
The player and the computer take it in turns to choose a letter, which the player than places on a 5x5 grid. The aim is to create as many high-scoring words as possible, either horizontally or vertically. After filling the grid, you then manually work out the scores for each row and column. 3 letter word = 3 points, 4 letter word = 5 points, 5 letter word = 10 points.Controls:Follow on-screen prompts. |

__Notes__

- The programs were written by Pat Grady, Paul Greet, Doug Gregory, Gordon Lee, Paul McGee, and Malcolm Neave. Unfortunately it does not say who wrote which program.

With thanks to DLH's Commodore Archive for making this book available in PDF format.

Copyright (C) R.M. Smedley 2019, All Rights Reserved.

This page was last updated 2-Mar-2019.