BY D~O W. CHANCE 25 Exciting Computer Games in BASIC for All Ages
Total Page:16
File Type:pdf, Size:1020Kb
BY D~O W. CHANCE 25 Exciting Computer Games in BASIC for All Ages by David W. Chance Entertaining and educational games and puzzles for the TRS-80™, Apple®, or PET®! Improve your computing skills .. turn your computer into a teaching machine that makes learning fun ... explore the real capabilities of your TRS-80, Apple, or PET ... discover ex citing and challenging new games for every skill level, every age group from four to 60-plus! It's all here in this out standing new collection of ready-to-run programs: puzzles, memory games, ac tion games, educational games, and games designed pu rely for entertai n ment. Here's a book that gives you 25 ex citing programs written in BASICforthe TRS-80. Easy-to-follow conversion in structions (including specific command changes and program line modifica tions) let you easily adapt the programs for use on an Apple or PET. Each pro gram is thoroughly explained with complete program listings, flowcharts, sample runs, and notation of memory required (some programs take as little as 4K of memory) . The author has even included suggestions for modifying programs to make them more chal lenging or for the use of additional graphics. Includes listings of REM statements to help new computerists gain a better understanding of BASIC and several " program shorts" that pro vide big computing excitment with only a little typing. You ' ll find teaching and learning games that feature graphic rewards for (continued on back flap) 25 EXCITING COMPUTER GAMES IN BASIC FOR All AGES Other TAB books by the author: No. 1275 33 Challenging Computer Games for TRS-BO™/AppleTM/PET® No. 1276 Computer Graphics-with 29 ready-to-run programs No. 1380 30 Computer Programs for the Homeowner in BASIC 25 EXCITING COMPUTER GAMES IN BASIC FOR ALL AGES BY DAVID W. CHANCE NOTICES: TRS-80 is a trademark of the Radio Shack Division of Tandy Corporation. PET is a trademark of Commodore Business Machines. Apple II is a trademark of Apple Computer Inc. FIRST EDITION FIRST PRINTING Copyright © 1983 by TAB BOOKS Inc. Printed in the United States of America Reproduction or publication of the content in any manner, without express permission of the publisher, is prohibited. No liability is assumed with respect to the use of the information herein. Library of Congress Cataloging in Publication Data Chance, David. 25 exciting computer games in BASIC for all ages. Includes index. 1. Games-Data processing. 2. Basic (Computer program language) I. Title. II. Title: Twenty -five exciting computer games in BASIC for all ages. GV1469.2.C446 1983 794 82-19286 ISBN 0-8306-0427-8 ISBN 0-8306-1427-3 (pbk.) Contents Introduction viii Logical and Relaxing Games REVERSE ORDER OF OPERATION COLOR MATCH SALT AND PEPPER PATTERNS 2 Teaching and Learning Games 33 WORDS TOGETHER ALL ABOUT NUMBERS ALL ABOUT NUMBERS II WORDS OF IMPORTANCE PUTTING NAMES TOGETHER FINISH THE LETTERS CALENDAR 3 Time- and Mind-Challenging Games 100 CLOCKWORK BLACKOUT TO THE DOGS CHALLENGE YOUR COMPUTER KEEP OUT OF THE GUTTER (MOTION) SENSE OF DIRECTION 4 Skill and Intelligence Games 162 CUBE HORSESHOES BLOKS MISSION IMPROBABLE DRIVER 5 War and Logic Games 211 CONTROL THE ROBOT RANDOM WAR WITH YOUR COMPUTER UNDER ATTACK Appendix A Programs That Convert to Other Systems 237 Equivalent Statements-Reverse Order of Operation-Color Match-Salt and Pepper-Words Together-Words of Importance-Putting Names Together-To the Dogs-Keep Out of the Gutter-(Motion) Sense of Direc- tion Appendix B Program Changes to Consider 242 Reverse Order of Operation-Color Match-8alt and Pepper-Patterns- Words Together-All About Numbers-All About Numbers II-Words of Importance-Putting Names Together-Finish the Letters-Calendar Clockwork-Blackout-To the Dogs-Challenge your Computer-Keep Out of the Gutter-(Motion) Sense of Direction-Cube-Horsehoes-Bloks- Mission Improbable-Driver-Control the Robot-Random War with your Computer-Under Attack Appendix C Program Memory Requirements 255 Appendix D Short Programs 257 Calculator-Alphabetized Letter /Word List-Low /High Numbers-Bulletin Board-Print@ Locations-ASCII of Letters/Words-Firing Order-Next in Line-Printer Signs Appendix E The ASCII Character Codes 262 ASCII Character Codes 32-127 Appendix F BASIC Commands 264 Input/Output Commands-Flow of Control Commands-Arrays and Strings Index 273 This book is dedicated to my little girl, Annajean. vii Introduction Home computers are becoming more and more popular with each passing year. Owners of these systems are seeking more flexible hardware for use in their homes. They are also requesting software. Users who do not care to or do not have time to write their own programs are filling the files of software producers with more and more demanding requests for software they can use. Because many producers concentrate on high-powered word pro cessing and filing programs, home users are forced to rely on one category of computer programs, games. Users are therefore looking for more game programs that will run on their particular brand of home computer. They are also looking for programs that will do more than just entertain them. This book is designed to help you and your children benefit more from your system. The programs will enable you to learn and relax using the "brain" (the computer) that is sitting in front of you. THE SYSTEM ... THE PROGRAMS Each of the thousands of computer owners around the world owns a particu lar brand of computer system. The programs within this book are not designed to work on each and every different kind of system. All of the programs in this book were written using a Radio Shack® model TRS-80™ I, 16K level II computer system. Methods of converting most of the programs for use on the PET® and viii the Apple IITM computers can be found in Appendix A. You might also want to look through Appendix C which contains memory requirements for each program. For each program there is a description, a flowchart, a sample run, and of course, the program listing itself. All programs have been "debugged" so that all you have to do is enter each of the lines and run the program. If you feel you have been "left hanging" by some of the sample runs, don't think that part of it was left out. Something must be left to your imagination. Children between the ages of four and seven will benefit most from the teaching programs such as "All About Numbers" and "All About Numbers II." If you find they want to dive right into the action game programs, you can use a little psychology. Having them go through one or two of the teaching programs before they are allowed to play the action games is an effective strategy. After you have enjoyed the game programs as they stand, you can read Appendix B, "Ways to Change the Programs," which opens new doors for most of the game programs. ix Logical and Relaxing Gamesl REVERSE ORDER OF OPERATION J M K •••••••• ......•••••••• - Do you know the alphabet? All the letters? In this game different letters that are randomly selected will be displayed. You must type these letters in reverse order within a certain time limit. Up to three people can play this game. There are two difficulty levels. If you choose the first level, the letters will remain on the video screen. If you choose the second level, each letter will be displayed individually in large print (using CHR$(23)) and then will disappear. Sample Run ((REVERSE ORDER OF OPERATION)) SEE THE INSTRUCTIONS? YES THIS IS AN ACTION PACKED GAME THAT WILL TEST YOUR MEMORY AND YOUR ABILITY TO HANDLE FAST-PACED, MIND-BENDIN G STRESS. USING ONLY THE 26 LETTERS OF THE ALPHABET THE GAME WILL TEST YOUR MEMORY TO ITS FULLEST EXTENT. Get L random letters No Final message winner DIM statements Read data Print random letters Input number of players Start time Yes Advance number of Random select points first player Flowchart for Reverse Order of Operation 2 OF COURSE, THE GAME WILL START OUT QUITE SIMPLY, YOU WILL RECEIVE 3 LETTERS OF THE ALPHABET. PRESS ENTER? GIVEN A CERTAIN TIME LIMIT, YOU MUST INPUT THOSE LETTERS IN REVERSE ORDER. THE NUMBER OF LETTERS WILL INCREASE BY ONE UNTIL ALL 26 LETTERS HAVE BEEN PRINTED (IF YOU LAST THAT LONG). IF AT ANYTIME YOU WANT TO QUIT, PRESS THE 'SPACE BAR' INSTEAD OF ENTERING A LETTER. TO BEGIN, PRESS ENTER? HOW MANY PLAYERS (UP TO 3)2 DIFFICULTY LEVEL FOR ALL PLAYERS) 1) PRINT AND LEAVE LETTERS 2) PRINT AND BLANK LETTERS SELECT? 1 PLAYER # 1'S FIRST NAME? DAVE PLAYER # 2'S FIRST NAME? SANDRA SANDRA IT'S YOUR PLAY ... PRESS ENTER WHEN READY? Z S] **INPUT THE REVERSE ORDER** JZS YOU HAVE ENTERED 1 CORRECTLY. SANDRA YOUR SCORE IS NOW: 10 DAVE IT'S YOUR PLAY ... PRESS ENTER WHEN READY? 3 Z SJ **INPUT THE REVERSE ORDER** JSZ YOU HAVE ENTERED ALL 3 IN THEIR CORRECT ORDER. DAVE YOUR SCORE IS NOW: 30 SANDRA IT'S YOUR PLAY ... PRESS ENTER WHEN READY? Z SJ Q **INPUT THE REVERSE ORDER** J S Z Q YOU HAVE ENTERED ALL 4 INCORRECTL Y, TRY HARDER!! SANDRA YOUR SCORE IS NOW: 10 DAVE IT'S YOUR PLAY ... PRESS ENTER WHEN READY? ZSJQ **INPUT THE REVERSE ORDER** J S Z Q YOU HAVE ENTERED ALL 4 INCORRECTLY, TRY HARDER!! DAVE YOUR SCORE IS NOW: 30 SANDRA IT'S YOUR PLAY ... PRESS ENTER WHEN READY? ZSJ Q M **INPUT THE REVERSE ORDER** **TIME** MQ YOU HAVE ENTERED 2 CORRECTLY. SANDRA YOUR SCORE IS NOW: 30 4 DAVE IT'S YOUR PLAY ..