← Macintosh Midnight Madness

Macintosh Midnight Madness

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

MACINTOSH MIDNIGHT MADNESS Utilities, Games & Other Grand Diversions in Microsoft BASIC for the Apple Macintosh MICROSOFT PRESS THE WAITE GROUP: Mitchell Waite • Dan Putterman • Don Urquhart • Chuck Blanchard

A book cover with a dark blue night-time city skyline of stacked rectangular and pointed buildings, a large yellow crescent moon at upper right, and a small yellow inset showing a silhouette of a person at a computer.

Reading notes: The small 'MACINTOSH' top line and the trademark symbols are small and may not be exactly rendered. The bottom credit line is partly overlapped by a worn or creased area near 'Chuck Blanchard', so the final letters may be imprecise. Scuffs and a faint stain are present but do not obscure text.

Printed product names
Macintosh · Microsoft BASIC · Apple Macintosh · Microsoft Press
Languages
English
PDF page 1

MACINTOSH MIDNIGHT MADNESS Utilities, Games & Other Grand Diversions in Microsoft BASIC for the Apple Macintosh MICROSOFT PRESS THE WAITE GROUP: Mitchell Waite • Dan Putterman • Don Urquhart • Chuck Blanchard

A blue night-time city skyline of stacked rectangular buildings under a large yellow crescent moon, with a small yellow inset icon of a person silhouetted at a computer desk and the Microsoft Press logo at right.

Reading notes: Small trademark symbols after Macintosh, Microsoft BASIC, and Apple Macintosh are not reliably visible and were omitted. A faint stain or mark on the left side and creases are visible but do not obscure text.

Printed product names
Macintosh · Microsoft BASIC · Apple Macintosh · Microsoft Press
Languages
English
PDF page 2

MACINTOSH™ MIDNIGHT MADNESS MICROSOFT PRESS

A plain white page with the large blue stacked headline "MACINTOSH™ MIDNIGHT MADNESS" across the top and a small blue square Microsoft Press logo in the lower right corner.

Reading notes: The small text in the Microsoft Press logo box is faint and was read as MICROSOFT PRESS; the letters are small and low-contrast.

Languages
English
PDF page 3

MACINTOSH MIDNIGHT MADNESS Utilities, Games & Other Grand Diversions in Microsoft BASIC for the Apple Macintosh MICROSOFT PRESS THE WAITE GROUP • Mitchell Waite • Dan Putterman • Don Urquhart • Chuck Blanchard

A book cover with a blue-to-white gradient background, a large white crescent moon at upper right, large condensed white title lettering at top, and a small blue Microsoft Press logo box near the lower right.

Reading notes: The top-left edge of the 'THE WAITE GROUP' line appears cropped, so the leading 'T' may be partially cut off; transcribed as shown with 'HE WAITE GROUP' visible at the edge. The Microsoft Press logo text is small and stylized and was transcribed as 'MICROSOFT PRESS'.

Printed product names
Macintosh · Microsoft BASIC · Apple Macintosh
Languages
English
PDF page 4

PUBLISHED BY Microsoft Press A Division of Microsoft Corporation 10700 Northup Way, Box 97200, Bellevue, Washington 98009 Copyright © 1985 by Mitchell Waite All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Cataloging in Publication Data Waite, Mitchell. Macintosh midnight madness. 1. Macintosh (Computer)- Programming. 2. BASIC (Computer program language). I. Waite, Mitchell. II. Waite Group. QA76.8.M3M34 1985 005.265 85-21387 ISBN 0-914845-30-6 Printed and bound in the United States of America. 12 3 4 5 6 7 8 9 FGFG 8 9 0 9 8 7 6 5 Distributed to the book trade in the United States by Harper and Row. Distributed to the book trade in Canada by General Publishing Company, Ltd. Distributed to the book trade outside the United States and Canada by Penguin Books Ltd. Penguin Books Ltd., Harmondsworth, Middlesex, England Penguin Books Australia Ltd., Ringwood, Victoria, Australia Penguin Books N.Z. Ltd., 182-190 Wairau Road, Auckland 10, New Zealand British Cataloging in Publication Data available Apple• is a registered trademark, MacPaint"' and MacWrite"' are trademarks of, and Macintosh"' is a trademark licensed to Apple Computer, Incorporated. IBM• is a registered trademark of International Business Machines Corporation. Microsoft• is a registered trademark of Microsoft Corporation.

Reading notes: Trademark symbols after MacPaint and MacWrite appear as damaged characters; spelling preserved as printed

Printed product names
Macintosh · MacPaint · MacWrite · Apple · IBM · Microsoft
Printed dates
1985 · 85-21387
Languages
English
PDF page 5

Contents Acknowledgments Introduction I. UTILITIES Maclnterface MacGrid MacGraph MacCursor MacConvert MacAnimate II. GAMES MacDart MacBandit MacMouse MacBall MacGurkha MacSpace Ill. DIVERSIONS MacBuild MacOrgan MacCompose MacFinance MacMeasure ix xi 3 31 51 87 119 149 191 209 233 249 273 297 325 345 359 381 403

Reading notes: 'Maclnterface' may be OCR-ambiguous between 'MacInterface' and 'Maclnterface' as printed Roman numeral 'Ill.' may be OCR error for 'III.'

Printed product names
Maclnterface · MacGrid · MacGraph · MacCursor · MacConvert · MacAnimate · MacDart · MacBandit · MacMouse · MacBall · MacGurkha · MacSpace · MacBuild · MacOrgan · MacCompose · MacFinance · MacMeasure
Languages
English
PDF page 6

ACKNOWLEDGMENTS When microcomputers first came on the scene, one of the first things that they were programmed to do was flash a patterned sequence of lights. Early demonstration programs, in fact, we re games that were tog- gled into the machine through a series of switches. We owe our thanks to the early pioneers-to people like Bill Gates and Paul Allen who suc- cessfully got BASIC to run on an Altair, and the myriad nameless program- mers, from electrical engineers to piano players- for the tradition that this book follows. Creating games and utilities-sharing them, tearing them apart, and putting them back together-was how many of us first learned to pro- gram with BASIC. The development of this book fo llowed that same spirit. Mitche ll Waite, Chuck Blanchard, Harry Henderson, Dan Putterman, and Don Urquhart of The Waite Group development team, and Chris Mat- thews, Barry Preppernau, and David Laraway of Microsoft Press spent many hours devising, designing, refining, programming, testing, and de- scribing the games, utilities, and other diversions you will find in this book. We would like to acknowledge the help and encouragement that we received from so many people throughout this project. We would like to thank in particular Salley Oberlin of Microsoft Press for seeing this pro- ject through from the beginning; Lisa Yount, for her critique of the text through the rewrite phases; Mary Johnson of T he Waite Group for coordi- nating the flow of materials among the participants; Bob Johnson for his cursor designs; and the unsung heroes and heroines in the realm of produc- tion- the people who turned the words, programs, and images into this book. Thank you all.

Reading notes: Hyphenated line breaks and spacing artifacts such as "we re" and "fo llowed" appear in the copy; spelling taken as printed. Heading and body reading order appears continuous.

Printed product names
BASIC · Altair
Languages
English
PDF page 7

Introduction With Midnight Madness we invite you to participate in a programming tour de force. The Microsoft BASIC version 2 series for the Macintosh makes it easier than ever before to create powerful yet flexible programs that take full advantage of the Mac's unique user interface and graphics capabilities. Running and studying the 17 programs in this book will not only

Reading notes: Source text ends mid-sentence, so the reading order continues beyond the supplied excerpt.

Printed product names
Midnight Madness · Microsoft BASIC version 2 · Macintosh
Languages
English
PDF page 8

MIDNIGHT MADNESS

x ii MIDN I GHT MADNES S enhance your skills as a programmer, it will also give you hours of pro- gramming pleasure. As the book's subtitle suggests, the programs in Midnight Madness are arranged in these three categories: utilities, games, and "other grand diversions." Utilities are tools that help you do a job easier or faster. Some of our utilities provide resources for your programming; others help orga- nize information. When you learn how a tool works, you can modify it to fit your needs or to add new capabilities. Games are toys. They're fun to play with and great to share with friends of all ages. There's more to them than that, though: Programming tricks found in these games can be used for many other sorts of programs as well. You can also make the games harder or more sophisticated, and add strategic as well as arcade features. Diversions combine the usefulness of utilities with the playful ex- ploration of games. They are "edutainment"-a blend of education and entertainment-and represent the growing variety of creative and unique applications that Microsoft BASIC and the Macintosh make possible. We're betting you'll find many others! Presenting the programs Now it's time to introduce our all-star cast of programs. We'll briefly de- scribe what each of the programs in the three categories does. The moons next to the program names indicate the general level of difficulty of the programming concepts involved: ) , is rather easy-the program code is short and straightforward, and the algorithms involved are not too complex; is intermediate- you will find longer code and more involved structures, and the algorithms and techniques will help you learn some advanced concepts you will need in building programs of your own; is somewhat difficult- but don't let this scare you - these pro- grams will become the stars in your collection, and will teach you tricks and techniques you may have thought weren't possible before.

Reading notes: Difficulty indicator symbols next to program names did not survive text extraction and cannot be read.

Printed product names
Midnight Madness · Microsoft BASIC · Macintosh
Languages
English
PDF page 9

IN TRODUCTION Utilities Games xiii Maclnterface, the first program in the book, lets you move graph- ics back and fort h between BASIC and applications like MacPaint via the Macintosh Clipboard. You can use the application of your choice to create the images, and then animate them with BASIC, or let BASIC create complex shapes to use with other applications. You can paste images to the Scrapbook and read them into other programs. ~ MacGrid makes it a snap to create any kind of graph paper you ..I want, varying the line intervals, heavy lines, and the overall size of the page. Great for math and science projects! ' MacGraph turns your data into bar, line, or pie charts, quickly and easily, with no complex formats or commands to learn. You will be able to plot business trends, or the results from your lab experi- ments, or your success with your diet. MacCursor is a powerful utility that lets you create custom mouse pointers, complete with "mask" and "hot spot." Now your mouse can wield a pencil or control a starship! ' MacConvert automates the conversion of programs from Micro- soft Macintosh BASIC 1.0 to the new version 2. It also aids con- version from other dialects of Microsoft BASIC. You w ill be able to have your old favorite programs running on the Mac in no time. MacAnimate explores the world of animation. It provides you with an editor for creating and modifying a series of images much like the frames of a strip of movie film, and a lso includes an animator that lets you control their motion. Now Mickey won't be the only mouse who can move across a screen. ' MacDart has a dart and target balloon that move at different speeds each time you throw. What 's more, it even includes the effect of gravity on your throw! You will be able to tune up your hand-eye coordination, and you don't have to worry about hitting passing strangers. Timing is everything with this game.

Reading notes: Possible OCR spacing artifacts in 'IN TRODUCTION' and 'w ill' and 'a lso'

Printed product names
Maclnterface · MacPaint · MacGrid · MacGraph · MacCursor · MacConvert · MacAnimate · MacDart
Languages
English
PDF page 10

xiv Diversions MIDNIGHT MADNES S '\ MacBandit provides a Las Vegas-style "one-armed bandit." You ~ drop your coins in the slot, the wheels spin, and with a bit of luck the Macintosh is stacking your winnings in neat little piles. This one is great for parties! ~ MacMouse features an animated mouse race complete with music. It's a good way to introduce young children to the Mac. , MacBall is a "break-out" game where placing a shot just right will reward you with a "chain reaction" of scoring. The algo- rithms show you how to re-create the rebound of the ball off the sides of the screen-a technique that will have you devising your own variations in no time at all. , MacGurkha is named for the intrepid paratroopers from Nepal. The challenge of this game is to guide your trooper past the bar- rage balloons into the jump zone. Not only will you learn techniques for moving objects, but you will also learn how to make animated objects in- teract with their environment. MacSpace brings real arcade excitement to the Mac. This game in- tegrates many of the features of the utility programs. It's all here: animation, a custom pointer, and complex graphics. Just about the only thing missing is that pointy-eared executive officer. Can you destroy the dreaded Klaxxon star cruisers before they get too close? '\ MacBuild is a "drawing construction set." With it, you can assem- ~ ble designs from our "prefab" shapes, and also design your own custom shapes. You will be able to design all sorts of interesting figures once you've entered this program. And if you don't like what you've built, you can always try building another. '\ MacOrgan explores the Mac's musical capabilities and turns your ~ keyboard into an organ with two octaves and three chords. In no time at all, you will be entertaining your friends with tuneful little ditties that show off the voices of the mighty Macintosh. MacCompose lets you express your musical ideas by placing notes on a staff and playing the resulting melody. While MacCom- pose is a more complex program than MacOrgan, it will give you hours of enjoyment as you explore the fundamentals of music composition.

Reading notes: Chapter heading 'Diversions' and page number 'xiv' appear before the headline; headline taken as 'MIDNIGHT MADNESS'

Printed product names
MacBandit · MacMouse · MacBall · MacGurkha · MacSpace · MacBuild · MacOrgan · MacCompose · Mac · Macintosh
Languages
English
PDF page 11

INTROD UCTION xvii Companion disk to Macintosh Midnight Madness To save you hours of typing in the programs-and the additional hours of finding those inevitable typos-Microsoft Press has created a special pro- gram disk for Macintosh Midnight Madness. The disk contains all17 pro- jects included in the book, plus additional programs containing animation sequences and cursor patterns. This disk is only available directly from Microsoft Press. To order, use the special bind-in card at the back of the book. If the card has already been used, send $19.95 (plus $1.00 per disk for domestic postage and han- dling charges, $2.00 for foreign orders) to: Microsoft Press, Box 97200, 10700 Northup Way, Bellevue, WA 98009 . Payment must be in U.S. funds, California residents must add 6.5% sales tax, and Washington residents 8.1%. You may pay by check or money order (payable to Microsoft Press) or by American Express, VISA or MasterCard; please include both your credit card number and expiration date. Allow 4 weeks for delivery.

Reading notes: Heading 'INTROD UCTION' may be a spacing artifact of 'INTRODUCTION'; 'xvii' is a page marker rather than a date.

Printed product names
Macintosh Midnight Madness
Printed prices
$19.95 · $1.00 · $2.00
Printed dates
xvii
Languages
English