tm
The best games, applications, and utilities ever publislned for Commodore l^ome computers by COMPUTE! and CGMPUTEI's Gazette.
PUTE!&
$14.95 1988 €£
S20 95 Canada 02707 Oispiav oniii Jon 27, 1988
jisk nsice
For Commodore 64 & 128
StiQlegy "^arneb -
Bootmak
Script
Eaglei all • Pris(
heck<
^.J» Fast hll l^^--0 ..
ivieiabAbiU
Appi
^^^^^X!^^w^
u *
;a V
Of Our Best Programs Ever
INSIDE . ON DISKI
-We
'0s • Tua
• iuroo
tionKi^ '^ Speed
orter • Fc /■iew • Strateqy Games
0 "7U86"02707'
Off • Heat Seeker • Kicker • Loo. Quickchange • Saloon ShootOLJ
- r'\/~^i'~:
^i A\ssernbiet jrictions • ' np • Fontier • Hi-Res Screen D
oBASlc. Turbo Boot
L,u / .i-^i :u •
iBASIC 128»^'etoi
^nr^Mc^tions ♦
WHEN YOU'VE SOLD YOU MUST BE DOING
No Brag, Just Fact! Over 1,800,000 programs sold to date— and each program includes:
• Free Customer Technical Support (For all registered users)
• A Money Back Guarantee (If you can find a better program, we'll buy it for you)**
• A very liberal Upgrade & Exchange Policy (Which means you never have to worry about obsolete software)**
S.R.P. C64-$49.95 C128-$6g.g5
Word Writer 3 has more fea- tures, more power, and is easier-to-use than any other C64 word processor! Features:
• An 85,000-Word Spell Checker— plus, unlimited sub-dictionaries,
• An Integrated Thesaurus with over 60,000 synonyms and alternatives.
• An Integrated Outline Processor that quickly
organizes notes, facts, and ideas into a convenient out- line format,
• An 80-Column Print Preview Mode
• Highlighting: Prints out your text incorporating under- lining, boldface, italic, superscript, subscript, and more.
• Headers and Footers
• Automatic Program Set-Up: Configures WORD WRITER 3 to your choice of printer codes, screen colors, and more.
• SwiftKeys* access commands quickly using a minimum of keystrokes,
• Compatible with GEOS*
PARTNER
64
S.R.P. C64-$49.95 C12B-$59.95
The Critic's Choice
WORD WRITER 3. DATA MANAGER 2, and SWIFTCALC INTERFACE TOGETHER FOR A COM- PLETE PRODUCTIVFTY SYSTEM!
pIaNNER is a class act from stan ^^^^^^3,^55
outstanding pMi.=-
-using WORD WRITER is an absolute^^^^^^^^^^
..pARTNERmavbeco-.^-— r.^^ you have . . .Timeworks has ^^^ute-sG^ette
deservedly so. ,, ,se well documented
-DATA MANAGER 2 is easy to use^^^^ ^^^^^^
rj^Ke^i^^^^^^^^^^
businesses.
■Reg. Irademarks of Commodore EleclronJcs, Lid- Berkeley Software, Inc., Timeworks, Inc. c 1982 Timeworks. Inc. AN Rights Reserved.
PARTNER 64.
A cartridge-based product with eight instantly accessi- ble, memory-res/den( desktop
accessories.
Accessories include:
• Appointment Calendar & Date Book
• Name, Address, and Phone List
• Auto Dialer • Memo Pad
• Label Maker & Envelope Addresser
• Calculator • typewriter
• Screen Print Other features include:
• SwiftDos: Allows you to access Commodore disk drive commands any time.
• SwiftLock: Enter your secret code before you leave your computer. The keyboard will be locked until you re-enter the code.
• Extended Printer Control: Enables you to send com- mands directly to your printer at any time.
• SwiftLoad: Allows your Commodore 1541 disk drive to load as fast as the 1571 disk drive.
Data Manager 2,.
A highly flexible filing and recordkeeping system that stores, retrieves, sorts, eval- uates, and updates large amounts of information. Features: A Report Writer: Gen- erates customized data reports. You specify the title, location, and sequence of each column. A Label Maker: Prints your name and address file onto standard mailing labels, and transfers and prints text information onto labels and tags. Quick Access to important information: Retrieves and prints items by name, date range, index code— or any category stored in the system. * Calculates numerical data from column to col- umn and field to field: Allows you to perform spread- sheet tasks such as payroll calculations, cost estimates. 0 Compatible with GE05
S.R.P. C64-S39.95 C128-$69.95
1,800,007 PROGRAMS, SOmmNG RIGHT.
S.R.P. C64-S4Q.95 C128-S69.95
SYIMA PORTERS Personal Financial Planner..
All the computer tools you'll need to manage your money on a day-to-day basis, and plan your financial future, too!
For Your Day-to-Day Affairs:
• Maintains your elec- tronic checkbook and credit card transactions.
• Writes your checks and balances your checkbook.
• Prepares and monitors your budget
• Classifies and tracks your taxable income and expenses
• Calculates your net worth and generates cus- tomized personal financial statements
• l^cks your financial assets-and your insurance policies.
For Your Rnancial Future:
Leads you step-by-step through a series of questions regarding your financial goals, and your current financial condition. Your answers will enable your computer to determine and print a summary of the amounts you must save each year to meet your financial objectives-in both real and inflated dollars.
SwiftCalc
A powerful, easy-to-use elec- tronic spreadsheet designed for home and business use. Features: Sideways: Prints all your columns on one, continu- ous sheet... sideways. 250 rows and 104 col- umns provide more than 25,000 cells (locations) in which to place information. Performs mathematical functions, up to 12 digits. Allows the use of minimum and maximum values, aver- ages, sums, integers, absolute values, and exponential notation,
• Performs financial analysis functions, calculates the present and future value of a dollar and the present and future value of a constant amount (annuity). ' SwiftLoad: Allows your 1541 Disk Drive to load up to 5 times faster.
' Produces "What If?" Reports: Applies mathematical functions and algebraic formulas to any spreadsheet-type analysis, such as budgeting, financial planning, or cost estimating. Calculates these formulas and produces complicated "What If?" Reports at the press of a key
S.R.P. C64-S39.95 C128-S69.05
Tmeworks Desktop PUBLISHER,.
Where you once needed a typesetter, designer, and paste-up artist, you can do it all yourself with THE TIMEWORKS DESKTOP PUBLISHER. Includes every- thing you need to produce professional-quality printed documents on your C64 S.R.P. $59.95 computer.
Features;
• Automatic Page Style Formatting: Set up a page style only once. The computer follows it automatically inserting rules, headers, and footers.
• A Full-Featured Word Processor
• A Wide Variety of Font Styles in Multiple Sizes
• A Built-in Text Editor that allows you to write head- lines, taglines, and captions to fit any space.
• High Resolution Graphics: Imports illustrations and graphics from leading graphic programs.
• Automatic Kerning: Opens or tightens word and letter spacing for a truly professional look,
• A Wide Selection of Built-in Patterns, Textures, and Shades
• A Complete Set of Built-in Drawing Tools: Draw lines, boxes, circles, and polygons automatically —or, draw free hand.
• Use THE TIMEWORKS DESKTOP PUBLISHER to produce: Newsletters. Brochures, Flyers, Forms, Reports, Bulletins, Menus. Certificates, Letterheads, Newspapers— the pos- sibilities are endless!
Available at your favorite dealer, or contact Timeworks toddy
To Order Call: 1-312-948-9202
For Update Information Call: 1-312-948-9206
kilii'^IIVdW
MORE POWER FOR YOUR DOLLAR
Timeworks, Inc. 444 Lake Cook Road. Deerfield, Illinois 60015 312-948-9200
"Delails on every Timeworks package
>^k^
^ *^^^
•
Solve • Calculate
T^TJ
Filers
You can do almost anything.
You can do it. You really can.
These are all of the wonderful
Ihings you can do with your Commodore 64 or 128 and Pocket'" 2 Software. This is the software thai can make you an ace ,n 30 minutes... «*wi/>"Wi«' „rrer louched a computer before.
The reason? Pocket'" 2 Software is menu driven. It has all of the help and instructions you need right on the screen. AH of the power of your computer IS nghi there at your fingertips. U s such an exhilarating feeling, you might find yourself humming the theme to 'Rocky'.
Fast, flexible and affordable.
At Digital Solutions, we're committed lo making our software work for you. Naturally, all Pocket'" 2 software is fully integrated and GEOS'" compatible. It's people logical...
notjust machine logical,
All those wt)nderful Ihings you've hea«l about Pocket"^ 2 Software are tnie. Just wait until you get your hands on ii.
Digital Superpak" 2 ... A super idea
One of the beauties of Pocket'" 2 Software is that all three programs work beautifully together. Ntorking together, they're more powerful and give you a whole new range of opUons and possibilities.
Not only that, when you order Pocket Writer^" 2. Pocket Planner'" 2 and Pocket Filer'" bundled together in Digital Superpak'"2.youcansave a bundle of money. Just $99.95 U.S.
Pbcket Writer^" 2 The Award \Vinner
Experts caU Pocket Writer'" 2 the best word processor ever. With its menu-driven, on-screen instructions, you'll fly through letters, presentations, memos, lists, reports and articles. In fact, if you need to write it. Pocket Writer'" 2 will make it easier. You can formal your words the way you want them. You can change vour mind. You can even stay on iop of your speUing with Spellmg Checker, Only $59.95 U.S,
Pocket Filer^^ 2... like a giant file drawer
Pocket Filer'" 2 IS a full- featured database that will help you to keep track of just about anything. No matter what kind of
information you have to store, pbcket Filer'" 2 will help you to
organize it better, process it m more ways and retrieve it faster when you need it.
At home or at the office, now you can organize information the way .vow want it. Only $59.951I.S.
.... Sort Report
ft)cket Planner'** 2 It figures
Pocket Planner'" 2 is the answer for number crunchers. This powerful electronic spreadsheet is the right tool for coUecting. stonng. analysing and reporting information . . financial or numerical. It's a common- sense solution lor managing your checkbook, budget, installment payments, worksheets or investment portfolio. Pocket Planner' " 2 lets you put some real bite into your number crunching. Only $59.95 U.S.
•Commodore Manaziw. July 1987
ProliMJonal Word P««»«»r^
S«te«1 «»<»-•« iKBT-triw^UW"'
ry
Digital
ProfaH'onal Word Proteitor,
for Iho Commodor
can'llinclPocker
Sri!^----^---'^^"^^^^
CHARGE CARD #
™m/m
Order your* today.
DigitalSupcrpak'"2.s^.stSW-9.'iU.S.
Ptock.tFi!er"'2a DigiialSupen»k'"2 D IhtalS- Name:.
DiaHal Mutioiis
2-30 AAferlheim Court Richmond HiU. Ontario Canada UB 1B9 (416) 731-8775
**<^
MPUTE! AND GAZETTE
STRATEGY GAMES
6 Chess John Krause
9 Power Poker Jud Bleser
10 Solitare Ben Bizet
1 1 Sea Route To India M. J. Winter
12 Campaign Manager .... Todd l-ieimarcl(
16 Pool Joseph T. Wjyton
1 7 Bingo 64 Richard L Witcover
18 Sleuth PaulD. Farquhar
20 Switchbox Todd Heimarcl(
23 Hex War Todd Heimarck
ACTION GAMES
22 Q-Bird Mike Sedore
25 Space Gallery Jeff A. Lapkofi
26 Whirlybird Philip I. Nelson
27 Prisonball John Scarborough
28 Quicl<change Kevin Mykytyn
and Mark Tuttie
29 Saloon Shootout David Hensley, Jr
and Mark Tuttie
30 Props Philip /. Nelson
34 Powerball William Chin
35 Laser Beam Mike Greenfield
36 Bagdad Bryan Files
37 Arcade Baseball Kevin Mykytyn
and Mark Tuttie
38 Eagles And Gators Philip I. Nelson
40 Face-Off Kevin Mykytyn
and Mark Tuttie
41 Space Arena Bryan Files
42 Kicker John Krause
and Mark Tuttie
43 Heat Seeker Jetf ]/\tolverton
PROGRAMMING UTILITIES
44 Fast Assembler Yves Han
48 Disk Editor Kevin Mykytyn
50 Fast File Copier Ross Ouwinga
52 Omega Sort Jonathan J Holuta
53 Automatic Syntax Checker
Philip /. Nelson
56 X BASIC Kevin Martin
59 1 28 Editing Functions Jim Allen
61 Archive Philip I Nelson
142 Unicopy Jim Butterfield
GRAPHICS UTILITIES
65 Fontier Tapan Desai
69 Expandable Graphics Dumps
Fred Solmer
70 Hi-Res Screen Dump Gregg Peele
7 1 Sprite Magic Charles Brannon
76 Fast Hi-Res Screen Dump
Robert F Mills
79 Ultrafont+ Charles Brannon
83 Screen-80 Gregg Peele
and Kevin Martin
APPLICATIONS
85 Skyscape Robert M. Simons
87 Number Construction Kit
Gerald W. Rightmer
88 Home Financial Calculator
Patrick Parrish
91 Budget Planner Gregory L Smith
93 Catologer Kevin Mykytyn
94 Mini-Filer Kevin Martin
127 Free-Form Filer David Myles
METABASIC
96 MetaBASIC 64 Kevin Mykytyn
100 MetaBASIC Plus John Brox Shadle
101 MetaBASIC 128 Kevin Mykytyn
SPEEDSCRIPT
103 113 114 116 116 118 125 126
SpeedScript 3.2
Fontmaker
MoilMerge
ScriptSove
SpeedCalc
SpeedView
Sequential File Converter
ScriptRead
Charles Brannon Charles Brannon . . Jerry Starling J Blake Lambert . . Kevin Martin Mark Schreiner . . Ron Carnell . Buck Childress
THE TURBO SERIES
129 TurboDisk 64 Don Lewis
132 Turbo Bootmaker Bert Rosenberg
133 TurboDisk Relocator Dino Bavaro
134 TurboDisk 128 Don Lewis
136 TurboSave 128 Michael Henry
139 TurboSave 64 William Voosen
140 Turbo Format Ross Ouwinga
|
Pnblisher |
James A. Caurlla |
|
Editoriiil l)im'(or |
Richard Mansfield |
|
MiiniiuinK t^dilor |
Kaihtccn Maninek |
|
A'isiK'iHlt' I'ubliihfr |
Sclb> Baieman |
|
Pruducliiin Dirtvliir |
Tonv Robcns |
|
Fdiwt. COMPllKIand |
|
|
coMPn t:;\ gazkii k |
Lance Flko |
|
Ediliw. C-OMPn Ers AUm |
|
|
S ) Disk & MBgazini' and |
|
|
CDMPlIK's K MaBiwiiK |
Tom R. Hallhill |
|
Milof, COMPl [K's Apple |
|
|
ApplicHlions Mift'l'ii>c |
Cirtgg Ki'i/cr |
|
Fmtures Kdilur |
Keiih Ferrcll |
|
Technical Kditor |
Otiis R Cowper |
|
As^isianl Tvchnimt Fidiliirs |
Dale McBane. Jim Fucht |
|
Assi^IunI Kdilnrs |
Todd Hcimarck, Rhcii |
|
\nderion, John Shadle. Rand\ |
|
|
Thompson. Clill" Karnes |
|
|
PruEtamniinB Superiisor |
[■ainck Pamsh |
|
Edilurial ProKrammers |
Tim Victor, Tim MidkilT. |
|
William Chin. GcorBc Miller |
|
|
Bu>Fr''> tiuidv Conrdinaliir |
Caroline Hanlon |
|
Copy KdiriitN |
Karen l.'hiendorf, Karen |
|
Sicpak. Jill Champion |
|
|
Submis'tiun-i RetieHer |
DaMd Henslcv |
|
PrnRniniminit As^i^lanl■• |
Trov Tucker. Jovce Sides |
|
E\vculi>L' Assi\lanl |
Dcbi Nash |
|
Adminixirslix' A%*ii'iranls |
Julia Fleming. Ins Brooks, |
|
Svbil Agcc |
|
|
Recepliiinj<il |
Aniia 'Xrmlleld |
|
CX)MPl rK!\ BiHik Di.Uion |
|
|
tidllor |
Stephen Lev J |
|
AwiisunI Uiton |
Tammic Taylor. Robert Bivh\. |
|
L>nnc Weatherman |
|
|
Program mi nK AsxiMant |
David Rorancc |
|
Diri-clor of Naiionul Sales |
Joseph W. Hatcher |
Production Manajt^r Irmu Swam
An Director Janice R, Far>
ASHStant \ri Dirtiior Lee Noel, Jr
Assbuni Production Manaiter [X' Putter
Aldm Rubin Case, Kim Poiiv Scolly
Billings. Tony Jacobson
TyprscliinR Tern Cash. Carole Dunlon
llluMnilur H;irr) Blair
Director nf AdierlisInK Sales Adiertisint: Director Prod ucl kin Ciiordinalor
Peter Johnsmevcr Bernard J, Theobald. Jr. Kathleen Kanlon
CusinmtT Senke ManaKtr Diane Longo Dealer Sales Supenisor Jose Cru/
lndi>idual Order Supervisor Cassandra Crrcen
James A. Casclla. ['resident
Rkbard Mansncld. Vice Presideni, Editorial Director Richud J Marino. Vice Prcsidcnl. Advcnismg Sales llcnc Bcrson Weiner, Vice President, Production
Kdilorial Board
Richard Mansfield. Kathleen Mariinek, Sclbv Baieman, Unce
Elko. Tom R. Halfhill. Stephen Lcv>
Robert l.iK-k, Founder and Edilonal Consultant
Editorial ofTiees:
Corporate oflicc*:
Cuslomer Seniee:
Dnler Saks:
3; J West \Kendover Avenue
Suite 1(X>
Greensboro. NC 27408 USA
825 7th Avenue
New York, NY tOOI9
212.265-S360
BOO-346-6767 (in NY 212-88T-8525)
10:00 AM-I2;30PM:
1:3(1 PM-3:00 PM Monday-Friday
800-638-3822 (In NY 212-887-8566)
9 AM-5 PM Mondav-Fndav
Adti-nisinK Sales Representatives Nen England & Ntid Atlantic
BiTnard Theobald. Thomas Link: 212-31S-166S MidHesI & SoulhHesI
Jerry Thompson, Lucille Dennis: .112-726-6047 (Chicagol.
71.3-731-2605 (Texas). .*03-5'J5-')299 (Colorado). 415-348-8222
(California) Vi'est. NarthMcsl & British Columbia
Jerry Thompson. Lucille Dennis: 415- .348-8222 SoulheasI A Inlernalional
HarT\ Blair 91V-275-mw
Send all advertising matcnals to. Kaihleen Hanlon
324 West Wendovcr Ave.. Suite 200 Greensboro. NC 27408
Editor's Notes
Since its first issue in 1979, COM- PUTE! has published programs for Commodore computers. Back then, the PET— grandfather of the VIC, 64, and 128 — was the reigning Commodore machine. In the years since, we've continued to offer some of the finest software for Commo- dore computers available anywhere. Collected here, in this special issue, is the best of COMPUTE! and GAZETTE — our best games, best programming utilities, best graph- ics utilities, and best applications programs. You'll find SpeedScript, an exceptional word processor; "Campaign Manager," an engaging simulation of the presidential elec- tion campaign; "Laser Beam," a fast-paced game that really tests your joystick prowess; "Meta- BASIC," a powerful BASIC-lan- guage extension that makes programming much easier; and dozens more.
Using The Programs
We recommend that you copy the programs from the enclosed disk to working disks before you run them. Then store the original disk safely away as a backup. You can use the "Unicopy" utility on the disk to quickly back up all the files.
When originally published, these programs were provided as printed listings that had to be typed into the computer before they could be used. In this collection, the pro- grams are packed onto both sides of a 5 'A -inch disk, ready to be loaded and used.
Most of these programs work on the Commodore 64 and on the Commodore 128 running in 64 mode. Several, however, are writ- ten specifically to take advantage of the 128's special features. These programs are labeled with the char- acters 128 on the program disk.
In general, you'll find the pro- gram names identical to the article titles. View the disk directory by entering LOAD "$",8
and then LIST. If you don't see the file you're looking for, turn the disk over and repeat the process on the other side.
In most cases, there's nothing more to do but load and run the program, but do read the article that accompanies each program for specific loading instructions and an explanation of all the program's features.
We know you'll enjoy these programs. Readers of COMPUTE! and GAZETTE have been using them — and telling us how much they like them — for years.
COMPUTEI Publications, Inc.
Part ot ABC ConturrMr hlagiailnet, Irtc. OtM of tha ABC PublliNng Companl**
ABC PuDiiiTiing. Prgs«]ent. Robert G Burton
1330 Avenue ot the Amedcos. ^4ew Vortt. New Voiv 10019
Best of COMPUTEI and Gizetir for Commodore 64
and 128 IS published bv COMPUTEr Puhlicaiions, Inc., B25 7th Ave.. Neiv York. NY 10019 USA. Phone: (212) 265-8360. Editorial Ofiite^ are located at 324 West Wendover Avenue, Greensboro, NC 27408. Entire con- tents copy right JOI987 by COMPUTE! PuWicationi, he. .All rights reserved
s^^
«yoo«Ji
Bring your Commodore^ to life with a FREE modem and software!
Now you can plug your Commodore into an exclusive network that's useful, easy, fun and inexpensive. Join Q-Link now and we'll give you a free modem and software to get you started.
Enjoy unlimited access to a wide range of Q-Link "Basic" services for a set fee of only $9.95 a month. Get help from Commodore experts — use the Hotline to ask Commodore questions, or search the database of information from Commodore to answer your questions on the spot. Access Grolier's Academic American Encyclopedia'", the latest news and enter- tainment updates.
Special Q-Link "Plus" sen/ices let you expand your software library with more than 10,000 public domain programs — games, graphics, business and educational software and much more! Also, you can preview new copyrighted software before you buy. Getanswerstoyoursoftwarequestions from Berkeley Softworks, Electronic Arts and Activision, to name a few. Participate in fulI<olor, multi-player games like Casino (includes Blackjack, Poker, Bingo and the Slots), Chess and Bridge. "Plus" services cost only an extra 6 cents per minute — and your first hour of "Plus" service usage each month is free!
Offer valid in ihe coniinental U.S. and Canada for new members only. Expires 6/30/88. PfiCM subjea to change wilhoul notice. There ts a commun«ations wjrtharge for conrwclion to 0-Link from Canada: 6 cents (U.S.) per minule from Montreal. Vancouver. Ottawa. Toronto. Quebec. Windsor, Krtchetiei and Calgary using the Tymnet network, and 15 cents (U.S.) per minute from over 85 other locations uiir>g the DATAPAC network
Conunodor* n t ifgisIHH) ludemaik ot CommodO'* tlKlFOriKi. Lid 0-Linli a * Wfv«»m*k o' Quantum Computet S«rvicn, IrK Groi^r't AfMlen^ir ArrifrKan Encytlopedu it i v»dt"\Mik o* Grol^r £l«ctron»< Publi%hina
With Q-Link, you can sharpen your computer skills . . . connect with people . . . discover new ways to get smart . . . save money every day . . . plus have a lot of fun!
No-risk guarantee. Try Q-Link without risk. If, at any time, for any reason, you are not completely satisfied, you may cancel your membership.
Order your Q-Link software and modem today by mailing this coupon to Q-Link, 8619 \Afestwood Center Drive, Vienna, VA 22180 or for faster service call toll-free: 1-800-782-2278 Ext. 1207
I Q-UNK RESERVATION FORM
Choose one:
□ I need a modem. Start my Q-Link membership by charging me now for my firrt 4 months at S39.80, and send me the FREE O-Lmk software and a FREE Ccxnmcxtore 300 baud aiiti>dial modem (model 1660— retail value S69.95),
□ I already have a modem. Send me my FREE 0-Lir>k software and start my 0-Liok membership by charging me now for my first month of membership at $9.95.
Full name Address ,
City
(hooPO. Bonn) State
Home phone
Choose your method of payment:
Please charge my credit card.
; Master Card i Visa
Zip
u Ched( enclosed.
A(cW
Ev.
Signature
Call toll-free 1-800-783-2278 Ext. 1207 or
mail this coupon to;
Q-Link, 8619 Westwood Cer^ter Dnve,
Vienna. VA 22180
The Commodore Connection,
Try to outwit your computer with this fast, multilevel chess game for the 64. A joystick is required.
The world was amazed, in the late eighteenth century, by a machine that had the astonishing ability to play a good game of chess. It enter- tained kings and queens. It defeat- ed Napoleon, a master tactician. Hundreds of people paid to com- pete against it, but eventually it was revealed that a small man was hid- den inside the machine.
A chess-playing machine re- mained only a dream until the late 1950s when the first computer chess game was played. Now, the World Computer Championship, held every three years since 1974, attracts almost as much publicity as the human championship matches. Why has there been so much inter- est in machines that play games?
One reason is that chess can be used to measure a computer's intel- ligence. Chess is easy to play, but difficult to master. So difficult, in fact, that some experts believe that a computer would have to be al- most as intelligent as a human to become world champion.
Of course, another reason is that chess is just plain fun, but not if you can't find an opponent. To be an entertaining opponent, a com- puter chess game should be fast, easy to use, and capable of playing at several different skill levels. "Chess" has all these features and more. Although it's really no match against the best commercial chess games, it has managed to defeat these giants of the microcomputer chess world on rare occasions.
Joystick Input
The program is found in two parts on the disk. To start the game, enter
Ctiess
John Krause
LOAD "CHESS",8 and then RUN. The first program will automatical- ly load the second (CHESS2) at the appropriate time. Both files must be present for Chess to work. After running the program, you will be asked to specify several play op- tions. You can choose among five skill levels; start a new game or set up any position; play against the computer or watch it play against itself; or play either the white or black pieces. All of these options will be discussed in greater detail later, but for now, type 1 at each prompt. This puts you in command of the white pieces versus the com- puter on level one^ the easiest level.
The first time the program is run, you need to wait a few seconds while the computer gets its brain in order. Then the board will be dis- played with your pieces on the bot- tom of the screen and the computer's pieces on the top. You should see a frame around the square in the low- er-left comer of the board (the VIC version uses a blinking square). This is the cursor which takes the place of your hand to move pieces around the board.
Use the joystick (plugged into port 2) to move the cursor atop the piece you wish to move. Press and release the joystick button. Now move the cursor to the square you want to move to and tap the button again. Your piece moves to the new square, and the computer responds almost instantly with its move.
A Spectacular Blunder
Did you make a foolish move? No problem. One of the most valuable features of Chess is the ability to change the position by adding or deleting pieces. This feature is espe- cially useful for those of us who frequently manage to maneuver into a superior position, only to
throw it all away in a single, spec- tacular blunder.
A piece can be deleted by posi- tioning the cursor on the piece and pressing the space bar. To add a piece or change a piece to a differ- ent one, move the cursor to the appropriate square and press P, N, B, R, Q, or K for pawn, knight, bishop, rook, queen, or king, re- spectively. This will put one of your pieces on the square. To add one of the computer's pieces, hold down the SHIFT key while pressing one of these editing keys.
To take back a move, use the editing keys to delete your piece and put it back on its original square. Don't forget to take back the computer's move, too.
The editing feature also en- ables you to make special moves which cannot be made with the joystick alone such as castling and en passant captures. For example, castling can be accomplished by de- leting the king and putting it on its new square, and then moving the rook as you normally would with the joystick. Although you can make these special moves, the com- puter will never castle or capture en passant because, due to their com- plexity, these moves were not in- cluded in its thinking routine.
Strange Chess
Although the computer will always make a legal move, it doesn't check to see that you do the same. You are free to move any of your pieces to any square without so much as a contemptuous buzz from the com- puter. If you're an experienced player, this shouldn't be a problem. If you're a beginner, however, you may want to familiarize yourself with the basic rules of chess lest you end up playing strange chess, a personal version which bears little
6 Best of COMPUTE I and Gazette
How Chess Thinks
You've probably heard that if a monkey sat down at a typewriter and pecked randomly at the keys for a long enough period of time, it would eventually type the complete works of Shakespeare. Theoretically, this is indeed possible — given enough time. There's the rub. At a brisk typing speed of 50 words per minute, it would take that poor monkey billions of years just to type "To be, or not to be." Nevertheless, there is power in trial and error.
The Minimax Algorithm
Substitute the monkey with a high-speed computer, and this technique becomes a practical method of imitating intelligence. In fact, it has been used with great success in the field of artificial intelligence. This program uses a popular trial-and-error technique known as the minimax algorithm.
The computer looks at the present board position and mentally moves the pieces through all the possible combinations of future moves and countermoves up to a certain point, say three moves ahead. For each combination, it calculates a score based on which pieces were captured during the combination. Each piece is worth a certain number of points depending on its general importance: 1 point for a pawm, 3 for a knight or bishop, 5 for a rook, 9 for a queen, and 46 for a king. (Of course, since you lose the game if your king cannot escape capture, the value of a king is ac- tually infinite, but 46 is high enough to convince the computer that it's a bad move.)
When, in a move being examined, the computer captures an oppo- nent's piece, the value of that piece is added to the score. Conversely, when one of the computer's pieces is captured, its value is subtracted from the score. Thus, a high score is considered good for the computer, and a low score is good for its opponent.
The task is to find the combination that represents best play for both sides. This combinafion is not necessarily the one with the maximum score, because while the computer is trying to maximize the score, its opponent is trying just as hard to minimize it. The best combination gives maximum scores during the computer's moves, and minimum scores during the opponent's moves.
After the best combination has been found, the computer's best move in the present position is simply the first move in the combinafion. The problem has been reduced from analyzing a chess position to finding the maximum and minimum of a series of numbers, which is much better suited to a computer.
50 Miliion Combinations On Levei 5
Like most algorithms based on trial and error, this one requires siffing through an enormous number of combinations to find the best one. Fortunately, a few tricks can be used to reduce the combinafions to a manageable number. This algorithm uses a technique called alpha-beta cutoff. It makes the. computer search more intelligently, giving it the seemingly paradoxical ability to find the best move without looking at all the possible combinafions. On level 5, for example, instead of having to search through roughly 2 billion combinations, it looks at only 50 million. Even so, it would take BASIC from now fill 1986 to generate that many combinations. That's why the algorithm is programmed in machine language. An advanced programming technique knowm as recursion (making a subroutine call itself) is used to generate all the possible combinations of moves. Capable of analyzing about 5000 combinations per second, this roufine provides a moderate challenge at a reasonable playing speed.
resemblance to the real game. On the other hand, if you like to fudge a bit, the computer will make it easy. It will politely acquiesce to your most surreal moves.
When a pawn reaches the oth-
er side of the board, it's automati- cally promoted to a queen. If you would rather have a knight, bishop, or rook, you can easily make the change using the editing keys.
Checlcmate
The computer thinks by analyzing thousands of possible moves and countermoves and choosing what it considers to be the best move based on the relative value of the pieces (see "How Chess Thinks"). Most po- sitions don't have just one best move but several which are equally good, in which case the computer chooses among them at random. This ran- dom factor insures that every game vni\ be different, and makes for var- ied and interesting play.
Play confinues until one side is either checkmated or stalemated. The computer will then stop play and indicate which side has won.
There are a few quirks in the way the computer determines whether checkmate has occurred. On levels three through five, it an- nounces checkmate prematurely. When this happens, the computer has determined that it's impossible to avoid checkmate on the next move or two, assuming both sides make the best moves.
Also, the computer doesn't know the subtle difference between checkmate and stalematg. Conse- quenfiy, when stalemate occurs, it will announce checkmate although, in fact, the game is a draw. Since the computer tries as hard as it can to checkmate its opponent, it will also try to achieve stalemate, possi- bly forcing a draw when it could have won. Fortunately, this rarely happens because the conditions for stalemate exist only in unusual cir- cumstances such as when one side has only the king remaining.
Also, the computer won't give you any hint when your king is in check (not checkmate). So be extra careful that you don't leave your king in check or move into check. Otherwise, your king would be in check during the computer's turn to move — a highly unorthodox if not illegal position. The computer's re- ply to such a position is unpredict- able, but it usually announces checkmate, forcing you to restart the game.
In any case, when the com- puter announces checkmate, press the joysfick button to start a new game. If you want to try out some of the other play options without waiting till checkmate, you can start
Best of COMPUTE! ond Gazette 7
a new game at any time by pressing RUN/STOP-RESTORE and run- ning the program again.
Play Options
When you choose the black pieces, the board will revolve so that you still play from the bottom. Since the player with the white pieces always moves first, you must wait for the computer to move before you will be allowed to make your first move.
If you become mentally ex- hausted after several bouts against the computer, give your brain a rest and watch the computer play itself. When you select this option, just set the joystick aside and sit back and watch the action. Beginners will find this feature an excellent way to learn some good strategies to use against the computer.
You don 't have to begin a game from the starting position. If you choose the option to set up a position, an empty board will be displayed and you can use the edit- ing keys to place pieces on the board in any position. When the position is set up, the computer will start thinking after you make your first move.
This feature is especially useful for continuing a previous game or creating a problem for the computer to solve. It also allows you to experi- ment with hypothetical or down- right ridiculous positions. Live out your fantasy by giving yourself ten queens versus the computer's lone king. The position doesn't even have to be a legal one. You could invent your own type of chess by giving each side two kings, for ex- ample, although the computer may get confused trying to determine when checkmate has occurred.
One of the advantages of a computer opponent over a human is that you can tell the computer exactly how hard you want it to try to beat you, and it will obediently play at that level of difficulty. This is important because it's no fun if you always lose or always win effortlessly.
You have five skill levels to choose from. The difference be- tween one level and another is the number of moves ahead that the computer looks. On level 1, for ex- ample, it looks two moves ahead (its move and your reply). Each suc- ceeding level looks ahead one more
EXPERIENCE THE THRILL OF GAMBLING
with VEGAS GAMBLER and VEGAS CRAPS, the sensational
new releases from California Dreams.
Feel the excitement of your favorite games with VEGAS
GAMBLER'S slots, blackjack, poker, and roulette.
Place your bets and throw the dice with VEGAS CRAPS, a
true to life simulation of a casino craps table.
Play for fun or to sharpen your gambling skills.
Be a winner! Pick up your copies today!
.t^^r
""""^
iDriSanM™
ti» nasarwd
' Loycal Design ' ) Momagus Expwy.. Suiie 403 I JoM. CA 95131 U.S.A. (406) 43S-t44S EUROPE tOenmJ'M 022« 97fi2
CAUFORNIA
M now lot C 64,-12S and ST (cotof ^ mono) I lor IBM PC, A()f]ta II. MKl >
move than the previous level.
Alas, the smarter play on the higher levels doesn't come without a price. The further ahead the com- puter looks, the more moves it must examine and, hence, the longer it thinks. The thinking time varies greatly depending on the level (about one second per move on lev- el 1; about two hours on level 5).
Here's a rundown of the five levels:
Level 1: Beginner. Thinking time; one second. Look ahead: two moves. Fast but dumb.
Level 2: Intermediate. Thinking time: five seconds. Look ahead: three moves. Provides a reasonable challenge for impatient players.
Level 3: Tournament. Thinking time: two minutes. Look ahead: four moves. Since the usual time limit for tournament play is 40 moves in two hours, an average of three minutes per move, this level is best suited for serious players.
Level 4: Mate in two. Thinking time: 30 minutes. Look ahead: five moves. Capable of solving most male-in-two problems.
Level 5: Postal chess. Thinking time: two hours. Look ahead: six moves. Simulates postal chess games where there is no time limit. Can avoid checkmate in two moves.
The thinking times given here are average times. The actual time ranges from half to twice the aver- age time depending on the position.
Level 4 can be used to solve mate-in-two problems such as those published in many newspapers, just select the following options: level 4, set up position, computer versus it' self. Enter the position using the edit- ing keys, and then make a do- nothing move by positioning the cursor over a white piece and press- ing the joystick button twice. After several minutes of deep thought, the computer should respond by moving one of the white pieces (the solution) and announcing checkmate. The only mate-in-two problems that the computer cannot solve are those which involve castling, en passant captures, or pawn promotion. ®
8 Best of COMPUTE! and Gazette
Power Poker
This is one of the most addictive games we've ever published. It adds a new dimension to the traditional game of poker, and is fun for one player or in competition with friends. For the Commodore 64.
Poker is a game that's just as popu- lar today as it was a century ago. Even though there's always a ran- dom element at play, it usually re- quires careful thought and a knowledge of probability. The vari- ations created by the cards you're dealt and how you arrange them makes poker unpredictable. "Pow- er Poker," written for the Commo- dore 64, adds a new twist to the game — rather, another dimension.
A Double Purpose
Think of this game as two-dimen- sional poker. You play on a five-by- five grid and try to make the hands that gain the most points. Each card serves two hands, so placement must be done carefully. (If you're new to poker, see "Poker Hands.")
When you run the program, you'll see a table of the number of points awarded for each kind of hand. After a pause of a few sec- onds, you're ready to begin. A five- by-five grid is displayed, each position identified by a letter A-Y.
The computer randomly se- lects a card and displays it. Place it in the grid by pressing the appro- priate letter. After the card is placed, a new one is chosen and displayed, and so on, unhl all 25 cards have been placed. Choose
Jud Bleser
your moves carefully, and remem- ber; There are 52 cards in the deck, but you'll only have 25 to play with. The goal is to make the most points possible. Scoring is based on the hands you build. After a col- umn or row is completed, points are totaled and added immediately to your score. (High score is displayed at all times on the screen also.)
Here are the values for each hand:
Hand
Points
|
Royal flush Straight flush Four of a kind |
400 300 160 |
|
Straight Full house |
120 100 |
|
Three of a kind |
60 |
|
Flush |
50 |
|
Two pair One pair |
30 10 |
To remember the value of each hand, you can press fl at any time
during the game to see the table of values. Press it again to resume play. Poker players may notice that some of the hands are out of order. Normally, a flush would be much higher on the list. But remember that you're drawing 25 cards and the odds for getting two or three flushes are very high. Higher point values have been given to hands that are less likely to occur.
Hands do not need to be in sequential order. For example, "5,6, 4,7,8" is a valid straight. However, "roll-over" or "round the comer" straights such as "3,2,A,K,Q" are not allowed. Straights using an ace as low (A,2,3,4,5) or high (10,J, Q,K,A) are acceptable. If you're playing Power Poker on a black-and-white TV, change the value of variable TV from 1 to 0 in line 100.
Poker Hands
If you've never played poker, it's very easy to learn. There are 52 cards, di- vided into four sets {or suits) of 13. The suits are hearts, clubs, spades, and diamonds, and each suit consists of cards numbered 2-10 with a jack, queen, king, and ace. The object is to make one of the following hands (examples are in parentheses):
Royal flush: 10,J,K,Q,A— all of the same suit
Straight flush: a sequence of five of the same suit (9,10,J,Q,K — all
diamonds) Four of a kind: four of the same value (2,2,2,2) Straight: five in sequence (4,5,6,7,8) Full house: three of a kind plus a pair (10,10,10,4,4) Three of a kind: three of the same value (9,9,9) Flush: five of the same suit (2,K,8,A,5 — all clubs) Two pair: two groups of two, each of the same value {A,A,6,6) One pair: two of the same value (10,10)
Best of COMPUTEI and Gazette 9
Program Construction
Initialization Print High Score Print Score Call Screen #2 Shuffle/Grid Set-Up Came Play Routine Test for Completed Row Test for Completed Column Game End Routine Data Collection - Row Data Collection - Column Data Evaluation Print/Flash Poker Hand Data: Redefined Characters Data: Cards/Suits Data: Screen Location Table Data: ML Routines
Line # Function
100-380 390-420
430-460
470-490
500-550
560-650
660-670
680-690
700-780
790-890
900-990
1000-1120
1130-1150
1160-1290
1300-1310
1320-1340
1350-1730
Variables
A$ "{16 DOWN}"
B$ "{1 DOWN} {27 RIGHT}"
C$ poker hand scored
CA card (Jl)
CK shuffle check
CO color
CS total value of row/column
E box used
H box selected
HS high score
K same kind
L same suit
NH new high score
P card to flash
R straight
SC score
SM screen memory
SU suit 02)
TV color or b/w television
Machine Language Routines
49166 49180 49194 49297 49396 49422 49449 49502
While Background Clear Card Grid Set Up Draw Card Flash Off Flash On Save Color Restore Color
SOLiTAIRE
Ben Elizer
Looking for something different to do with your computer? Like the conven- tional game of solitaire, this comput- erized version requires you to think ahead at all times.
"Solitaire" is an electronic version of the familiar card game. Like the original, this game challenges you to put a deck of cards in order using the fewest possible moves.
Unstiuffling Ttie Decic
As you probably know. Solitaire has a very simple object. After shuf- fling a deck of playing cards, you must put them back in order, fol- lowing a few simple rules. Though there are several different varia- tions of the conventional game, here are the rules for this version:
When you run the program, the computer deals out four rows of 13 cards, then removes the aces, leaving four empty spaces. Your goal is to rearrange the cards into four rows of the same suit, putting the cards in each row in ascending order from the lowest (2) to the highest (king), without leaving any empty spaces between cards. That sounds simple enough. But since you must move a card into one of the four empty spaces, your choices for any given move are limited.
Your position on the screen is shown by a blinking cursor. Press the M key to move from the current
position to another empty space. When you press P, the computer moves a card into the current space: Which card it puts there depends on which card is immediately to the left of the space. Whenever possi- ble, the computer uses the next card in suit. For example, if the card to the left of your current position is the 2 of hearts, pressing P puts the 3 of hearts in the current space and puts a space where the 3 of hearts was before. If you press P on a space to the right of the queen of diamonds, the king of diamonds moves from its current position to that space, and so on. Each time you press P, one space is filled and another is emptied.
in this way you can gradually move cards into the right order. When you press P on a space at the beginning of a row, the computer asks which suit to play (hearts, clubs, spades, or diamonds). This determines the suit for that row. While it's possible to win on only one deal, most games require two or more deals. When no moves are possible (every empty space is fol- lowed by a king or another space), the computer automatically shuffles the remaining cards and deals them out again. Of course, it does not disturb cards that are already in cor- rect order. You'll find that it takes considerable foresight to win consis- tently in only two or three deals. Completely random play results in an average of nine or ten deals. Q
Sea Route to India
A Historical Simuiation For Tl-ie 64
Here's your chance to make history on the "Sea Route to India." Following in the wake of Portuguese explorers, you can find gold and adventure, if you don't starve, or get sunk by pirates, or capsize in a terrible storm.
One of the earliest games for PET computers was Westward Ho, in which the player becomes a tum- of- the -century pioneer, trying to cross the country in a covered wag- on. Decisions must be made about purchasing food, supplies, and am- munition. Various experiences — hunting, Indian attacks, settle- ments— occur on each leg of the journey. By repeatedly playing the game, the user leams where to spend money, how to hunt, and whether to trust strangers. Luck, however, is a major factor in suc- cess. PET users of all ages played the game over and over until they finally reached the West Coast.
Westward Ho was an abbreviat- ed version of Oregon Trail, in which the game's designers took pains to produce an accurate simulation. They used prices from contempo- rary catalogs, and calculated fre- quencies and likely locations of Indian attacks by studying histori- cal accounts. The result was a game that was both interesting and infor- mative.
Soil Ttie Bounding Main
"Sea Route To India" uses a similar technique, drawing on the voyages made by Portuguese explorers in the fifteenth century.
The subroutine beginning at line 15000 introduces the game and gives you the rules.
Your goal is to sail from Lisbon around Africa to India. During the
M. J- Winter
voyage, you encounter the same dangers faced by the real explorers: hunger, thirst, pirates, natives, weather, mutiny, and attack by Arab traders.
Your journey is charted in weeks on a map displayed on the screen. Lines 500-800 contain the loop for each week. The miles you sail depend on the weather. Each week your store of water, food, and supplies decreases by one unit. If your voyage lasts more than 30 weeks, the crew's happiness also decreases by 1.
Each week you have a new experience; line 560 sends the pro- gram to the appropriate event. In the early part of the voyage, you sight whales and other ships, and sail into terrible storms. But after you pass the Cape of Good Hope and pick up your Indian pilot, you might be attacked at any time by Arab dhows.
Check Your Progress Every Weeic
At the end of each week, the pro- gram assesses your situation. If you sailed far enough to visit the Ca- nary or Cape Verde Islands, then your water, food, supplies, and crew happiness are restored. The ship's log is updated, and the game map shows your progress. Lines 91-93 define DT$ (dots); three characters are needed for each dot. One dot on the map represents 200 miles (line 1002). Then, if there have been no fatal shortages, the voyage continues for another week. Your ship "sails" across the screen in line 15155. In the race (lines 3093, 3096), the ships are placed at the right of the screen and a string of DELETEs is printed sev- eral times. (If you win the race, the
crew is happier; they become dis- gruntled by a loss.)
Lines 1000-1250 contain the whale hunting routine. The whales are within a long string (F$) of shift- ed spaces, which are cyclically rear- ranged (line 1210) and the leftmost 40 characters printed each time. The program checks the keyboard, then moves the whales until you press H, which drops the harpoon. The pro- gram then alternately moves the whales and lowers the harpoon.
To check whether the harpoon hits a whale, the screen is opened for INPUT (line 1100). The entire row of the screen to the right of the harpoon is input. If the first charac- ter is not a shifted space, a whale has been hit.
Landfall To Gattier Supplies
The subroutine beginning at line 4000 describes the sighting of a river mouth. Landing offers you a chance to get food and water, and to cheer up the crew. Sometimes (line 4060) natives appear. As many early ex- plorers discovered, they are unpre- dictable. Sometimes they are friendly and trade gold for trinkets (cheering up the crew); sometimes they attack.
If they attack, you must type RUN and press RETURN quickly. The clock is set to 0 in line 4320, to time how fast you typed in RUN. After you press RETURN, the pro- gram looks at the clock. If more than 200 jiffies have passed (line 4340), the natives attack and kill you.
The same timing technique is used when the Arab dhows attack. The Arabs are fiercely determined to protect their trading routes. Vasco da Gama himself was nearly trapped by them more than once.
Best of COMPUTE! and Gazette 1 1
Campaign Manager
This two-player national election simulation ranks as one of the best games we've published. With the right strategy, your candidate can make it to the White House. For the Commodore 64.
The Democratic delegates are gath- ered in Moscone Center, wearing straw hats, carrying balloons and signs. The floor fights are done. The time has come to nominate.
"Maryland?"
"Mister Chairman — the great state of Maryland, The Free State, Home of the World Champion Bal- timore Orioles, casts all of its votes for the senator from Arizona."
The chairman pounds his gavel. The din of cheers and jeers subsides. The convention is deadlocked. And you control a large block of uncom- mitted delegates. It's all up to you.
The vice president from Rhode Island has good charisma and intel- ligence, but you know his health is poor. The reverend from Arkansas is attractive, but a bit conservative. Al- though the senator from Arizona is experienced, he's not very smart. Perhaps the New Jersey doctor? No, the Ohio senator has the best combi- nation of personality and issues, plus you'll get a home region advan- tage in the populous Heartland.
Now it's the Republican's turn. Of the five choices, the woman from South Carolina is the best all- around candidate. She has high charisma and fundraising appeal, which translates well into televi- sion ads.
It's time to hit the campaign trail.
Todd Heimarck
The Democratic senator starts with $9 million and 59 health points. He rests two days (to build up his health), then spends two days fundraising. Campaign stops in Illinois and Texas sway the vot- ers slightly to the Democratic side.
The Republican campaigns in her home state of South Carolina. She then moves on to North Caroli- na, Virginia, and Florida, followed by a couple of days resting.
As the campaign progresses, the Democrat concentrates on per- sonal appearances in the industrial northeast, plus forays into the larger states such as Texas, California, and Florida. The Republican candidate does less actual compaigning, pre- ferring to spend more time on fund- raising to pay for the (expensive) television ads.
In the crucial eighth week, both candidates rest and fundraise in prepration for the last minute campaigning. The Democrat does a media blitz in the Pacific, Southern, and Aflantic states. The Republican hits the Heartland, Arklatex, and the Urban Northeast.
Initial returns from New Eng- land show the Republicans sweep- ing the region, but the large states of New York and Pennsylvania went Democratic. The Republicans won most states from Ohio to the Great Plains, but the Democrats picked up the Southern Atlantic states (except Florida). Texas voted for the GOP, while the rest of the region went Democratic. The Rocky Mountain States were solid Repub- lican. The Democrats won the Pa- cific States.
The final results show the Re-
publicans winning six of nine re- gions and capturing the presidency, with 315 electoral votes to the Democrats' 223. Three of the four biggest states voted Democratic, but Ohio and Illinois (with 47 elec- toral votes between them) made the difference. The TV ads in the last week moved these two key states into the Republican camp.
Nine-Week Campaign
Written entirely in machine lan- guage, "Campaign Manager" pits you against an opponent. Each of you manages the campaign of your candidate. The player who makes the right decisions gets his or her candidate elected.
You have nine weeks to cam- paign. Each week you plan your moves and enter them via the menu on the itinerary. You have two de- fensive moves, resting and fund- raising, and two ways to gain votes, campaigning (personal appear- ances) and advertising on television.
At the beginning of each turn you see a medium-resolution map of the U.S. which indicates which way each state is leaning. The MAP option allows you to move a cursor around the country, to identify which states are which. If the Re- publicans are ahead, the state is red. Democratic states are cyan (light blue). If you're using a black and white television, the Republi- can states are the darker ones. You may notice that states occasionally switch back and forth, even though neither candidate campaigned or advertised there. This indicates that
1 2 Best of COMPUTE! and Gazette
the voters in that state are split down the middle, and because of slight errors in polling, seem to be leaning one way or the other.
Since you only have 63 days {nine weeks of seven days), you have enough time to campaign in each state once or twice. But in terms of electoral votes, California (with 47) is far more important than some of the smaller (three vote) states like North Dakota or Vermont.
Generally, it makes more sense to campaign more heavily in the ten biggest states, sometimes called "megastates". State Electoral Votes
|
CA |
47 |
|
NY |
36 |
|
TX |
29 |
|
PA |
25 |
|
IL |
2ft |
|
OH |
23 |
|
FL |
21 |
|
MI |
20 |
|
NJ |
16 |
|
NC |
13 |
Winning the election requires 270 electoral votes {of a possible 538). The ten biggest states account for 254, just 16 short of a majority.
At the beginning of the cam- paign, each state has a large pool of undecided voters. As the game pro- gresses, they make up their minds and the pool diminishes. It's possi- ble, but unlikely, for all of the state's voters to decide before the end of the campaign. You would have to go to the state at least eight times before the undecided points were used up.
Each state has a built-in bias toward one party, based on past elections for president, senator, governor, etc. The District of Co- lumbia, for example, is staunchly Democratic, so the Democratic can- didate will automatically get seven campaign points there, compared to a Republican's two.
Since the Republicans have won three of the last four elections (including a landslide victory in 1972), you might expect them to begin the game with a huge advan- tage. But if you look at non-presi- dential elections, you will find a lot of states that elect Democratic gov- ernors, senators, and representa- tives and then vote for a Republican president. And a lot of those basi- cally Democratic states were split by third-party campaigns (Wallace
in '68, Anderson in '80).
To even things up, and make the game more playable, the Demo- crats begin with an electoral vote advantage of 282 to 256, although four of the megastates (PA, OH, FL, and NC) are barely leaning to the Democratic side. The Republicans have the advantage of beginning with 29 of the 51 states (since DC has three electoral votes, it counts as a state). Most of the states west of the Mississippi are Republican, while the Democrats have most of the industrial Northeast and the South.
In addition to the natural polit- ical leanings, each state believes certain things about five general issues:
1) unemployment/inflation,
2) poverty /crime,
3) agriculture,
4) education, and
5) defense.
(The issues are based on cen- sus reports, almanacs, etc.) A very urban state might be conservative on crime, but not care much about agriculture, for example. Each can- didate has certain stands on these issues. When you campaign or ad- vertise in a state, you can get up to three extra campaign points for each issue, if you agree with the citizens there.
Finally, the candidate you choose has a campaign effective- ness rating based on charisma and intelligence. This factor translates to votes each time you campaign in a state.
To start the game, choose which party will go first. You might want to flip a coin, the winner choosing either a party or to go first or second. In testing, we found that the second player has the very slight advantage of making the last move. Next, decide if one of you will start out as the campaign man- ager for the president running for a second term. Being incumbent gives you some extra campaigning strength, and is not recommended if you want an even game.
Note that all choices can be made with a joystick in either port. Move the pointer to a menu item and press the fire button twice to make your choice. If you don't own a joystick, use I, J, K, and L for up, left, down, and right respectively.
Press M in place of the fire button.
Players then pick which candi- date will represent their party. Five randomly chosen candidates are available. To the right of the candi- date's stats is the YES/NO counter. Before making your choice, pick NO for each possibility until you have seen all five. They will cycle around again so you can make your choice.
The heart of the game is the actual campaign, but in some ways the convention is more important. Nominate a terrible candidate and you'll spend most of your campaign trying to catch up.
A candidate's personality greatly affects the outcome of the election. In the lower left corner you'll see a list of five attributes, each associated with a number from one (worst) to eight (best). With a couple of exceptions, the ideal candidate is the one with straight eights.
First is charisma (CHAR), which is personal magnetism, pa- nache, the ability to influence and excite people. This is the most im- portant personality trait because it is part of both campaign effective- ness and advertising effectiveness.
Stamina (STAM) rates your candidate's health. A candidate with low stamina will have to rest frequently to regain health and strength.
Intelligence (INTL) adds points to campaign effectiveness and last minute campaigning.
Experience (EXPR) helps you with fundraising. If your candidate has lots of experience, he or she has more contacts and connections for raising money. Since experience comes with age, it counts against your health, although stamina counts for more health points.
Appeal (APPL) also contrib- utes to fundraising appeals. But if you have maximum appeal (eight) you may be tainted by your affili- ations with special interest groups, and there is a backlash when you advertise. It's best to have an ap- peal of six or seven.
The candidates' attributes are generated by adding three random numbers, so candidates are more likely to have a middle number (four or five) than one of the extremes.
Best of COMPUTE! and Gazette 13
The personality traits translate into these five campaign factors;
Campaign Effectiveness
(CHAR*2 + INTL): the key factor in campaign stops.
Strength/Health (STAM*4 + 9 - EXPR): determines the effec- tiveness of a rest day.
Fundraising Appeal (EXPR*3 + APPL): determines hov^f much money can be raised in a day.
TV Ads (APPL OR 8 + CHAR): translates into votes when advertising.
Last Minute Campaigning (INTL + STAM): wins last-minute votes to your side after the ninth week.
The significance of each factor is discussed later.
Campaign Issues
Next to the personality factors are the candidate's stands on various issues. You see five issues, each with a sliding scale of one (at the far left, representing liberal) to six (conservative). A Republican who wants to get tough on crime, for example, will have a rank of six. A Democrat who wants to solve the unemployment problem will have a rating of one.
Candidates will range from two to five on the issues of agricul- ture and education. On the other three issues, the Democrats will have stands from one to four; the Republicans will go from three to six.
You will generally get more votes with middle of the road be- liefs. Look for a candidate with twos or threes if you're the Demo- crat. Fours and fives are best for the Republican. The exception is agri- culture and education, where you do best with a three or a four.
Common sense tells you which issues are important in most states. Agriculture is a major issue in the farming states. Your stand on de- fense makes a difference in states with a lot of military-related industry.
The candidate's personality is generally more crucial than the stands on issues. If you have a lot of charisma, intelligence, and appeal, it doesn't matter that you may have
radical views on one or two issues.
If you have five very bad can- didates, press RUN/STOP-RE- STORE and try again. It's not much fun to run a campaign you are des- tined to lose.
After the nominees have been chosen, the first week begins. You may notice that some states have changed colors. That's because each nominee gets the equivalent of cam- paigning once in each state. Some people make up their minds before the campaign even starts. If one can- didate is much more charismatic, or happens to hit the right issues, a state may jump over to his or her side. In addition, each gets a home state and home region advantage.
You should develop a strategy. If your appeal and charisma are strong, concentrate on television ads. If your candidate has a strong anti-crime stance, visit the more ur- ban states. At the very least, you should plan to visit each of the megastates.
You begin in your home state where it is traditional to campaign once (but not twice). And the first week usually means some fundrais- ing and resting as purely defensive moves.
Under the week's itinerary are two numbers representing money and health. At the beginning of each week, your treasurer tells you how much money you have, up to a maximum of $25 million. Your per- sonal physician figures out how healthy you are. At most you'll have 255 health points.
If you fall below $4 million any time during the week, television advertising will be useless until you replenish the campaign coffers. If you have less than one million, you won't be able to pay the pollster (the bar graph to the left of the map will disappear). When your bank account falls to zero, the campaign is paralyzed until you sponsor a fundraiser. You can't even afford to pay your doctor or staff.
It takes time away from cam- paigning, but you have to raise money once in a while. Each fund- raising point (experience times three plus appeal) is worth $200,000.
Campaigning takes a lot out of you, so you have to occasionally
take a day to rest and relax. When you decide to catch some Zs, the itinerary will be filled with (you guessed it) Zs. Each day of rest adds double your strength factor, plus campaign effectiveness, plus the number of states you are winning to the health you have. A high cam- paign effectiveness gives you opti- mism; you rest better. If you're behind, you lose sleep worrying about it. Resting two days in a row gets you 16 extra health points.
There are two reasons to keep your health up. First, when you campaign in a state, you get an extra campaign point for every 32 health points you possess. Second, if your health falls below eight you look haggard and stutter; cam- paigning does you no good.
The treasurer counts dollars, the doctor counts your health, and your pollster counts votes.
The pollster does three things. First, you get a bar chart that shows how many electoral votes would go to the Democrats and Republicans if the election were held at that time. You can see it to the left of the map. The gray bar marked U repre- sents undecided states too close to call. Second you have a map of the U.S. to show you, at a glance, which way each state is leaning. Republican states are red; Demo- cratic states are blue. These first two services are part of the pollster's contract, and cost you nothing. Of course, if your money drops lower than one million, you have to stop paying the pollster; all you get is the map.
The third service is the most important — regional polls. To get a poll of all states in a region, move to POLL on the main menu and press the fire button twice. You'll see a bar chart showing which way each state in the region is leaning, from one (half a character wide) to four (two characters). The poll reflects the political situation at the begin- ning of the week; whatever cam- paigning you have planned for the week is not included. A state with a thin bar can usually be taken with a single campaign stop.
Don't use polls in the first cou- ple of weeks because most states start out fairly even and you won't learn much. But polling can be a powerful tool towards the end of
14 Best of COMPUTE! and Gazette
the game. If New York is firmly committed to you, forget about fur- ther efforts in that state. And if you find a whole region weakly sup- porting your opponent, you can hit them with TV ads and score a few dozen electoral votes.
Regional polls cost $100,000 and are not available if you begin the week with less than $1 million.
The final character (although transparent) in your entourage is the jet pilot. Your jet can carry you on short hops within a region for almost nothing. But if you travel to a new region, you shell out $100,000 for fuel, maintenance, etc. As long as you're in a region, you might as well stay there a few days to avoid a lot of travel expenses. Again, you don't actually move to a new region until you have cam- paigned in one of the states. You can use the travel option to conduct regional polls; you'll pay $100,000 for the poll, and another $100,000 if you decide to campaign in a region. If you travel to a region to poll and decide not to campaign, you won't be charged for traveling.
Benjamin Franklin once said that after three days, guests and fish begin to smell. The same principle applies to campaigning.
Campaign once and you gain some votes. Stay for a second day and the voters of a state are flat- tered; you gain a couple of bonus votes. But stick around for a third or fourth day and you have over- stayed your welcome. Do not cam- paign in a state more than two days in a row.
Voter Points
Each state begins with 255 undecid- ed voter points. Your main goal is to use campaigning and television ad- vertising to sway the undecided. And you have to maintain your health and money.
The effects of a personal ap- pearance can vary. You get up to three points for each issue (if the state agrees with you), one point for every 32 health points, and up to 24 for your campaign effectiveness {in- telligence plus double charisma), and a two point bonus if it's your second day in the state.
If your money is down to zero, you get no campaign points. If your
health is below eight, you get a single vote.
Each campaign stop decreases your health and money. It's possi- ble to run out in the middle of the week, making each succeeding visit ineffective until you rest or raise money. Let's say you go to Con- necticut and impress 23 of the 255 undecideds. The pool of available voters is reduced by that number. Half of 23 (11 points) is charged against your health. Half again (5 points) times $ 1 00,000 is subtracted from your money. In addition, each state has some people who don't agree with you, so a quarter of your total (five points) goes to your op- ponent as a reaction against your speech. If you had previously been in a different region, travel ex- penses of $100,000 are subtracted.
Television advertising is a little different. It affects every state in the region, and quickly swings voters to your side. To advertise, first travel to the region and make at least one campaign stop to establish your presence. You can then place the cursor on TV ADS and press the fire button twice. After campaigning once, advertise as much as you like.
Unlike resting and campaign- ing, the effects of advertising do not accumulate from day to day. If you advertise two days in a row, you don't get bonus points. Advertising does grow in strength from week to week, however, and will be more effective towards the end of the campaign.
If you flood the region with ads, it's possible to bring a whole section of the country to your side. But it is costly. In each state, adver- tising credits you with half your campaign effectiveness, half your TV ads effectiveness rating, points for issues, plus two times the week number (in week seven, for ex- ample, you get 14 extra campaign points).
The cost is the usual one- fourth of campaign points gained, plus double the TV ads' effective- ness. The large regions can cost a lot. Going on TV in the Atlantic States (all nine) or in the rocky Mountains (eight) can deplete your treasury.
On the day you plan to adver- tise, you must have at least four million dollars. If you don't, you
waste the day and gather no new votes. So, if you begin the week with $5 million, and campaign in six states, it's Hkely you'll have less than $4 million by Saturday. Your ad campaign will do you no good. There is one more item you can choose: RECONSIDER. If you make a mistake, this option wipes your itinerary clean so you can start the week anew. Your choices are not permanent until you fill out the seventh day and press the fire but- ton. (If you pull down on the joy- stick, your slate will be wiped clean — a quicker way to reconsider.)
Last-Ditch Efforts
The ninth week is usually the most hectic. If you sponsored some fund- raisers in week eight, you will want to spend a lot on TV advertising in the regions where you have a chance. Polls can tell you which states are most vulnerable.
After both candidates have fin- ished their last week of campaign- ing, a couple of things happen. The last region to be visited by a candi- date gives a few extra votes to him or her. And the last-week routine goes into action, as all the undecid- ed voters make up their minds. Each candidate gets his or her last- minute campaigning points (intelli- gence plus stamina) added to each state in the country. The undecided voters are split between the candi- dates and ties are resolved (based on the built-in bias to one party or the other).
The map is drawn for the final time. The final bar chart appears to the left (which should indicate at a glance which candidate won). Be- ginning with region one (New Eng- land), the electoral votes are displayed, with region totals below.
The winner is the candidate with the most electoral votes. There is a slight chance that there will be a tie, in which case you'd have to flip a coin. If you want to play again, press RUN/STOP-RESTORE and type RUN.
Here are a few rules of etti- quette which help to make a fairer game.
First, if you're playing with two joysticks, try to avoid interfer- ing with your opponent's choices. Remember, the joystick routine
Best of COMPUTE! and Gazette 15
reads both joysticks.
Second, when you have filled out your itinerary and the prompt PRESS FIRE BUTTON TO CON- TINUE appears, let your opponent study what moves you made, and he or she can then press the fire button.
Third, since polls cost money, they should be kept private. When the other player is taking a poll, avoid looking at the screen.
Main Menu Command Summary
CAMPAIGN — allows you to make a personal appearance in one of the states of the region you're visiting. Results depend on campaign effec- tiveness, built-in party bias of the state, health, and issues. Does not work if you have zero health or money, or if all undecided voters have been claimed. Gains votes, costs health and money.
TV ADS — blankets the region with advertising. Reduces health and costs a lot of money, but can quickly deliver a big chunk of votes. Net votes based on TV advertising effectiveness, campaign effective- ness, and issues. Does not work if you have less than $4 million.
FUNDRAISE — raises money for your campaign based on fund- raising ability. Takes a day, gains no votes, costs nothing.
REST — builds up your health points, according to strength factor. Extra points if you rest two days in a row. Gains no new votes, costs nothing.
MAP — moves the cursor around the map, prints the state name, electoral votes, and region number. For information only, costs nothing.
POLL — provides a bar graph showing which way the states in the region are leaning. Costs $100,000 (immediately). Not avail- able if money falls below $1 million.
RECONSIDER— erases the week's itinerary if you make a mistake.
TRAVEL — takes you to a new region of the country. Costs $100,000 (not charged to you until you actually campaign there). ®
Pool
Joseph T. V\/oyton Version by Kevin Mykytyn
Chalk up your cue stick and sharpen your skills with this exciting simula- tion of pocket billiards. For one or two
players.
The rules of "Pool" are simple — you try to sink the billiard balls on the table by aiming and shooting the white cue ball.
To play Pool, load it from disk using a secondary address of 1: LOAD "POOL",8,l. SYS 49152 starts the program.
The title screen comes up first, with a ragtime melody playing in the background. You choose a one- or two-player game. The screen clears and the pool table appears.
At the start of the game, the white cue ball is at one end of the table and six balls are arranged at the other end. There are six (rather than 15) because only eight sprites are available on the 64. Using the joystick, position the cue ball in the "kitchen," behind the scratch line. When you're ready to shoot, press the joystick button once. A cross- hair appears on top of the cue ball.
Move the crosshair in the di- rection you want to shoot. Pressing the joystick button starts the cue ball rolling.
The distance between the cue ball and crosshair determines the strength of the shot. The farther away, the harder the shot. There is
a limit on how far you can move the crosshair (approximately two- thirds the length of the table). On the initial break, you'll probably want to shoot hard. On later turns, the strength of the shot will deter- mine how far the cue ball travels after a collision. Strategic soft shots can help you set up the table for the next shot.
The goal in the one player game is to clear the table in the fewest number of shots (the record here at COMPUTE! Publications is eight). When all balls are in the pockets, you're ranked according to your ability, from Pro (the best) to Pool Shark, Amateur, and Novice.
In the two-player game, you try to outshoot your opponent. When you sink a ball, it's placed on your side of the screen. With six balls in play, tie games are possible.
A scratch occurs when you knock the cue ball into a pocket, or when the cue ball doesn't hit any- thing before coming to a stop. You lose your turn, one of the balls to your credit is put back on the table, and the cue ball is placed in the starting position. Your opponent can then put the cue ball anywhere behind the scratch line.
Pool does not completely follow the laws of physics, although it offers a realistic simulation. The sprites are moved pixel by pixel, but the move- ment is calculated in 256ths of a pixel for inaeased accuracy. ®
16 Best of COMPUTE! and Gazette
Bingo 64
Richard L. Witkover
"Bingo 64" is a cleverly written com- puter version of the classic game. It makes good use of the 64's graphics and sound capabilities to provide you and three friends with many exciting games of bingo. A joystick is required.
Few people have not known the anticipation, heard the click of the balls, the call of the number, and finally, the excited shout of "Bin- go!" Here's a four-player version of this world-famous game written for the Commodore 64.
Setting Up The Game
Before you begin playing, you have to choose your mode of play from a menu. Manual ball feed allows you to control the pace of the game, if you opt for auto ball feed, the com- puter automatically picks the next number. Choose manual cover if you want to cover the spots on your card yourself (using the joystick). If you want your 64 to cover the spots, pick auto cover.
After you make your choices, four blank cards are displayed on the screen. Each column on a card corresponds to one letter of the word BINGO. The five numbers in each column are selected from 15 possible values and are checked to prevent duplication. This process is repeated for all four cards. The se- lected numbers are displayed on the cards and stored in the three- dimensional array C%. A cover token is then placed over the free box in the center, giving it the status of a called number.
Ready To Play
The cards are on the screen, and you are ready to begin playing. At the bottom of the screen are five balls (sprites), each labeled with a letter in the word BINGO.
Numbers are selected through
a random graphics routine. The let- tered balls jump up and down like kernels of popcorn. The height a ball reaches is random. If it jumps above a line on the screen, it is selected. If not, it falls back with a plop, and another ball is given a chance.
After the column letter has been selected, a random number is chosen. To prevent duplication, all called numbers are entered in the two-dimensional array N%. The newly selected number is compared to the numbers in the array. If a match occurs, the number is dis- carded and another one generated. When a unique number is found, it is printed on the enlarged sprite in the middle of the screen, along with its letter.
Checicing For A Match
Next, each number in the appropri- ate column on each card is checked for a match. A chime sound signi- fies a match. If the number doesn't appear on any of the four cards, a sour bong sounds.
If you selected auto cover, the computer covers a matched number by printing it as a red reversed char- acter. If you chose manual cover, you must use the joystick to position the marker and press the fire button to cover your number. If you make a mistake, you lose the number.
When a number is covered, the program checks the row, column, and diagonal for a bingo. Since the covered numbers have been print- ed in reversed character mode, this is easily done from screen memory. The program needs to check the five boxes to see if they all contain reversed characters (screen codes greater than 127). If a winner is found, the covers change color and music plays. Each card is checked for the possibility of multiple winners.
One Machine Language Routine
The first DATA line contains a short machine language routine which initializes screen color and sprite memory locations. The re- maining DATA statements set up sprite data and music. The program contains extensive REMarks to make the logic flow easier to follow, and the variable names are listed below, with their functions.
Variable Function
Al-4 Parameters of pattern for
winner scan AU Mode flag for ball feed and
cover BO Bingo flag
B0,1 Digits under joystick cursor
Ck Card numbers array
CC,CM Joystick cursor position
CD Card number
CL Column number
CO% Ball color array
DU% Duration of notes array
FB Fire button switch
FH%,FL% Music frequency high and
low bytes FR Joystick row number
HB High byte of screen color
memory JO-3 Joystick direction switches
L Ball letter array
LN Length of ball number string
N% Called number array
NC Ball color index
NM Called number
NN No-Number match flag
NU Value of called number with-
in column (1-15) Nl,2 Digits of called number
OB Reversed number flag (logical
variable) PD Joystick memory register
contents PI Screen memory location of
Nl RN Row number on card
S Start of screen memory for
cards SD% Sprite data array
SN Screen memory location of
box digit SS Sound chip memory location;
also, screen -to-color memory
offset
V Video chip memory location W1,WJ Indices of box to be checked
for winner WM Memory location of box to be
checked for winner SP Contents of WM
X Ball X-position array
Y Ball Y-position array YM Maximum ball height
Z Present box numh>er value Q
Best of COMPUTEI and Gazette 17
This intriguing game challenges your problem-solving abilities. A crime has been committed, and you must ques- tion suspects to discover who's re- sponsible. What makes things difficult is that one of the suspects has prob- lems telling the truth. And what gives the game added appeal is that it's different every time you play.
When you were invited to a small dinner party at Lord Crumbly's se- cluded mansion, you never thought you'd be accused of murder. In ad- dition to yourself, there were three other guests and two servants. You knew his lordship was not a well- liked man, but you were certainly not expecting murder.
Late that evening, while you were alone in the library, a shot broke the silence. You rushed to the room of Lord Crumbly and discov- ered his lifeless body. A moment later, the others arrived to see you bending over the dead man. The police were summoned, but have not yet arrived. As the prime sus- pect, you must quickly discover the murderer or risk being accused of the crime.
The murder can be solved by questioning the suspects and keep- ing track of who said what about whom. But, to complicate matters, you know that one of them is a compulsive liar.
Sifting Through The Evidence
Three questions must be answered affirmatively before you make an accusation. First, did the suspect have a motive — a reason to dislike Lord Crumbly? Second, did the sus- pect have access to a gun? Third, where was he or she when the shot was fired — with someone else, near Crumbly's room, or somewhere unknown?
Sleuth
Paul D. Farquhor Version by Kevin Mykytyn
Your task is to narrow down the list of suspects until you find someone who had a motive, a weapon, and an opportunity. Obvi- ously, if Professor Bard had no gun, he must be innocent. You may find more than one person who had mo- tive or opportunity, but only one will fit all three categories.
Four of the five will always tell the truth, while one will always fib. The liar is not necessarily the mur- derer, although it is possible. How do you distinguish between the true and false statements?
At first, you don't know who's trustworthy, so don't believe any- one. Just write down what they say on the program's a four-page note- book. You can look at your note- book by pressing one of the function keys. The fl key is the first page, f3 is the second, f5 is page 3, and (7 page 4. You may find it convenient to split up motive, weapon, and op- portunity on the first three pages and use the fourth for your conclu- sions. After selecting a page, type in the message you want. You can also flip between the pages of the note- book by pressing the other function keys. To get back to the game, press the back arrow {the upper-left char- acter on the keyboard).
When someone says some- thing, write it down on one of the first three sheets. For example, if Snipe says Larue was being black- mailed by Lord Crumbly, write it under Mofive. If Bard says Chauncy was with someone when the shots were fired, write it under Opportu- nity (Bard says Chauncy had no opportunity).
Paring Down The List Of Suspects
Who's telling the truth?
If Snipe tells you that Whig- gins did not have a gun, and Larue says the same thing, you can con-
clude that both Snipe and Larue are truth tellers. Since there's only one liar, if Snipe or Larue was a liar, the other would have to be telling the truth, and they would say opposite things. But they said the same thing, so they must both be telling the truth. Once you know they're OK, you know everything they have said (and everything they may say in the future) will be correct.
By similar logic, if two suspects say contradictory things, you know one of them is lying. Bard says Snipe hated Lord Crumbly (a motive), but Chauncy says Snipe had no motive. Either Chauncy or Bard is not telling the truth, and since there's only one liar, Whiggins, Larue, and Snipe must all be truth tellers.
As you collect your data, look for someone who had motive, weapon, and opportunity. As soon as you find a suspect with all three, you can solve the case. Another way to nail the murderer is to rule out four suspects. For example, if Whiggins had no gun. Snipe no motive, Chauncy no motive, and Bard no opportunity, then that leaves a single possibility: Larue.
After uncovering the answer to the mystery, you'll see how many clues you were given (you can usually finish with about ten clues). You'll then be asked if you want to play again.
Page Flipping
The electronic notebook is created using page flipping, which means relocating the screen display to a different section of memory. This technique is often used for anima- tion on the Apple and Atari. While one screen is displayed, the com- puter draws the next picture on an alternate (invisible) screen. Then, a few POKEs cause the screen to change to the next frame. You don't need to know how it works to play
1 8 Best of COMPUTE! and Gazette
Sleuth, but if you'd like to use page flipping in your own programs, here's a brief explanation.
Location 53272 controls several things, including the video matrix base address (where, the screen starts, in plain English). The upper four bits of this location point to the start of the screen. Normally the bit pattern is 0001, meaning that the screen starts at 1*1024. If we want to change the location of the screen, we must be careful not to disturb the remainder of this byte. This can be done using the following statement:
POKE 53272,PEEK(53272)AND15 OR S*16
The variable S holds the num- ber of the IK block where the screen starts. It must be a number from 0 to 15 because the video chip can access information such as screen memory, sprite definitions, and character definitions from only one of four 16K blocks. So to change the start of screen memory to 12288 (12*1024), type:
POKE 53272,PEEK(53272) AND15 OR 12«16.
But POKEing to 53272 is not enough. There are a couple of prob- lems to overcome. Even though the computer is now displaying screen memory from a new location, the BASIC editor is still printing to the old screen.
Location 648 tells the operat- ing system where to find the screen if it needs to print something. It contains the start of screen memory divided by 256. Since the screen normally starts at 1024 this location is normally 4 (4*256 is 1024). To change the start of screen memory to 12288 enter:
POKE 648,48.
Even after telling the computer where to start its screen display memory and telling the editor where to print, there is still a prob- lem. Locations 217 to 242 hold a screen line link table necessary for proper formatting of anything print- ed to the screen. If you type more than 40 characters on a line, the computer uses the line links to find out where to start the next line After flipping pages, this table will still be set to work with the old screen. The line link table must be rebuilt to work vrith the new screen. BASIC has a routine that will do al! this for
HIGH SCHOOL MATH . . . WE'LL HELP YOU MASTER IT!
THE MOST EFFECTIVE HIGH SCHOOL MATH SOFTWARE EVER DESIGNED
Intelligent
^^ Tutor
APPLE II SERIES * IBM PC/PC|r » COMMODORE 64/128
Eicbp3ck2gc in the Incclligcni Ttiiorxrin is complete 2nd self <onained. Each is designed 10 help students nrt/cw and master basic principles md concepts, develop their ptvblcm-solving skills, ind build their confidence.
HIGH SCHOOL MATH SERIES
ALGEBRA I
Comprehensive coverage of all topics conained year course in elemeniary i\gebn
GEOMETRY
Comprehensive coverage of all loptcs contained jtar counc in geometry.
ALGEBRA 2
Comprehensive coverage of all topics contained
year course in intennediaie algebra
Tbc set of five titles above
149.95
inaone-
14995
inaone-
(49.95
in a one-
TRIGONOMETRY ft ADVANCED TOPICS S49.95
ComprehensivT coverage of all topics contained ina one- year couise in [rigonomeir^', and other topics taught in higher level hi^ school math councs.
SAT MATH 169.95
Comprehensive covcnge of the pnvblem types and skills emphasized on ihe SAT exam Contains simulated tests, forecasts of students' scores, and outstanding praaice for the SAT exam
Is available at the special price of $199-99.
ALSO AVAILABLE
PREALGEBRA S49.95
Comprehensive coverage of junior high school mathe- matics and the topics which form the foundation for algebra
INTRODUCTORY CALCULUS 149.95
Comprehensive coverage of aU topics contained in an in- iroduaory courK in differential and integral calculus
TO ORDER, CALL: ^m.
(800) 521-4518 "
IN INDIANA: 219-925-6166
When onkrlnx xM S3 SO ihippng ind lundllng tndiin^ midrnli idd SX illn Hit
INTELLIGENT SOFTWARE, INC.
9609 Cypress. Miinstcr. IN 46321
us; the clear screen routine. Once the screen is cleared, all the line links are set for the new screen. But in Sleuth, it's necessary that the screen not clear when the pages are flipped. The machine language rou- tine at the start of the program does the relinking without clearing the screen and sets the color RAM to blue.
It's possible to flip screen mem- ory pages, but there is only one location for color memory (starting at 55296). This makes it necessary to set the color memory when a page is flipped. Otherwise, the characters could be on the new screen, but might be the same color as the screen and would not be visible. A second method is to save the color RAM in another portion of memory and move it back when the page is displayed.
Finally, the new screens that you create should be protected from BASIC by POKEing location 56 and doing a CLR. Also, when you're typing on an alternate screen and press RUN /STOP-RESTORE, location 53272 is reset but location 648 is not. Display memory is now at 1024, but your typing is still be-
ing printed on the other screen. This can be fixed by typing:
POKE 648,4
and pressing RETURN (even though you can't see what's being typed).
If you don't want to write your own page flipping routine, you can use the one in Sleuth. Include lines l-9,36,320,and 485-540 in your program (you can renumber them, of course). Line 1 protects the new screens from BASIC and reads the machine language routine, from lines 2 to 9, into memory. This should be done at the start of the program.
Line 36 calls line 540, which clears all the alternate screens. Then the position array is set to 0. This array, labeled C, keeps track of which row the cursor is on when a page is flipped and returns the cur- sor to that row when the page is restored. This routine should also go at the beginning of the program. Line 320 checks for the press of the function keys. It should be included as part of your key input routine. Lines 485-535 are the main page flipping routine and can be placed anywhere in the program. ©
Best of COMPUTE! and Gazette 19
Switchbox
Todd Heimarck, Assistant Editor
Here's a challenging game of strategy for the Commodore 128 that looks easy at first, but takes time to master and permits many variations.
Playing "Switchbox" is like putting dominos in place for a chain reac- tion— either you're setting them in position or you're knocking them over. Winning requires skill and a sense of when to go for points and when to lay back and wait for a better board. The goal is simple: You try to score more points than your opponent by dropping balls into a box full of two-way switches. Each switch has a trigger and a platform. If the ball lands on an empty plat- form, it stops dead. But if it hits a trigger, it reverses the. switch and continues. In many cases dropping a single ball creates a cascading ef- fect— one ball sets another in mo- tion, which sets others in motion, etc., all the way down.
Box Of Switches
Switchbox is a tale of twos: Each switch has two parts, two positions, two states, two paths in, and two paths out. The two parts are the platform and the trigger. A switch can lean to the left (platform left, trigger right) or to the right (plat- form right, trigger left):
The trigger is weak, and al- ways allows balls to pass. But the platform is strong enough to hold a single ball. So the platform either holds a ball — it's full — or it does not and is empty. When a ball sits on a platform, the switch is said to be loaded, or full.
Figure 2 shows a full switch
Figure 1. Trigger States
Before: After:
Left switch Right switch
\\
Z7
9
Figure 2. Loaded Trigger
|
Left |
Right |
|
path |
path |
|
in |
In |
Z7
Z7
over two empty switches. The plat- form holds a ball and leans to the left. The trigger extends to the right. Note that the switch on top has two pathways leading in, the left path and the right, and that the right path leading out is the left path into
one of the switches below. The left path of the top switch leads into the right path of the other, the switch below and to the left. If you drop a ball down the righthand path, it hits the trigger and flips that switch to the right. Then it continues down, hits the lefthand trigger be- low and flips that switch as well. In the meantime, the ball on the platform is set in motion (when the switch is flipped) and then hits the trigger. The top switch is reset to point to the left. The second ball then drops a level to the platform below, where it stops. The playing field is composed of five levels, with four switches in the first level and eight in the bottom level. At the beginning of the game, there are no balls on the field — all platforms are empty — and the position of each switch is chosen randomly.
Moving Down The Path
Players alternate dropping balls into one of eight entry points. These balls (and others) may or may not make it all the way through the switchbox, to one of the 16 exit paths. Balls fall straight down (with one exception), so a ball's movement is always predict- able. When it hits an empty switch, one of two things can happen. If it lands on the empty platform, it stops dead in its tracks. But if it lands on a trigger, it falls through to the next level below.
Moving balls always make it through loaded svintches. Triggers allow balls to continue, and move the switch to the other position. If it's loaded, the dead ball on the platform is put into motion and it hits the trigger that just moved over.
20 Best of COMPUTEI and GazeMe
This makes the switch go back to its original position, but with an enipty platform. So when a ball hits the trigger of a loaded switch, its motion continues unabated. The switch moves, the ball on the platform be- gins to fall and it hits the newly placed trigger. The newly emptied switch moves back again, and the two balls drop to the next level.
There's one more possibility: a ball dropping onto a platform that already holds a ball. A platform can't hold any more than one ball, so when this happens one of the balls slides over to the trigger. So the ball does not move straight down — it slides over to the next pathway. This is the exception to the rule that balls drop in a straight line. Of course, when the ball hits the trigger, the switch changes po- sition, causing the other ball to drop and hit the trigger.
The Chain Reaction
At the game's start, all platforms are empty, so four of eight entry paths are blocked. Remember that your turn ends when a ball hits an empty platform and stops. As the switches fill up, the chances in- crease that a ball will descend through several levels. The goal is to score points by getting balls to pass all the way through the maze of the switchbox. The best way to collect a lot of points is to cause a chain reaction.
A ball that hits a loaded switch from either side continues on its way. And the previously inert ball on the platform starts moving. One enters, two exit. If both of those balls encounter full platforms, four drop from the switches. The path- ways are staggered, so the effects can spread outward, with more and more balls cascading toward the bottom.
Rather than taking an easy point or two, it's often worthwhile to build up layers of loaded switch- es. Watch out for leaving yourself vulnerable, though. Because play- ers take turns, you'll want to leave positions where your opponent's move gives you a chance to create a chain reaction. The best strategy is to play defensively. Look ahead a move or two, and watch for an opening that allows you to score several points at once.
Four Quarters
A game of Switchbox always lasts four rounds. In the first (equality), each exit counts for two points. Your goal is to score ten points. The second quarter has more points available, as well as a higher goal. If you look at the exits, you'll see that the further away from the middle, the higher the point value. The numbers increase in a "Fibonacci" sequence: 1, 2, 3, 5, 8, and so on. Each number is the sum of the pre- vious two (1 4-2 is 3, 2 + 3 is 5, 3 + 5 is 8, etc.). The target score in round two is 40.
In round three the numbers are a bit lower. They increase arithmet- ically {1, 2, 3, 4, up to 8 in the comers). A goal of 20 points brings you to round four, where you can score big. Here the numbers are squares: 1, 4, 9, 16, 25, all the way to 64 at the edges. In rounds two through four, it's sometimes pru- dent to leave a middle path open for your opponent to score a few points, in order to gather a high score on the big numbers to the left and right.
Each round lasts until one player has reached the goal. At that point the other player has one last turn before the round ends. It's pos- sible to win the round on this last- chance play; watch out for barely topping the goal and leaving a chain reaction open for the other player. An arrow points to the scoreboard of the player whose turn it is. On the other side of the screen, you'll see a number where the arrow should be. That's the goal for the current round (the Amiga version displays the goal on both sides of the screen, below the scoreboards).
Bonus points are awarded at the conclusion of each round. Four numbers appear below the score- cards. The first is simply the total so far. The second is the total plus a bonus of the goal for the round if the player's points are equal to or greater than the goal. For example if the goal is 20 and you get 1 8, there's no bonus. If you score 22, the bonus is the goal for that round (20) and you'd have 42 poirxts. The third number under the scoreboard is the difference between scores for the rounds. If you win by two points.
two is added to your score (and two is subtracted from the other player). The final number is the grand total of the first three scores and bonuses. Rounds one and three are fairly low- scoring with low goals. You may want to seed the field with extra balls during these quarters, so you can collect more points in the sec- ond and fourth quarters.
Variations
Although the goal of the game is to score the most points, there's no reason you couldn't agree to play for low score. In a "lowball" game, you would try to avoid scoring points. You wouldn't necessarily play backwards, you would have to adjust the strategy of where to place the balls. Fill up the board as much as possible and leave your oppo- nent in a situafion where he or she is forced to score points.
The DATA statements at the beginning of the program (the Setup: routine in the Amiga version) deter- mine the goal for each round and the point values for the exit paths. You can prolong the game by dou- bling the goals; this also dilutes the value of a big score at the beginning of a round, preventing one player from vanning on the first or second turn. An interesting variation is to assign negative values to some slots. If some paths score negative points, you are forced to think harder about where the balls will drop.
In addifion to the numbered keys (1-8), the plus ( + ) and minus ( — ) keys are active. Pressing plus drops a ball at random down one of the eight entry paths. Pressing minus allows you to pass your turn to your opponent.
Once you've mastered the reg- ular game, you can add some new rules. Each player gets three passes per half, similar to the three timeouts in a football game. If you don't like the looks of the board, press the minus key to use one of your passes. After one player has skipped a turn, the other player must play (this prevents the possi- bility of six passes in a row). It's also a good idea to make a rule that a player can't pass on two consecu- tive turns. You can also give each player two random moves to be played for the opponent. In other words, after making a move, you
Best of COMPUTEI cff>d Gazette 21
could inform your opponent that you're going to give him one of your random moves and you would press the plus key.
Here's one more change you could make: Instead of alternating turns, allow a player to continue after scoring. When a player drops a ball and scores some points, the other player would have to pass (by pressing the minus key). If the first player scores again, the opponent passes again, and so on until no more points are scored.
Playing Solitaire
To drop a ball, press a numbered key (1-8). If you're using a 128, ST or Amiga, the numeric keypad is convenient for choosing a move. By using the pass and random turn options, you can play against the computer. Here are the rules for solitaire play:
1. The computer always scores first. At the beginning of every round, the computer plays random- ly until at least one point is ac- quired. Press the plus key for the computer's turn. You must contin- ue passing (skip your turn with the minus key) until the computer puts points on the board.
2. After the first score by the computer, you can begin to play. When the computer has a turn, press the plus key for a random move.
3. Whenever you make points, you must pass again unhl the com- puter scores. When the computer gets more points, you can begin to play again. This rule means you should hold back on the easy scores of a few points; wait until there's an avalanche available.
4. If you're the first to reach the goal, the computer gets a last chance. Don't make this move ran- domly; figure out the best opportu- nity for scoring and play that move for the last-chance turn.
In the interest of keeping the program at manageable length, no attempt has been made to provide an "intelligent" computer oppo- nent. Once you become familiar with the game, you might find it an interesting project to try adding some routines that give the com- puter a rational basis for picking one move over another. ©
Q-Bird
Mike Sedore
This delightful and colorful arcade- style game for the Commodore 64 challenges your character, a defense- less (but nimble) baby bluebird, to survive among a crew of nasty, hungry enemies. A joystick is required.
Other birds say you're paranoid, but you're not — everyone really is out to get you. You often ask your- self how long a defenseless baby bluebird can hope to survive when a host of voracious predators are looking for a meal. If only you could leave this place to find a new home. But alas — you're too young to fly. The best you can manage is a flapping long jump. But you'd bet- ter be careful not to jump too far: You could fall a long way down.
Q-Bird is played on a 6 X 7 grid. There are 15 levels of play from which to choose. As you play, you advance level by level by com- pleting grids. A grid is complete when the color of each square matches the goal color shown at the bottom of the screen. To change the color of a square, simply hop on it. You have to jump on each square once in level i, twice in level 2, and so on up to level 15. A bonus life is awarded each time you complete a level. If you reach level 15, you should feel satisfied. It doesn't get any harder than this. But don't re- lax; it doesn't get any easier either.
You start with five lives. Choose your starting level by push- ing forward on the joystick (which must be plugged into port 2). If you pass the level you want to play, pull back on the stick to reverse the level
counter. Press the fire button to begin play. To hop, simply move the joystick in the direction you want to go. For a super jump, push the fire button as you hop: You'll leap over a square and land on the next. If you time it right, you can leap right over your enemies. But be careful not to jump over the side of the grid. That costs one life.
Press SHIFT-LOCK to pause the game. To restart a game, press RUN/STOP-RESTORE.
Leapln' Lizards
Three purple lizards live on the grid. They randomly leap off of their tails from square to square, landing on any bluebirds careless enough to get in their way. But they're the least of your worries. There's a king cobra that relentless- ly chases you. He's got a hole in his stomach just the size of a baby bluebird. If he doesn't get you, then perhaps the low-flying and hungry hawk will. And while you're look- ing out for all of these villains, try to dodge the runaway balls that roll down the grid. Any one of them could turn you into a bluebird pan- cake in a moment.
Fortunately, you do have an ally. Occasionally, a flashing egg appears on a random square. If you hop on it, you momentarily stun all the grid inhabitants. You can now go anywhere you please without harm. Unfortunately, this doesn't last long. When the safe time is nearly through, your character, the bluebird, begins flashing. All action returns to normal after the third flash, so be ready for the frenzy to continue. ®
22 Best ot COMPUTE! and Gazette
Hex War
Todd Heimarck, Assistant Editor
You float high above a distant planet, controlling robot armies below. Can you take control of the priceless min- ing turf planetside, or will your oppo- nent's robot crews prevail? To win at this thoughtfully designed, engaging strategy game, you'll need foresight and conceptual skills rather than a quick hand on the joystick.
"Hex War" is a two-player strategy game that can be played five differ- ent ways, and there are limitless variations. But the basic premise is always the same: You and an oppo- nent move armies on a field of hexagons, attempting to capture territory.
The goal of the first two games is simple: capture the capital city of the other player. In game 1, the capital cities are far apart; you must devote some of your armies to de- fending your own capital while at- tempting to breach the walls of the other capital. Game 2 puts the capi- tals near each other, so offense and defense tend to merge in this sce- nario. Most of the action takes place within a small area of the battle- field.
Games 3 and 4 spread the ac- tion over a wider area. In the third game, your object is to occupy eight of the twelve cities on the game board. Six cities occupy the periph- ery, and six are in the center of the playfield. Game 4 requires actual
control of six cities; you must have an army in the city, one that's not involved in a battle, before you're credited with control (this version will probably take the most amount of time to play).
Although the first four scenari- os encourage a commitment to bat- tle, you employ different tactics in the fifth. The goal here is to acquire 40 of the 61 hexes, so you need some free armies to move around. As soon as you claim 40 hexes, you win the game.
When you first run Hex War, the computer pauses to set up the screen, then displays a menu of five choices. The five different games are explained in detail below. If you're new to the game, press the 1 key to choose game 1. There will be anoth- er short pause while the variables are initialized, and then you'll see a playfield with 61 hex shapes, con- taining four armies on each side.
Hexes And Hexadecimal
A chess board has 64 squares ar- ranged in a rectilinear grid. Hex War gives you a playing field of 61 hexagons (almost as many as a chess board), but they're part of a six-sided honeycomb field. If you've played war games before, you may recognize the hexes.
Before playing, plug the joy- stick into port 2. At first, the cursor movement may seem unusual. The cursor travels not up-down/left- right, but northeast-southeast/ northwest-southwest. To make the
movement less confusing, turn your joystick 45 degrees clockwise, so that what was up becomes northeast, and so on.
Each hex has six neighbors, so an army can move in six possible directions. To travel left and right, you'll have to push the joystick twice (for example, up and right on the joystick to move one hex to the right, which counts as one move- ment).
Army strengths are listed in hexadecimal (base 16) numbers, so the four armies labeled 40 actually have strengths of 64 (the hexadeci- mal value 40 equals 64 in our every- day decimal numbering system). At the beginning of a turn, any army has exactly three movement points. It requires one point to move an army into a neutral or enemy- controlled zone. To move through the same zone also requires a point. To move into and through a friend- ly hex requires a total of one point. This means you can move a single army through two neutral or enemy hexes in any one turn, but the same army can move through up to three friendly zones during a turn.
Select an army by moving the cursor onto it. Click the joystick button once, then position the cur- sor on a neighboring hex and click again. If you wish to stop, click again, and two plus signs (++) will appear, signaling that no more movement can occur. Otherwise, position the cursor on another neighboring hex and click.
Best of COMPUTE! and Gazette 23
Zones Of Control
Each army controls the six contigu- ous hexes surrounding its resident hex. If you enter an enemy's zone of control, you forfeit any addition- al moves and must prepare for bat- tle. In addition, an army that begins the turn in a zone of control cannot move until the battle is resolved.
Robots Vs. Robots
In this game, you aren't really on the planet, but parked high above it in a remote mothership. You've landed some robots to explore the area, and they've encountered ro- bots belonging to another explorer. Your robots, or bots as you call them, follovk' your orders to ad- vance toward the other bots. Each bot has a mining laser which can stop or disable the other bots. Also, your bots have disrupter beams which can daze another bot, tem- porarily confusing it. When two bot-groups come close to each oth- er, they shoot lasers and disruptors until one army of bots is disabled.
Three things can happen to a robot which suffers a hit. If the robot suffers a direct hit in its logic unit by a laser, it is vaporized. It is destroyed forever and never reap- pears in play.
The second thing that can hap- pen is injury. If the laser beam is deflected, the robot is out of com- mission until it can be transported back to a botspital. An injured bot is frozen in place until the battle is finished, after which the victorious army carts away the injured bots to be repaired and reused.
Thus, winning a battle means you evacuate both the friendly in- jured and the enemy injured. After all of the injured bots recover, they join the force in whose botspital they were healed. In effect, injured bots eventually become members of the army which won the battle in which they were damaged.
The third possibility is confu- sion: The robot is temporarily disori- ented for two turns. When the time has passed, the robot is ready again.
Reprogromming Bots
Moving the cursor onto an army of robots brings up a status window in the upper-left comer of the screen. The number in reverse video is un- important; it's the army number
(which may change as the game progresses).
The four numbers underneath are significant, however. The first is the army's active strength {in deci- mal). The second is the number of injured robots, which will be trans- ported to the botspital of whichever side wins the battle. The third — on the line below — is the number of disrupted robots who will be avail- able for combat in the next turn. The fourth number is how many robots can join the active force two turns from now.
if one side is able to reduce the other player's active force to zero, two things happen. The winner sends all injured bots away to be repaired. The winning side also col- lects all enemy bots (injured or dazed) and sends them to the rein- forcement center to be repro- grammed. Eventually all these bots will available to the winner of this particular battle for future engage- ments.
Reinforcements And Mergers
At the start of the game, you'll see some armies positioned outside of the hex field. These are reinforce- ments and reserves in transit to the battle. Player one's reinforcements enter at the bottom right comer; player two's enter at the top left. The line of new armies moves counterclockwise; the army next to the entry point is the next to enter the battlefield.
However, the reinforcements cannot enter the battlefield if an army (friendly or enemy) is block- ing their way. Keep your armies off your own reinforcement point, and try to block your opponent's armies from this area if you can. If the entry hex is owned but not occu- pied by your opponent, you'll lose some reinforcements.
After completing a turn, you are credited with additional rein- forcements according to how much territory you own. Passing over a hex allows you to claim it; the hex changes color to indicate owner- ship. Each piece of property pro- vides enough ore and energy to build a new robot, available for use two tums in the future. The num- bers in the line of reinforcements are updated after you move to show
additional robots being built.
Winning a battle also provides additional armies in the line of rein- forcements. As mentioned above, a victorious army captures any dazed enemy bots, which are repro- grammed and available in three tums. At the same time, the winner evacuates injured bots of both sides. Transportation and repair take five tums for friendly bots, seven for enemy bots. The two ad- ditional tums are needed for repro- gramming the opponent's forces.
If you're losing a battle, the number of injured robots (dis- played in the status window) will begin to rise. Reniember that, if your opponent reduces your active strength to zero, he or she will cap- ture all of your injured bots; they'll be reprogrammed and added to fu- ture reinforcements. To prevent this from happening, you're al- lowed to bring in a second army for merging. Simply move another army on top of the army with which you want to merge. There's just one mle: One or both of the armies must have a strength less than 32 decimal (IF or less in hex).
Customizing The Scenarios
The five built-in scenarios provide plenty of variety, but if you'd like to add more challenges, here are some suggestions.
First, a note about the logical organization of the grid. The vari- ables T and B, CT and CB, and HT and HB are used to locate the coor- dinates on the playing field (see figure). The first number is T (or HT or CT), the second is B (or HB or CB). These coordinates are also used in the three-dimensional MAP array (where level 0 of the array is the army number, 1 is the current owner and 2 keeps track of whether or not a city is located there); they're also part of the ARMY ar- ray. By varying the starting posi- tion, number of armies, reinforce- ment strengths, and location of cities, you could simulate historic battles.
To add or subtract cities from the field, change the value of CN in line 50. You'll also have to change the DATA statements in lines 270 and 280. The numbers there are the T and B coordinates of the cities.
The strengths and locations of
24 Best ot COMPUTEl and Gazette
the armies can be changed as well. The DATA statements starting at line 1540 determine the strength (64) and T/B coordinates for the armies at the beginning of the game. If you wish to start with more armies (or fewer), you'll have to change the inner FOR-NEXT loop (with the index of K) in line 1500. In that same line, change NX(J) to one number higher than the number of armies on each side. For example, if you want six armies apiece, change NX(J) to 7. The subroutine at line 1600 sets up the reinforcements; if you don't like the random patterns, change the formula here.
Variables defined in lines 70-90 control the play of the game. PN determines which player goes second; it can be either zero or one. Variable ME controls the maximum merge strength. If you'd like to be able to merge any two armies, change it to a high value (512, for example). To remove the merge op- tion altogether, change ME to zero.
The movement points are de- fined by MM in line 80. Movement across friendly territory takes one point, across neutral or hostile terri- tory two points. Increasing MM will give your armies more mobility. The three variables KA, KB, and KC affect the outcome of individual battles. KA determines how many bots are vaporized, KB controls the number injured, and KC affects how many are dazed. If you make the fractions smaller (1/24, for example), the battles end more quickly. The subroutine starting at line 2600 resolves current battles.
Running Hex War
To play Hex War, type this line in direct mode (without line numbers):
POKE 44,64:POKE 64*256,0:NEW
Be sure to press RETURN after you type the line. Now load and run Hex War as usual. It is very impor- tant that you perform this step before running the program: If you don't, the screen will be jumbled and impossible to decipher.
You may find it easier to let the 64 handle this chore for you. "Hex War. Loader" is a short loader which performs the setup, then loads and runs Hex War. To use the loader, you must have the main program saved with the name HEX WAR on the same disk as the loader. ©
Space Gallery
Jeff A, Lapkoff
Swirling frisboids, pellets, and heat seekers are headed your way. Can you fend them off with your cannon? A colorful arcade-style game written entirely in machine language for the Commodore 64. Joystick required.
The year is 2023, and you're a solo space gunner on an earth-orbiting colony. You must try to defend against hostile forces, and as the colony's sharpshooter, you must re- main stationed at the video control center. For days, the radar has shown an approaching force, and based on the direction and speed at which they're coming, you know what to expect: the dreaded fris- boids, curious but deadly creatures. They come in waves of four, but you have only one cannon. And they shower you with lethal pellets, which can destroy your cannon.
The object of "Space Gallery" is to shoot as many frisboids as you can while dodging the falling pel- lets. To fire at a frisbold, press the
fire button on your joystick (plugged into port 2). For each one you hit, you earn five points. Your cannon has unlimited ammo; how- ever, the fewer shots you take, the higher your shot bonus at the end of each level of play.
To dodge the pellets, move your cannon left or right with the joystick. If your cannon is hit by a pellet, it will explode. The game ends when you've used up five cannons.
A Bonus And An Option
Shooting down five waves of fris- boids advances you to a higher lev- el and, if you didn't use too many shots, rewards you with a shot bo- nus. Once you get to level five, you receive an extra cannon.
Space Gallery also features a heat seeker option, but beware — it makes the game much more diffi- cult. The heat seeker is a normal- looking frisboid that drops blue pellets, which home in on your can- non. At the beginning of the game, you can activate the heat seeker by toggling on the gray square at the bottom of the screen. <9
Best of COMPUTE! and Gazette 25
Whirlybird
This hyperactive bird lays some rath- er unusual eggs. A fast action game written entirely in machine language for the Commodore 64. A joystick is required.
"Whirlybird" is a fast, updated ver- sion of the classic game Breakout. It's written entirely in machine lan- guage. You control the Whirlybird, who flies back and forth at the top of the screen, spinning continuous- ly. The goal is to clear out the layers of colored bricks at the bottom by bouncing eggs against them. When an egg moves back in your direc- tion, move the Whirlybird into its path to bounce it back down. The game ends when you clear the field of bricks or run out of eggs.
Plug a joystick into port 2, then load and run Whirlybird as if it were a BASIC program. Do not try to start the program with SYS. The playfield appears immediately, with the Whirlybird twirling across the top of the screen. On either edge is a sparkling row of side- beams, and below are multicolored rows of bricks. At the upper right is the number of eggs you'll have in this game. Though the usual num- ber is ten, you can get a smaller or larger number (up to 255) by push- ing the joystick backward or for- ward. (Don't select zero — you'll simply return to the startup screen.)
Next you must pick the skill level. Press fl to play a normal game or f3 for an expert game. At the expert level, the Whirlybird is only half its normal size, making it harder to hit the eggs. After choos-
Philip I. Nelson
ing the level, the prompts disappear and play begins.
Press the fire button to release the first egg. You earn one point every time you hit a brick, and ten points every time you bounce an egg back down with the Whirly- bird. Letting the egg fly past you into space subtracts ten points from your score (unless it's already un- der ten). When that happens, the sidebeams sparkle continuously until you press the fire button again to release the next egg. Play contin- ues until you lose all your eggs or clear the field of bricks. A 50-point bonus is awarded for clearing every brick from the screen.
In addition to normal bricks, the playfield contains a few round ones. When the egg hits one of those, the Whirlybird swoops down to deposit a sidebeam somewhere above the playfield. This doesn't affect your score, and you get a free egg as well (press the fire button to release it). However, the extra side- beams add an extra element of un- certainty since the egg rebounds sideways from them (not up and down) and they may or may not disappear when struck.
Whirlybird displays your cur- rent score as well as the highest score attained during the current session (which may include more than one game). When a game ends, both scores are displayed un- til you release the first egg in the next game. Then the current score is cleared to zero. Since the high score is stored within the program code, you can record it for future compar- ison by resaving the game after each session ends. (It's a good idea to resave it with a different file-
name—like "BIRDHIGH"— to dis- tinguish it from the original copy, which then serves as a backup.) The next time you load and run Whirly- bird, it displays the previous high- est score.
The Joystick Accelerator
It may take some practice to master the joystick motion in Whirlybird. Rather than zooming immediately to the spot you want, the bird moves in an elastic manner that simulates the inertia and momen- tum of a natural object. It takes a bit of pushing to overcome the bird's inertia and get it moving. The long- er you push in one direction, the more speed and momentum you gain (up to a point). After you let up on the stick, the bird slows down and eventually stops by itself. Hit- ting the sidebeam reverses your di- rection immediately. Reversing direction in midscreen may take a long or short time depending on your speed.
You might think of the joystick in this game as a gas pedal in a car. Keeping your foot on the accelera- tor makes the car move faster and faster. Let up and the car gradually slows down. Learning to control the acceleration takes some time. You may find it more effective to move the Whirlybird with short taps on the joysrick, rather than long periods of acceleration.
Egg Juggling
The direction an egg bounces when it hits the Whirlybird depends on which way you're pressing the joy- stick. If you're not pressing it left or right, the egg rebounds as if the bird were a solid wall. If you're pressing
26 Best of COMPUTE! and GazeHe
the stick left, the egg bounces to the left; if you're pressing right, it bounces to the right. This lets you control the direction of every bounce. But don't move the stick so much that you miss the egg completely.
The result of a bird-egg collision also depends on what part of the bird you hit. The safest strategy is to hit the egg uith the bird's feet. Bouncing it off a wing is more dangerous, since the bird never stops turning. If the egg arrives when the wing is out- spread, you'll usually get a normal collision. But if the VVhirlybird hap- pens to be facing sideways — making it very slim in profile — the egg may miss completely.
Occasionally a wing collision causes the bird to juggle the egg briefly. Juggling gives you extra points and may also change the angle of rebound slightly {a boon when you're short on eggs and need to clear the last few bricks). But it's also dangerous, since the bird may juggle the egg upward and out of play. Juggling occurs less frequently at the expert level; with smaller wings it's more difficult to get multiple collisions.
Rings And Filters
Whirlybird's unusual sound effects are created with two voices of the 64's sound chip. Voice 3 is used as a random number generator {to pick a random screen posihon and direc- tion for each new egg) and doesn't produce any sound. Voice 1, set for a pulse waveform, makes a "boing" sound when an egg bounces, and voice 2 creates low, thrumming tones in the background with a ring modulated triangle wave. The vibrato-like effect results from ring modulated overtones that slowly pass in and out of phase with the frequencies of voices 1 and 2.
These sounds are made more interesting by passing them through a combined lowpass/bandpass filter and sweeping the filter's cutoff fre- quency up or down in conjunction with other game events. When you start the game or when the egg is flying freely, the cutoff frequency sweeps up and down, creating a gradual meow-meow effect. When the egg hits something, the cutoff frequency is set high and swept rap- idly downward to accentuate the bouncing noise. ®
Prisonball
John Scarborough
Version by Kevin Mykytyn
Nearly everyone has played Pong or Breakout, two computer-game clas- sics. "Prisonball" creates an intense, two-player action game by drawing features from both of those games. Either a pair of paddles or two joy- sticks are required.
"Prisonball" is a two-player action game that combines the best ele- ments from two classic computer games. Pong and Breakout. The ob- ject of the game is simple — knock out as many bricks as you can in the allotted time.
Brealc To The Center
The game begins by displaying five colored walls running vertically down the center of the screen. Each player controls two paddles located at the left and right sides of the screen. Three balls appear at a ran- dom location and start bouncing around the screen. When a ball is on your side of the screen, move one of your paddles into its path to deflect the ball toward the walls. You can only hit a ball when it's moving toward your paddles (away from the interior walls). Balls trav- elling from the opposite direction go right through your paddles. If you happen to miss a ball, it wraps around the screen and appears on the other side, giving your oppo- nent a chance to score.
At the beginning of the game, all three balls are a neutral color. Each time you hit a ball, it changes
to the color of your paddle. You score whenever a ball of your color hits one of the five interior walls. The score depends on which wall you hit. The center wall is the hard- est to reach, so it yields the most points. The two intermediate walls are worth less than the center wall. The outermost walls are easiest to hit and score the fewest points.
Every time a ball hits one of the walls, a brick is knocked out of the wall at the point of impact. By aim- ing your shots carefully, you can bore a path through a wall and move a ball into the interior space between two walls. When this hap- pens, the ball bounces wildly back and forth between the walls, scor- ing many points in a short time.
An additional bit of strategy has to do with the redrawing of walls. Whenever a wall has been destroyed, it is immediately re- drawn. Some of the highest scores result when you trap one or more balls behind a wall when it is re- drawn. Since the wall is new, the trapped balls may hit it many times before they break back out to the exterior.
Either joysticks or paddles can be used to play this game. To play with paddles, plug a pair of paddles into port 2. Each game lasts for three minutes. The screen border flashes briefly as a warning when only 20 seconds remain on the timer. Bricks from the center wall are worth 30 points, those from the two adjacent walls are worth 20, and the outermost bricks each score 10 points. ®
Best of COMPUTEI and Gazette 27
Quickchange
You'll need a good strategy and fast reaction time to succeed in this mind boggier. Three games in one for the Commodore 64. A joystick is required.
Are you ready for a challenge? "Quickchange" — three games in one — requires logical thinking, manual dexterity, and a good strat- egy. If you work quickly and stay cool, you should be able to survive for a few rounds. None of the games is easy to master. The three games use the same board and have the same basic format, but each has a different twist.
Use the command LOAD "QU1CKCHANGE",8,1 to load the program. When it's finished load- ing, enter SYS 49152. Be sure to have a joystick plugged into port 2.
You're first presented a menu with a selection of three games: Flip Flop, Missing Pieces, and No Turn- ing Back. Move the arrow with your joystick to select a game, and press the fire button to start. It is suggest- ed that you start with Flip Flop and progress to No Turning Back.
Flip Flop
The playing field is a 120-square grid, 8 rows by 15 columns. You're represented by the black circle starting at the center of the grid. Eight black pieces, one in each row, start at the left and move across the grid. Each moves at a different rate of speed to the far right edge and then returns, and so on. Contact with one of the black squares costs one player (you begin with three). The object of the game is to move your piece around the grid and change the color of all the squares from pink to blue (different colors in successive levels) while
Kevin Mykytyn and Mark Tuttle
avoiding the moving black squares. And all this must be accomplished in 60 seconds. Moving into one square instantly reverses its color. It's important that you choose your course carefully. Backtracking over blue squares changes them back to pink. When you complete the grid (change all squares to blue) within the allotted time, you advance to the next level. For each successive level, the speed of the black squares increases. It doesn't get any easier.
One point is awarded for each square you flip to blue. However, once a square is flipped, you do not receive any additional points for flipping it again. You lose a point for changing a square to the wrong color and gain back the point when it's changed back to the right color, so your score can move up and down. You receive 100 bonus points for each level completed. Throughout the game, current score, high score, current level, time remaining, and number of players remaining are displayed. The game can be paused at any time by press- ing SHIFT or SHIFT LOCK. Release it to resume play. The game is over when you've used all three players or when time runs out.
Missing Pieces
The play in this game is nearly identical to Flip Flop. But there's a twist. Several pieces — randomly selected each time you play — are removed, thus creating empty spaces — holes. If you happen to leap into one while hurrying along, you lose one of your players. Un- fortunately, the black squares are unaffected by these empty spaces. They move through them as if they weren't there.
The scoring and rules from Flip Flop apply to Missing Pieces.
No Turning Back
This is the most exciting — and most difflcult — of the games. The play- ing board is the same as Flip Flop, but the object of the game is differ- ent. Once you move away from a square, it's erased. The goal is to eliminate the squares (you are cred- ited with clearing the board if three or fewer remain).
Moving into an empty space is not allowed. But, unlike Missing Pieces, the black squares cannot move into the voids. They'll reverse direction if they encounter one of these spaces. This can be used to your advantage. You can cut off a black square by removing the squares horizontally adjacent to it. This will erase a black square and free up an entire row. For each black square removed, 100 points are added to your score (plus 1 point for the space previously occu- pied by the black square).
This game is trickier than the others. In haste, it's easy to isolate your own player. Remember, the object is to eliminate the squares, and you can't enter a voided space. Also, be aware that when you lose a player — provided it's not your last — your next player is positioned in the center of the screen. If there are no available pieces adjacent to the center, you've eliminated your- self from the game.
There's A Way To Win
The key to success in each of these games is to find the right pattern. There are several that will work. If you randomly move around the maze, you'll find that although you can accumulate points, you'll prob- ably run out of time.
Quickchange may be played competitively for highest score or just for the challenge of completing a level or two. ®
28 Best of COMPUTE! and Gazette
Saloon Shootout
David Hensley, Jr. and Kevin Mykytyn
You'll have your hands full in this action-packed, arcade-style game. It's one of the most challenging and graphically charming games we've published. For the Commodore 64, Plus/4, and 16. A joystick is required.
If you're a sure-shot, dead-eye, trig- ger-happy gunslinger, you'll be suited to this wild and woolly ac- tion game. In "Saloon Shootout," the pace is frantic and it never slows up. The object of the game is to accumulate the highest number of points before time runs out or before you run out of bullets.
Of Mice And Mugs
There's a lot to contend with in Saloon Shootout. A gun, which ap- pears on the bar, is your weapon. It's controlled by your joystick (plugged into port 2). By moving the joystick up and down, you con- trol the distance your bullet travels. You'll notice the gun barrel shift up and down as you move the joystick. Also, an arrow on the right of the screen will help you gauge the dis- tance your shot will fire.
A main objective of the game is to shoot as many mugs as you can before they fall off the bar. For every ten of these you shoot, a run- ning mouse appears. Each time you shoot this critter, you receive a bo- nus score and it reverses direction and speeds up. Every time you hit him, the point total escalates and so
does his speed. {This is where you can get a lot of points for those potential high scores.)
This may sound pretty easy so far, but your job at the saloon is much more complicated. You must also keep your eye on the three windows on the back wall of the saloon. They're sometimes opened by a masked desperado who will steal ten of your bullets unless you shoot him before he disappears. But don't be too hasty — sometimes good guys appear (the good guys smile), and shooting them results in a stiff penalty^lOO points sub- tracted from your score. If your sup- ply of bullets is running low, you can replenish them by shooting the cards that appear on top of the player piano. However, you must shoot the cards in order: 10, J, Q, K, and A. Be careful here — one card hit out of order will reshuffle the deck and you'll have to start over. Now you can see that this is no simple task.
There are a few features that help to calm your nerves, however. If you reach a score of 500, you receive a bonus time of 50 seconds. To help you keep track of the time remaining, the screen flashes when there are 25 seconds left. As noted above, the arrow on the right side of the screen helps make sure that those valuable bullets you're shoot- ing are not wasted. And finally, the player piano cranks out ragtime tunes to help relieve the tension. To
change the tune, shoot one of the white keys on the player piano. To turn the music off, shoot a white key twice.
Gome Strategy
When the game first runs, you have a few seconds before the mugs start to appear. It's wise to use this time to shoot a few of the cards (in order, as we mentioned) in case your bul- lets run low during the game. Try to make the mouse appear as many times as possible to receive higher scores. When it appears, try to shoot it as many times as possible. Unless your bullet count is high, it's a good idea to set your sights on the windows as they start to open. And remember to keep an eye on your bullet supply and the time remaining.
To play Saloon Shootout, load the program using the format LOAD "SALOON",8,l Start the game by typing SYS 10240 and pressing RETURN.
|
Statistics And Point Totals |
|
|
Time: |
2 minutes |
|
Bullets: |
35 |
|
Scoring |
|
|
Mugs: Missed mugs: Cards: |
10 -5 10 |
|
Back of card: |
-10 |
|
Good guy: Bad guy: Mouse: |
-100 25 20,40,60,80,100 |
6
Best of COMPUTEI and Gazette 29
"Props" is a fast-paced, nonviolent game for the 6i with six levels. Ani- mated in machine language, it uses all eight sprites, programmed charac- ters, and all three SID voices for sound effects.
Included in the article is a de- tailed program discussion which of- fers a variety of excellent programming tips and techniques.
You are a lonely pigeon, lost in a dangerous sky filled with whirling propellers. Your mission is to return to your coop and your mate, for a brief rest before flying away again. To make matters worse, every time you leave, and at other uncertain intervals, your mate moves to a new coop.
While in flight, you must avoid getting pulled into the propellers. If that happens, you lose points. Un- less you escape quickly, the props may pull you back again and again. The props start in orderly forma- tion, but every collision will bump one out of line; so the worse you play, the more confusing things get.
To play, plug your joystick into port 2. The six skill levels range from leisurely to manic. Whenever you reach home, your score is dis- played briefly. If you press the fire button during the score display, the game pauses to let you catch your breath. During the pause, you can change to a different skill level by pressing number keys 1 through 6. To quit, just pause and press the 0 key. If you score well at any given
Props
Philip I. Nelson
level, the game pauses by itself and lets you pick a new skill level.
The Animation Subroutines
Two main machine language (ML) routines are responsible for virtual- ly all the animation. The first one reads the joystick, moves your bird shape accordingly, and flaps the wings of both birds. The second rotates the eight propeller sprites and moves them up or down. Two additional small routines help pro- gram a new character set and fill color memory with white values for the new-ROM 64s.
Let's look first at the bird- moving routine (Birdmove), which you could adapt for just about any graphics game. Birdmove animates our bird-shaped character. The rou- tine keeps track of a variable, BIRD- LOC, that represents the bird's current screen location. To move the bird around in screen memory (locations 1024-2023), first we put a blank space into BIRDLOC to erase the character.
Next we check to see whether any movement has been requested through the joystick. If so, we change the BIRDLOC variable to represent the new screen location. If not, BIRDLOC stays the same. In either case, we then plant a new bird shape in the updated BIRD- LOC screen location.
Setting The Bird's Boundaries
To move the bird left or right. Bird- move will subtract or add 1 to BIRDLOC. To move the bird up or
down on the 40-column screen, we subtract or add 40 to BIRDLOC. Before moving our pigeon around in memory, we need safeguards to prevent the bird figure from flying above screen memory into the BASIC program space, or below it into the sensitive zero page of memory, either of which could crash the computer.
Birdmove uses two techniques to confine the bird. The first com- pares BIRDLOC to absolute upper and lower limits. If you try to move lower (<1024) or higher (>2023) than the bounds of screen memory, Birdmove will terminate without changing BIRDLOC.
Coiiislon Detection
The second safeguard is a collision- checker for sideways movement. When you move left, for example, Birdmove holds the updated BIRD- LOC position in temporary storage. Before it moves a bird figure into the new location, the routine checks that spot to see which of the three possible characters is there.
If the desired spot contains a space, your bird can move left. If the new spot holds the coop charac- ter, the old BIRDLOC is restored and you exit Birdmove without changing position. If neither char- acter is found, then the spot must contain the mate character, so the routine sets a flag to show that the bird has reached home, and ends with the wing-flapping display.
To modify Birdmove for your own games, just add more compari- sons to check for as many possibili-
30 Best ot COMPUTE! and Gazette
ties as you need. For example, your game might check the desired loca- tion and then branch to appropriate routines to score if you've hit a treasure, faint if you've Hit a troll, rejoice if you've bumped into a friend, and so on.
The Joystick Flags
The joystick reader at the front of Birdmove is from the Commodore 64 Programmer's Reference Guide. It will store flag values in a memory location which you can then PEEK to determine movement. In "Props," the joystick flag values are in the cassette buffer, but you could put them in any safe memory spot. The right/left flag is stored in location 832, and the up/down flag in 833. The value in 832 will be 255 for left, 1 for right, and 0 for no movement. The value in 833 will be 255 for up, 1 for down, and 0 for no movement. Note that leftover flag values will remain in the computer's X and Y registers, though, so if your ML program goes from this routine to one that uses indirect addressing, you should clear the X and Y regis- ters to 0 to keep things straight.
Programmed characters are used to make the birds' wings flap. In lines 62000-63000 of Props, we first copy the character set from the ROM chip into RAM memory be- ginning at location 14336. Then we create new shapes for characters 90-96 by POKEing new values into the right places in our RAM charac- ter set. Character 90 is programmed to serve as our coop character, and the other six are a series of bird shapes.
Each time we call the Bird- move routine, we also flip to the next character in this v^ing- flapping series to create the illusion of move- ment. To see all the programmed characters, first RUN the program and then press the STOP key while the instructions are displayed. Hold down the SHIFT key and press CLR/HOME to blank the screen. Now type in this line. You'll have to use abbreviations to fit it all on two lines.
PRINT"{CLR}"TAB(255): K = 90:FORJ= 1024TO1276STEP42:POKE54272 + J,l:POKEJ,K:K = K + 1:NEXTJ
Press RETURN and you'll see the coop character and six bird shapes in the upper left of the screen.
Flapping From BASIC
Now let's make our bird flap its wings from BASIC in immediate mode. Type this line and then press RETURN:
FORK = ITOlOOOOOiFORJ - 91T096:POKE 1024,J:FORL = 1T030:NEXTL,J,K
The bird should be flapping at top left. Press STOP when you've seen enough. While we're at it, let's to the same job with our ML routine. To set things up, type this line and press RETURN.
POKE251,0:POKE252,4:POKE834,91
This puts information in memory locations which the ML routine uses to position the bird and start the wing-flapping character series. Now type this line and press RETURN:
FOR) = 1T0100000:S YS49608:FORK = 1T030:NEXTK,J
Using The Routine's Modules
As before, press STOP when you've seen enough. The entire Birdmove routine starts at location 49408 in memory, with its flap por- tion toward the end of the routine (49608). At certain points during Props (the reunion or a pause), we want the birds to flap their wings without moving. So we just bypass the movement parts entirely, start- ing at location 49608. If all we want is to place the mate somewhere, without any moving or flapping, we can jump in even later, at 49615. By structuring our ML program in distinct modules, we're able to get maximum use out of what we've written.
Now let's call the whole Bird- move routine to let our bird fly free. First, type this line and press RETURN.
POKE834,91:POKE835,0:POKE836,4: POKE837,230:POKE838,6:POKE251, 255:POKE252,5
We just positioned the bird and set limits to keep it on the screen. Now enter this as one line.
PRINT"{ CLR I ":FORJ - 1024TO2008 STEP41:POKEJ,90:POKEJ + 54272,1: NEXT:FORJ = lTO100000:SYS49408: NEXT
You'll see the bird wrap around the side of the screen when its way is clear, but stop when it hits a coop character. The up-and-down move-
ment routine contains no collision- checker, though, so moving in those directions will erase any char- acter you encounter.
Vary The Difficulty With Delay Loops
Running at full ML speed. Bird- move is fun to play with, but too fast to be practical. Props uses a variable delay loop (pegged to skill level) to slow things down to a manageable speed.
Spritemove, the second big ML routine in Props, handles the sprite animation, moving the eight pro- pellers up or down at the correct speed and twirling them in unison.
Look at lines 2-6 of Props and you'll see something odd. The game works by cycling through these lines, calling the Birdmove routine over and over with the statement SYS 49408. But Sprite- move is called only once {SYS 49152) in line 1, while we're setting things up. Yet the sprites move con- tinuously as long as we're playing. How can we make Spritemove work all the time without calling it repeatedly? Easy — just let the com- puter do it along v«th its other housekeeping.
Harnessing The Hardware Interrupt
In addition to executing your pro- grams, your computer's processor chip has continual housekeeping to do like updating timers and scan- ning the keyboard. But it can do only one thing at a time. So occa- sionally the computer stops doing your work and takes time out for its own. You never notice these inter- rupts, because they happen about 60 times every second.
Like Birdmove, the 64's hard- A'are interrupt rouHne is just anoth- er ML program, starting at location 59953 ($EA31) in memory. By changing one pointer (vector), we can have the computer perform our ML routine first, then on to do its housekeeping as usual — 60 times a second.
Memory locations 788-789 ($0314-0315) are specially re- served to hold the address where this interrupt routine begins. When you turn on your 64, it automatical- ly sticks the normal (default) ad- dress in these locations. The first
Best ot COMPUTE! and Gazette 31
part of Spritemove just changes this vector to point the computer to the beginning of our ML program.
At the end of our ML routine, we send the computer on to its normal interrupt program at $EA31, rather than returning to the program as we do in a conventional ML subroutine.
Watch It In Isolation
Such an inlerrupt-driven ML rou- tine will seem to run independent of BASIC. To watch Spritemove in isolation, first RUN Props and press the STOP key when the props move. You'll see the blinking cursor and READY signal, which shows the computer has quit executing our BASIC program. We're back in BASIC immediate mode, but Sprite- move is still working along with the interrupts, so our graphics and sound keep going.
We can do anything we'd nor- mally do from BASIC, even call other ML subroutines as we did in the examples above, but there's a limit to how far we can take this technique. Grafting a lengthy ML routine onto our interrupts will make those "time-outs" so long that they slow our BASIC opera- tions down to a crawl.
To stop Spritemove, first clear the screen of character graphics by holding down SHIFT and pressing CLR/HOME. Now type SYS49152 and press RETURN. The props and sound should freeze.
To restart the props, move your cursor up to the same line and press RETURN again. The interrupt vector now points to Spritemove again, and we're back in business. Spritemove is designed to alter- nately change and restore the inter- rupt vector, every time we call the routine, letting us turn it on or off at will.
Ttie Sprites Are Still Ttiere
Note that stopping Spritemove doesn't erase the sprites. If we want them to disappear at certain points in Props, we have to disable their display with the statement POKE SP-l-21,0. When that's done, the sprites are all still moving in the sense that Spritemove keeps chang- ing their location registers and shape pointers as always. But none of this is visible since we've com-
manded the computer not to show it on the screen.
Compared to the interrupt rou- tine, the rest of Spritemove is sim- ple. The BASIC setup portion of Props sets all eight sprites to fixed horizontal locations, giving each a track to run up or down in. Each prop always flies in the same direc- tion— one space up or down on the sprite grid for every execution of Spritemove at skill level 1.
Each sprite has a register (memory location) containing its vertical location. To move the props, Spritemove increments or decrements every vertical location register one or more times, depend- ing on skill level.
Believe it or not, this is simpler in ML than in BASIC. Let's say sprite 1 starts out at vertical location 100. If we start plopping bigger val- ues into its vertical location register, sprite 1 will move down the screen.
Safe Increments Are Assured
In BASIC we'd have to program in a safeguard to make sure we couldn't POKE a value larger than 255 into the register, since that would abort our program with an ILLEGAL QUANTITY error.
But ML lacks the error- checking mechanics of BASIC, and simply won't let you put a number bigger than 255 into any memory cell. Try- ing to increment a register from 255 to 256 will just flip its value back to 0. Increment that register again, and it'll contain the value of 1, and so on.
The same thing works in reverse — decrementing a register that contains a 0 value will give us the value of 255. This characteristic of ML, which might seem a limita- tion, is used to advantage in Sprite- move, which just keeps increment- ing and decrementing the vertical sprite registers blindly. We know ML won't let us exceed the safe 0-255 range which, conveniently enough, the sprites also use for ver- tical location.
Animating Ttie Propellers
You define a sprite's shape by pointing it to a block of shape infor- mation which you've placed in memory beforehand. To rotate the props, we just flip them through a
series of related shapes, much as the birds are made to flap their wings. Spritemove points all eight sprites in unison to successive sets of shape data which was stored when we set up Props. Since props are bilaterally symmetrical, we can save memory space and get the ef- fect of an eight-position rotation by flipping them repeatedly through a series of only four shapes.
Just as the computer looks in a special place to find the address of its interrupt routine, Spritemove checks and changes a special spot for the current shape pointer, loca- tion 828 (#033C).
We've used other memory reg- isters in the cassette buffer to store things for our ML routines. Loca- tions 832 and 833 hold values re- ceived from the joystick, as we've seen. Location 842 holds the home flag: The Birdmove routine will store a value of 1 here if the bird reaches home; otherwise, the regis- ter contains a 0.
Passing ML Values To BASIC
This is an example of how to use variables in machine language, and pass information back and forth from ML to BASIC sections of your program. In BASIC, of course, we'd name a variable something like HOME, and say that HOME = l when home is reached, making sure that HOME = 0 at all other times. But ML doesn't recognize names — just numbers inside mem- ory locations. So, in Spritemove we choose a special memory location (842) to represent the condition of our home flag. Then we store a 1 value in 842 as a signal whenever home is reached.
Line 3 of the BASIC program uses the PEEK function to check that same memory location (HM = 842) for a nonzero value, branching to the BASIC "home" subroutine at line 20 if that condi- tion is satisfied. Once we've per- formed our home routine, we set the flag back to 0 in line 24, so that our bird can get lost again.
Synctironlzlng Sound And Action
Props also creates its filtered and ring-modulated sound effects by passing values from ML to BASIC.
32 Best of COMPUTEI and Gazette
When the bird flies around the screen, a soft musical tone is heard, changing constantly in relation to screen position. We start making this sound in line 2 by POKEing voice 1 on. In line 6 we change the pitch of voice 1 by PEEKing into location 251 which, you'll recall, is used by Birdmove to store our bird's screen location. In this simple way, we can link the bird's sound effect to its graphics action.
Voice 2 is always on during the game, set to the noise waveform to make a swooshing sound. The ef- fect of fading in and out is created, not with the volume control (which affects all three voices equally), but with a filter, which we can set to affect any or all of the voices at a given time. In line 1002 of Props we POKE register 54296 with a value of 47. Besides volume, this register lets you select what type of filter you want. So we started with a value of 15 for maximum volume in all voices, then added 32 (15 + 32- 47). This turns on bit 5 of the regis- ter to activate the bandpass filter, which will cut out all but a narrow band of frequencies in the tone of the filtered voice.
Next we have to tell the com- puter which of the three voices it should send through the filter. Also in line 1002, we POKE the value of 66 into register 54295, which sends voice 2 through the filter and selects a moderate amount of resonance. (If you've never played with filter reso- nance, try editing line 1002 to sub- stitute the value of 226 instead of 66, to hear the more pronounced effect of maximum resonance.)
A Swoosh Is Filtered Noise
Now the filter's ready to use. Pick- ing the noise waveform for voice 2 gives us a more or less random mishmash of all audible frequen- cies to work with. Setting the cutoff frequency low will pass through a narrow band of low frequency tones for a roaring or rumbling sound, and cut off all other tones. A high cutoff value gives us a narrow band of hissing, high-frequency tones. To make a swooshing sound, we just change the cutoff frequency at high speed, from low to high values.
To tie this sound to the graph- ics action, we let Spritemove
change the cutoff frequency at ML speed. At the very end of SPRITE- MOVE is a little routine that stores a value into the filter cutoff fre- quency register. This value is the same one used to control how many spaces the sprites move each 1/60 second. So at higher skill lev- els we add bigger numbers to the cutoff frequency register, to sweep the filter from low to high more rapidly.
As with sprite positioning, we can increment forever, without fussing over illegal quantity errors. What we get is a repeated low-to- high sweep in the range 0 to 255.
Filtering Voice Three
The echoing synthesizer tones heard while pausing, or when the bird's mate changes coops, are pro- duced by applying similar band- pass filtering to voice 3. The technique is the same — we sweep the filter cutoff frequency upward, over and over. But instead of noise we're using a triangular waveform, ring-modulated by the pitch fre- quencies of voice 2 (line 51).
The pitch of voice 3 is linked to the bird's screen position by using the value found in location 251. And the pitch frequency of voice 2 is also swept down over and over, in our familiar 255-to-O range, by the Spritemove routine.
Unlike the noise waveform, which contains tones at almost ev- ery audible frequency, the triangu- lar waveform is rich in certain harmonic frequencies and totally lacking in others. So at certain fre- quencies the bandpass filter cuts out just about everything, causing silence. Adding ring modulation suppresses the fluty tone we'd oth- erwise get from a triangle wave, and adds new harmonics for an even stranger effect.
A Two-Voice Sound Effect
One final, important difference be- tween this and the swoosh sound is in the ADSR (attack/decay/sus- tain/release) envelope. For the prop sound, we set voice 2's sustain value to the maximum of 240 (line 1082), and trigger the ADSR enve- lope only once at the beginning (line 11050).
With maximum sustain, the tone will never fade out naturally —
it only seems to reach silence when our filter is set to its lowest cutoff frequencies. For contrast, we trigger the ADSR envelope for voice 3 ev- ery time we make the synthesizer sound, causing the slow, ghostly fade-out.
But you do fancy filtering with- out mastering ML. Take a look at lines 11050-11058, which govern the animation and sound of wings flapping during the instruction dis- play. Here we're controlling the fil- ter frequency from an entirely different source.
A Special Number Generator
Location 54299 (VM + 3) is a very special register that can be made to produce four different number se- quences which are handy for con- trolling sound. It can generate a 0- to-255 sweep like we've used up to now. Or it can sweep from 0 up to 255 and back down again. It can generate random numbers, and can also flip back and forth from 0 to 255 at varying rates.
You choose zvhich number se- quence you want by selecting one of the four waveforms for voice 3. You control the rate at which the numbers change within that se- quence by setting the frequency of voice 3.
For a convincing wing-flap- ping sound, we want the filter to sweep up and then back down again. So we select the up-and- down number sequence by setting voice 3 to a value of 16 in line 11050. To time it to the beating of our birds' wings, we just fiddle with various pitch frequency values for voice 3 (H3 and L3) until we get it right. Note that you don't want to hear voice 3 — you're only using its pitch values to control the output of voice 2. So W3 is POKEd to 16, which selects the triangle wave- form without turning on the gate bit which would make the voice audi- ble (that is, by POKEing W3 to 17).
Once you have Props working, you can learn a lot about the 64's SID chip just by changing the val- ues used in this and other sound sections. ®
Best of COMPUTE! and Gazette 33
Powerball
illiom Chin, Editorial Programmer
This outstanding arcade-style game's moving obstacles, special features, and different game screens will keep you thinking and moving fast. For the Commodore 64. A joystick is required.
Not your ordinary version of Break- out, "Powerball" is an addictive, multifaceted arcade-style game with new features such as capsules and slivers — and ten different screens to master.
Each Powerball screen is popu- lated by its own configuration of slivers, capsules, and bricks. After a few games you'll begin to develop strategies for each of the screens. As in Breakout, the object of the game is to destroy a series of walls brick by brick. In Powerball, this can be done in two ways — you may use your paddle to bounce balls against the wall, and you may shoot the wall down after catching a fire cap- sule. Unlike Breakout, you must quickly observe the characteristics of each type of screen object to earn high scores.
To play Powerball, enter LOAD "POWERBALL",8,l. Start the game with SYS 49152.
When the game begins, you'll see a paddle in the center of the screen near the bottom. Below the paddle you'll see an indication of the number of paddles remaining, your current score, and the high score of the current series of games. You begin each game with four paddles available (only one paddle can be active at any given time, however). Use a joystick in port 2 to move the paddle left and right. Press the fire button to release the ball and begin play.
Blasting Bricks
Your main weapon against the bricks is the bouncing ball. Use your paddle to keep the ball in motion. You'll lose a paddle whenever a ball
gets past you to the bottom of the screen. The game ends when all paddles have been lost. When all breakable bricks on the current level have been eliminated, you advance to the next level. When you lose all your paddles, you are not automati- cally dumped back to the first level. Instead, you can press the fire but- ton to start a new game at the cur- rent level. You can press SHIFT at any time to pause the game. (Use SHIFT-LOCK for longer pauses.)
Bricks come in three varieties: soft, hard, and sohd. Soft bricks are green and are destroyed by being shot or by being hit by a ball. Hard bricks start out gray and change color each time they are hit. They must be turned green before they can be destroyed. Solid bricks are white. They can be destroyed only by a power ball. However, it's not necessary to destroy all the white bricks to advance to the next round.
Slivers And Capsules
Slivers and capsules are the special features that distingush Powerball from most other games of its type. Slivers are small flashing objects that change color as they float around the screen. Balls bounce off the slivers. This can be helpful at times (to deflect a descending ball), but, in general, slivers do more damage than good. Touching a sliv- er with your paddle sends the sliver to the top of the screen where it is least dangerous. There is no way to permanently destroy a sliver.
Capsules are the same shape as your paddle. They appear at ran- dom times and at random locations near the top of the screen, and then descend vertically down the screen. Touching a capsule with your pad- dle gives the paddle a special ability depending on the color of the cap- sule. (If you're using a monochrome display, each type of capsule also has a distinguishing label.) Below is
a list of the capsule types and their corresponding powers:
|
Label |
Color |
Power |
|
S |
yellow |
slows down all balls |
|
C |
green |
paddle catches ball |
|
L |
blue |
paddle becomes longer |
|
F |
red |
paddle fires |
|
P |
purple |
ball becomes power ball |
|
3 |
It. blue |
ball splits into three balls |
|
• |
gray |
extra paddle |
|
N |
orange |
go to next screen |
A standard paddle with no special powers is white. When a capsule is touched, the paddle takes on the color of the capsule to indi- cate its current power. A paddle can have only one power at a time; the previous power is lost each time a new capsule is touched. The special power is also canceled when the paddle is lost.
A few notes about the powers: When you've caught the green C capsule, your paddle will capture the ball so that you can reposition the paddle for an accurate shot. Press fire to release the ball. If you wait too long (about three seconds), the ball will be released automati- cally. The purple P capsule turns the balls into power balls, which destroy all types of bricks. After you capture a red F capsule, your paddle has the power to fire darts at the bricks as well as to deflect the ball. Press the fire button to shoot the darts. The light blue 3 capsule splits the ball into three individual balls (but only once each time one of these capsules is touched — you'll never get more than three balls). The split balls behave the same as the original ball, except that you don't lose a paddle until all three of the split balls have slipped past to the bottom of the screen. The gray * capsule adds an extra paddle to your total when touched. Touching an orange N capsule takes you to the next level, regardless of how many bricks remain on the current level. The gray * and the orange N capsules are rare. ®
34 Best of COMPUTE! and Gazette
Laser Beam
This fast-paced arcade game is writ- ten entirely in machine language and challenges the quickest reflexes. A joystick is required.
"Laser Beam" is a fast-action arcade-style game with a simple premise — you score by moving. The more you move, the more you score. The object is to avoid several bouncing balls until just the right moment when you must grab them and stuff them into a basket.
To get started, plug a joystick into port 2 and type LOAD'XASER BEAM",8,1. Then type SYS 49152 and press RETURN.
The Highlight Zone
Move the joystick up or down to select the difficulty level — 0 is the slowest and 9 is the fastest (in fact, 9 is so fast that it's almost unplay- able). The game starts when you press the fire button.
Immediately you'll see seven colored bails bouncing around the screen. At the left is a highlighted "safe zone" occupied by a small stick figure — that's you. By moving the joystick, you can maneuver your figure around the screen. But if you venture out of the safe zone and bump into a bouncing ball, you're zapped. (You get three lives per game, as indicated by the fig- ures at the bottom of the screen.)
Your goal is to render the balls harmless, grab them one by one, and drop them into the basket in the lower-right corner. To make a ball safe to touch, you have to shoot it with the laser gun. The laser is visible along the edge of the screen. To control it, first you must move your figure into the uppermost cor- ner of the safe zone. The laser gun is
Mike Greenfield
Version by Kevin Mykytyn
under your control only when your figure is at this spot. Pushing the joystick to the right moves the laser clockwise around the edge of the screen, and pushing the joystick to the left moves the laser counter- clockwise around the screen. Press the fire button to activate the beam. If you push the joystick in any other direction, you'll move your figure away from the top of the safe zone, and the laser gun will no longer be under your control.
Now, you can't shoot just any bouncing ball with the laser to make it safe to grab. You have to shoot the ball which matches the border color of the screen. As soon as you hit the ball, it turns white. Then you can maneuver your figure out of the safe zone, grab the white ball by touching it, carry it to the basket, and drop it in by pressing the fire button. Afterward you must scurry back to the safe zone before a collision with another ball.
For example, let's say the bor- der color is red. First you move your figure to the top of the safe zone to take control of the laser gun. Next you push the joystick right or left to aim the laser at the red ball. When you have a clear shot, press the fire button to shoot the beam. If you score a hit, the red ball turns white. Then you can push the joystick in another direction to move your fig- ure out of the safe zone. Grab the ball, stuff it into the basket by pressing the fire button, and make your escape — all while avoiding the other bouncing balls, of course. If you succeed, the border color changes to correspond to one of the remaining balls.
You continue with the process until all the balls are safely dropped into the basket. Then another round begins.
Bouncing Chaos
Sounds simple, right? Well, it's not. There are a few complications. Sup- pose you fire the laser and hit a bouncing ball that doesn't match the border color. It turns white, too. But it isn't safe to grab. If you touch it, you're zapped. This becomes a real problem when you accidentally shoot several of the balls and turn them white. Only one of them is safe, and you have to remember which one. It's not easy when three or more white balls are bopping all over the place.
There is an incentive for creat- ing this chaos, however. The num- ber of points you get for dropping a ball in the basket doubles for each white ball on the screen. If the only white ball is the one you're grab- bing, you get only 5 points. If a second ball is white, you get 10 points; if a third ball is white, you get 20 points; and so on. If all seven balls are white when you drop the first one into the basket, you score 320 points.
Another complication is that your safe zone doesn't always stay safe for very long. After you shoot the ball that matches the border color, it begins shrinking from the bottom up. If you don't hurry out, you'll get zapped.
And there's yet another reason to move quickly: If you finish a round by dropping every ball into the basket before the horizontal bar at the bottom of the screen disap- pears, you get a 50-point bonus.
If all this action causes your brain to momentarily suffer a sys- tem crash, you can freeze every- thing by pressing and holding the SHIFT key. Press SHIFT LOCK to freeze the game for extended peri- ods. Release SHIFT to resume play.
Best of COMPUTE! and Gazette 35
YOU FOUND IT!
A Reliable Source for Your Computer Supplies. At Budget— frienrff)r PrJcesI
ORDERING IS FAST AND EASY.,. AND TOLL FREE! f^e^ 'i We're as close os the phone.
caifor FREE CATALOG!
Innovative products to maximize the
efficiency of your computer operolion.
GUAMNTHD: * Quality -k Compatibility
* Your Personal Satisfaction
3M
\t*P^
Highland diskettes
Mani]tac;liiti'd to moGi your needs Econoniicol Diskette backed by 3M's tepulaliori for quaiily and reliobiliiy
^QC SV*" DSDD
" ' Sold lO/Box
Eaet* Minimufn SO D.iki
SHCMi nriciNC on th( run imi of jm hmcnitk mioiiI
-■--'■"'-^\ 3M Formatted V:!^.r.J Doto Cartrldgat
Sono noa'ly on hour o' more ol lor moiling tima wi'h 3M'i new family of for molted data cortndgei olphomot^^, • dehnmot
* kappomaf
' gammomot
Coll lof Price t Compolibilitv
•^
I
J
Min. Ord«r $25.00. Add 10^ for less Ihon SO disks
$& H: Conlinentol USA t4.00. 1st 100 or ftwtr
disks, 13.00. »och succteding 100 v fewer. Foreign
Orders. APO/FPO. please call. Ml Residents odd 4%
tai. Prices subject to chonge. Hours, 8:30
A.M.-7:0OP-M-n.
II Precision Data Products'"
PO BaifllA''. (iiuid Kipids. Ml IVMH Cub SovMilnto (6l6)*i2 M5'? • KAX 1616I«2-«U toll l-fH Ofdci Lino Ml l'B«)'fi12-24U II loll Ki« Order I mti Ouiiide Ml 1 800 2)IOO:a
$
WIN $ THE LOTTO
With Your Computer!
Forget random numbers. This program for home computers does an actual anatyals of the past winning numbers. This amazing program will qulckln pro- vide you with all the data you need to predict which numbers will likely come up In subsequent drawings. All consistent lottery winners use some kind of system based on the past win- ners. Using the real power of your com- puter gives you a definite edge. It's menu driven and all you do Is add the latest winners each week and the pro- gram does the rest In seconds. On screen or printer It shows hot and cold numbers, frequency, groups, sums-of- dlgits, odd/even, wheels numbers and more. No thick manual to read. It even has a bullf-ln tutorial. Ask your software dealer or call or write:
SOFT-BYTE
P.O. Bom 556 F. Park Dayton, Ohio 45405 (513)233-2200
THE LOTTO PROGRAM is designed for all
6 & 7 draw loilo games (up io 49 numbers)'
DON'T PLAY LOTTO WITHOUT ITl
APPLE &M/S DOS IBM 24.95
COMMODORE & ATARI 21.95
TRS-SO & MOD ill. IV 21 .95
MACINTOSH (super vcnton) 29.95
Pleaec add 12.00 ehlpplng/ handling. Faet aefvlce on charge caida. P
Bagdad
Bryan Files
Beware of the evil genies determined to knock you from your magic carpet. With a little strategy and skill, you can trap them in bottles — but work quickly before they re-emerge. A jay- stick is required.
Flying through Bagdad on your magic carpet, you're suddenly ac- costed by some rug-riding evil ge- nies bent on knocking you off — literally and figuratively. Your only defense is to knock them off first, and this takes some tricky maneu- vering. First, you must trap each genie in a bottle. Then collect the bottles before the genies have a chance to escape. If you fail to col- lect a bottle in time, the lid opens and your battle resumes.
The Calm Before The Storm
Ridding the city of enemy genies gives you a brief rest before the next wave of more numerous and deter- mined genies. You begin with three lives, with a new life added for every 5000 points you earn. Only white genies are encountered dur- ing the first nine waves, but the tenth wave brings a new, more ag- gressive menace — the blue genies. If you manage to reach the four- teenth level, white, blue, and the dreaded purple genies emerge for a fast and furious battle.
Flying The Magic Carpet
After loading and running "Bag- dad," push the joystick, which
should be in port 2, forward to start the game. Move the joystick left or right to move your genie corre- spondingly. Press the fire button to fly up, and release it to allow gravi- ty to pull you down. Hovering re- quires alternately pressing and releasing the fire button. If you reach the top of the screen, your genie will bounce, however, he will wrap around the screen at the left and right edges.
Strategic positioning is ex- tremely important. When two ge- nies hit at the same level, they bounce off each other. You have to use your carpet to hit the other genies. If you're at a higher level when you collide, the edge of your carpet knocks the genie off his rug. The falling genie then crawls back into his bottle, which falls to the ground (or to one of the intermedi- ate levels).
Once in the bottle, the evil ge- nie begins to work his way out again. The only way to get rid of him is to fly down and pick up the bottle.
If you hit a genie when you're at a lower level, you're the loser. You don't have a bottle, you simply lose one of your genies. You'll rein- carnate at the bottom of the screen, providing you have at least one life remaining. During the three or four seconds the genie is flashing, he cannot be defeated by enemies. However, if no genies are nearby, you can terminate the flashing and begin play by moving the joystick.©
36 Best of COMPUTEI and Gazette
Arcade Baseball
Here's a computerized version of the once-popularmechanical baseball game found in the pre-electronic ar- cades. The on/y difference is you don't need any dimes or quarters to play. An exciting one- or two-player game.
Spring training is over and baseball season is under way. Here's a chance to do some swinging and pitching against a friend — or your Commodore 64. "Arcade Baseball" is modeled after the mechanical baseball arcade game that was pop- ular before computerized games dominated the scene. But this com- puter game offers a few options that the mechanical versions did not: You can choose to practice or play, and you can select an opponent: another person or your computer.
A Few Choices
To play the game, load and run Arcade Baseball. First you're prompted to choose Practice (fl) or Play {f7). In practice mode, 20 pitches — a random mix of fastballs, changeups, curves, and sliders — are thrown so you can practice hit- ting. (To change the number of pitches thrown, change the value of RM in line 740.) No runners are displayed, and outs and runs do not accumulate. After all the pitches are thrown, you're asked again to select Practice or Play.
In Play mode, you're asked to select a one- or two-player game. Press the 1 or 2 key. If you wish to play the computer, select the one-
Kevin Mykytyn and Mark Tuttle
player game. Now you're ready to begin.
The screen is divided into three sections. On the left is the playing field. Along the top of the field is a row of black holes. A batted ball will land in one of these holes, and each is marked with a result {single, double, triple, or out). To hit a home run, the ball must pass over the center of the rectangular ramp near the center of the field. (The crowd loves a home run and cheers when either team hits one.) At the bottom of the field is a specially designed bat.
The upper right comer of the screen is the scoreboard, which contains the inning, number of strikes, outs, and the current score. Players are represented as Visitor and Home. In the square below the scoreboard is a display of the base- ball diamond, designed to show which bases are occupied by the team at bat.
Play Balll
You must first choose a one- or two-player game. The one-player version — like the original arcade game — lasts for three outs. Your objective as batter is to score as many runs as possible before reach- ing three outs. The computer, as pitcher, randomly selects the type of pitch: fast ball, changeup (a slow moving pitch), curve (which breaks away, to the right of the plate), or slider (which breaks in, to the left of the plate). Swing at a pitch by
pressing the space bar. This moves the bat left to right. Once the bat is released, you no longer have con- trol of it, so you must time the release of the bat to meet the pitched ball. If the ball passes un- touched, it counts as a strike.
Because different pitches cause the ball to travel at different speeds and in some cases change direc- tions, timing the release of the bat is crucial to good hitting. The bat is designed as a half circle to allow you control of the angle of the bat- ted ball. There's no such thing as a foul ball in Arcade Baseball; you can bounce the ball off the sides of the field.
When you get a hit, you'll see any movements on the base paths at the lower right of the screen. If the hit is a single, the batter advances to first base, and any other base run- ners move up one base. A double moves all runners up two bases, a triple three bases. A run scored is indicated by a chiming tone and an update on the scoreboard.
The two-player version offers more variety:
1. The game lasts for three in- nings. If the score is tied after three innings, play continues until one player wins. (The home team al- ways gets to bat last, regardless of the score.) The visiting team is blue, the home team red.
2. You pitch as well as hit. Press one of the function keys to deliver a pitch: fl — fastball; f3 — changeup; f5 — slider; and f7 — curveball. 6
Best of COMPUTEl and Gazelle 37
Eagles And Gators
Featuring 16 sprites on a split screen, unique sound effects, and realistic animation, this two-player action game is programmed entirely in ma- chine language. It's written for the Commodore 64, and requires at least one joystick.
In "Eagles and Gators," an intense two-player action game, even the title screen is animated. Though the Commodore 64 is ordinarily limited to 8 sprites, this game displays 16 moving sprites at all times and in- cludes highly realistic animation as well.
The game begins with an ani- mated title screen, asking whether you want to read the game instruc- tions. Press Y to view the instruc- tion screen or N to skip it. Next, you're shown the game screen and are prompted to choose one of the nine skill levels. If you've never played the game before, you'll probably want to press 1 to choose the easiest level.
Flyers Against Swimmers
When play begins, the screen is split into upper and lower color zones: sky-blue for the eight high-flying eagles and murky black for the eight gators swimming below. Each play- er controls a group of eight sprites. The game is written to be played with two joysticks, but you can sub- stitute keypresses to control the ga- tors, normally controlled by joystick 1. Press the CTRL key to move left, the 2 key to move right, and the space bar to fire.
Your sprites are in constant, realistic motion, flying or swim- ming up and down in their zones, rebounding when they hit the bor- der between the two worlds. The flashing colored sprite in your group is the one controlled by your joystick. To switch control to a dif- ferent sprite, move left or right.
The goal of the game is to ex-
Philip I. Nelson, Assistant Editor
pand your zone and push your op- ponents off the screen. This is done by convincing your creatures to push against the sky/water border. Press the fire button just as your flashing eagle or gator bumps the border, and it will "clamp" on and start to shove. Whenever you clamp successfully, your opponent's screen flashes red, and all of your creatures thrash momentarily with excitement.
Your zone expands whenever you have more sprites pushing than your opponent, and the game ends when one side or the other takes over the entire screen. That sounds simple, but it takes precise timing to clamp just one sprite. If you press the fire button at the wrong time, your sprite moves away from the border, regardless of its initial di- rection. If you press the fire button when your flashing sprite's already stuck to the border, it bounces back to the farthest end of your zone.
Your adversary can also un- clamp one of your creatures by clamping one of his or her creatures directly across the border from yours. The ability to unclamp an opponent's creatures at any time adds an extra element of strategy and makes it possible to turn the tables on your opponent even when defeat seems almost certain. The game is designed to reward concentration and careful play, and to discourage wild tactics such as holding the fire button down con- stantly. At best, you'll prevent your creatures from approaching the border; at worst, you'll inadvertent- ly unclamp those from your side who are already pushing.
When you win a game, the screen clears to your color, and a joyful, double-sized sprite from the winning side performs a victory dance across the screen. At this stage you can pick a new skill level for the next round or quit by press- ing the Q key. After you exit, the
game can be restarted by typing SYS 16384 and pressing RETURN. To stop in midplay, press RUN/ STOP-RESTORE.
Displaying 16 Sprites
space doesn't permit a detailed ex- planation of every routine in this program, but you may be curious about how to display more than eight sprites at a time, something often mentioned, but rarely seen in action. In order to understand how it's done, you'll need to know a little about raster displays.
Your TV or monitor makes a picture by scanning its screen with a moving electron beam called a raster. This is done line by line, from top to bottom, 60 times a sec- ond. The visible portion of a TV picture is made up of 200 raster lines, numbered from 50 at the top through 249 at the bottom. The same numbering scheme is used for locating sprites vertically on the screen, so raster line 100, for ex- ample, matches up with sprite ver- tical location 100. This correspon- dence between raster lines and sprite positions greatly simplifies the task of creating more than the usual number of sprites.
The Commodore 64 keeps track of the raster's vertical location in a special memory location (register) at 53266 ($D012). BASIC is too slow to make much use of it, but machine language (ML) is fast enough to let us check this register repeatedly and monitor the posi- tion of the raster beam as it scans down the screen. This information is used to create a split screen as well as to double the usual number of sprites.
Split Screens
To make the two-color split screen, we first establish an arbitrary "split" point somewhere near the midpoint of the screen (say, at line 100) and then repeatedly compare
38 Best of COMPUTE! and Gazette
the raster's location to that value. When the raster value is less, we know it's above the split, so we color the screen cyan to create the sky zone. When the raster value is greater, that means it has dipped below the split point, so we color the screen black for the water zone. Remember, moving downward on the screen increases the raster (or sprite) vertical location value. By changing the border color along with the screen background color, we can make the split extend the full width of the screen for height- ened realism.
The same sort of monitoring makes it possible to display 16 sprites. When the raster's above the split, we display all of the 64's 8 sprites at vertical locations in the upper color zone. When it drops below the split, we display the same 8 sprites at locations in the lower zone. The two sets of sprites are never actually displayed at the same time. The program just changes their locations so fast that your eye sees 16 solid figures, without a trace of flicker.
Shadow Registers
If you stopped at this point, you'd have two identical groups of eight sprites — upper and lower — sitting motionless on a split screen. Nice, but boring. To exploit the effect in a game, we want the two sprite groups to look different and move independently. Unfortunately, the Commodore 64 still has only eight sets of sprite control registers for handling the sprites' shapes, colors, and so on. Remember, we're just flipping the same group of eight sprites back and forth at very high speed between different vertical lo- cations. Thus, top sprite 1 doesn't just look the same as bottom sprite 1; it is the same sprite. The minute you change the shape or color of any sprite in the upper group, its lower twin immediately follows suit, and vice versa.
What we really need to write this game is 16 sets of sprite control registers. Commodore didn't de- sign 16 sprites for the 64, but you can achieve much the same effect through software. Here's an outline of how it's done in this program. First, we set aside some free memo- ry to use as "shadow" registers in
place of the actual sprite control registers. Since none of the eagle or gator sprites move horizontally, we don't need to duplicate the 8 hori- zontal position registers. However, every sprite must be able to move freely up or down and change its shape and color at any time. Thus, for each group of 8 sprites we need 8 registers for vertical position, 8 for color, and 8 more to hold shape data pointers. Three sets of 8 make 24: double that for the second set of 8 sprites, and you now have 48 shadow registers.
To make each sprite appear in the correct spot, we must transfer the contents of each shadow regis- ter into the corresponding control register at precisely the right in- stant. When the raster beam is in the upper portion of the screen, we'll take data from the eagles' set of shadow registers and store it in the actual sprite control registers. When the raster creeps down below the split, we'll fetch gator data in- stead and plug that into the control registers.
Of course, it's not necessary to do this on a two-color split screen. This particular program changes screen colors at the split point to accentuate the division between sides. But in another application, you might prefer to leave out the color changing code. The split loca- tion is just an invisible reference point that tells you when it's time to flip the sprites from one zone into the other.
Coasting On The Interrupt
Expressed in this simple, schematic form, the job of displaying 16 sprites sounds quite simple. When the raster beam is above the mid- point, make the sprites appear in the upper area. When it's below the split, move them down into the lower area and give them new shapes and colors. The process is uncomplicated in theory. But don't bother trying to do this in BASIC, which is many times too slow to read the raster's position accurate- ly. This program uses an interrupt- driven routine to manage the 16- sprite effect. Although interrupt handling goes beyond the scope of this article, the technique essential- ly wedges our custom sprite display routines into the computer's oper-
ating system along with its normal hardware-servicing routines, which do background tasks such as scan- ning the computer's keyboard. Conveniently, the interrupt-driven routine is executed 60 times per second, exactly the same frequency at which the screen is redrawn. As a result, the sprite display and color split are quite stable.
The advantage of driving an ML routine on the hardware inter- rupt is that it becomes completely automatic. Sixty times every sec- ond, the computer executes your custom routine along with its own housekeeping routines. An inter- rupt-driven routine seems to coast along all by itself, without slowing down other program events. In ef- fect, we've enhanced the