VIC-20 Listings

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
Subroutines

Page 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
Bomber

Pages 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 Fish

Pages 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 Navy

Pages 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 Miss

Pages 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 Machine

Pages 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 Golf

Pages 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.
Roadrace

Pages 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).
Squash

Pages 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).
Xmas

Pages 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).
Zombies

Pages 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 Race

Pages 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.
Dungeon

Pages 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 Trouble

Pages 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.
Primes

Pages 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 Adam

Pages 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 Leaps

Pages 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 1

Pages 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 2

Pages 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 Eve

Pages 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.
Codemaker

Pages 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-Low

Pages 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 Squares

Pages 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.
Mindread

Pages 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 Rescue

Pages 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.
Swap

Pages 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.
Anyday

Pages 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 Governor

Pages 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).
Mastermind

Pages 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 Sticks

Pages 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 Course

Pages 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
Conversion

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

Pages 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 Ball

Pages 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 Temperatures

Pages 88-89.
? Unexpanded hot cold temp.prg
Screenshot
Convert temperatures from Celsius to Fahrenheit, and vice versa.
Controls:
Follow on-screen prompts.
Tumbledice

Pages 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 Brakes

Pages 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 Go

Pages 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.
Moon

Pages 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.
Pinball

Pages 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
Canute

Pages 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.
Lastword

Pages 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.
Code

Pages 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.
Wordgrid

Pages 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.
Anagram

Pages 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.
Wordking

Pages 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.
Jotto

Pages 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.
Squares

Pages 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).
Letters

Pages 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

  1. 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.

VIC-20 Listings <http://www.vic20listings.freeolamail.com/>
Copyright (C) R.M. Smedley 2019, All Rights Reserved.
This page was last updated 2-Mar-2019.