← Apple II — A Touch of Applesoft BASIC

Apple II — A Touch of Applesoft BASIC

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

Apple®II A Touch of Applesoft BASIC 70 PLOT RND (1) * 40, RND (1) * 40 80 COUNT = COUNT + 1 90 IF COUNT < 50 THEN GOTO 40 Apple IIc, Apple IIe, Apple IIGS™.

The cover shows a bold Apple rainbow logo at upper left, a black label with the Apple II wordmark, a handwritten black signature with an underline and faint tan coffee-ring marks, and a blue framed screen of colorful horizontal and vertical bars on black with BASIC program lines printed at the bottom.

Reading notes: Signature above the screen is handwritten and not transcribed as text. Program lines at the bottom of the screen image are rendered in a pixel-style font; the line 70 wraps onto a second line showing '40', transcribed as continuation. Small fine print at the bottom right edge is too faint to read and was not transcribed.

Printed product names
Apple II · Apple IIc · Apple IIe
Languages
English
PDF page 1

Apple II A Touch of Applesoft BASIC 70 PLOT RND (1) * 40, RND (1) * 40 80 COUNT = COUNT + 1 90 IF COUNT < 50 THEN GOTO 40 Apple IIc, Apple IIe, Apple IIGS™.

A white cover with a rainbow Apple logo at upper left, a black-boxed 'Apple II' title beside 'A Touch of Applesoft BASIC', a black handwritten signature with underline, and a blue-bordered screen showing colorful horizontal and vertical bars above lines of BASIC code.

Reading notes: Handwritten signature near the top is not transcribed as text; it appears to read as a stylized signature only. The code lines are rendered in a pixel font on the screen and the line 70 wraps onto a second line showing '40'; reading order follows the printed lines. Faint brown stain marks around the signature are not text.

Printed product names
Apple II · Apple IIc · Apple IIe
Languages
English
PDF page 2

LIMITED W ARRANfY ON MEDIA AND REPIACEMENf I f you discover physical defects in Lhe manuals disLribuLed w ilh an Apple product o r in the media on which a software product is distrib- uted, Apple will replace the media o r manuals at no charge to you, provided you return the item to be replaced w ith proof of purchase to Apple o r an authorized Apple d ealer dur ing the 90-day period after you purch ased the software. In addition, Apple w ill repl ace d amaged soft- ware media and manuals for as long as the softwa re product is included in Apple's Media Exchange Program. While not an upgrade or update method, this program offers additional p rotection for up to two years or more from the date o f your original purchase. See your autho- rized Apple dealer for program coverage and details. In some countries the replacement period may be d ifferent; check with your authorized Apple dealer. ALL IMPLIED WARRANTIES ON THE MEDIA AND MANUAIS, INCLUDING IMPLIED W ARRANfIFS OF MERCHANfABIUlY AND FIT- NESS FOR A PARTIC ULAR PUR- POSE, ARE LIMITED IN DURATION TO NlNElY (90) DAYS FROM THE DATE OF THE OIUGlNAL RETAIL PURCHASE OF THIS PRODUCT. Even though Apple has tested the software and reviewed the docu- mentation, APPLE MAKES NO WAR- RANfY OR REPRESENfATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO SOFTWARE, ITS QUAUlY, PERFORMANCE, MER- CHANTABlLllY, OR FITNESS FOR A PARTICUIAR PURPOSE. AS A RESULT, THISSOFTWAREISSOLD "AS IS," AND YOU THE PUR- CHASER ARE ASSUMlNG THE ENflRE IUSKAS TO ITS QUALITY AND PERFORMANCE. . IN NO EVENf WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAi., INCIDENfAL, OR CONSE- QUENfIAL DAMAGES RESULTING FROM ANY DEFECT IN THE SOFT- WARE OR ITS DOCUMENTATION, even if advised o f the possibility of such damages. In particular, Apple shall have no liab il ity for any pro- grams or data stored in or used with Apple p roducts, including the costs of recover ing such programs or data. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLU- SIVE AND IN LIEU OF ALL OTHERS, Ol{AL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer , agent, or employee is author ized to make any modification, extension, or addition to this warranty. Some states do not allow the ex- clusion o r l imitation of implied warra nties o r liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state.

Reading notes: No image was supplied, so layout, column breaks and reading order are taken from the extracted copy and could not be checked against the scan. The headline is OCR-garbled ("W ARRANfY", "REPIACEMENf") and is shown here in corrected form; the printed form may differ. "IUSKAS" in the all-caps liability paragraph is probably "RISK AS" and is unverified. "Ol{AL" in the exclusion paragraph is probably "ORAL" and is unverified. "NlNElY" is probably "NINETY" and "MANUAIS" is probably "MANUALS"; these are unverified OCR readings. Several words are run together or split by OCR (e.g., "THISSOFTWAREISSOLD", "repl ace", "p rotection", "liab il ity", "recover ing"), and spacing around hyphenated line breaks (e.g., "autho-rized", "docu-mentation") is uncertain. Other OCR-noisy spans include "SPECIAi.", "QUAUlY", "MERCHANTABlLllY", "PARTICUIAR", "ASSUMlNG", "ENflRE" and "warra nties". A stray ". ." appears after "PERFORMANCE" in the all-caps disclaimer. The 90-day, 90-day and two-year periods are warranty durations, not printed dates, so they are not listed in printedDates.

Languages
English
PDF page 3

Apple II A Touch of Applesoft BASIC 70 PLOT RND (1) * 40, RND (1) * 40 80 COUNT = COUNT + 1 90 IF COUNT < 50 THEN GOTO 40

A red Apple logo sits at upper left above a striped band and the title, with a handwritten black signature above a grayscale screen image of overlapping horizontal and vertical bars on a dark background, with BASIC program lines printed in white at the bottom.

Reading notes: The handwritten signature (appears to read 'S. Wozniak' or similar) is not printed text and was not transcribed. Program lines in the lower screen image are rendered in a pixel-style font; the zeros may be slashed or dotted zeros and were read as 0. Reading order: title first, then signature, then screen image caption-style code lines.

Printed product names
Apple II · Applesoft BASIC
Languages
English
PDF page 4

ti APPLE COMPITTER, INC. © Copyright 1986, Apple Compute r, Inc., for a ll no n- L extual mate rial, graphics, figures, photographs, and all computer program lis li ngs o r code in any form, including o bject and source code. All rights reserved. Apple and Lhe Apple logo are registe red trademarks of Apple Compute r, Inc. Macintosh is a trademark o f Mcintosh Laboratories, Inc., and is being used with express pe rmission of its owner. Microsoft is a registe red trade- mark of Microsoft Corpo ration. POSTSCRIPT is a trade mark o f Adobe Systems Incorporated. ITC Garamond, ITC Avant Garde Gothic, and ITC Zapf Dingbats are registe red L rademarks of Internatio nal Typeface Corporatio n. Printed in Singapo re.

Reading notes: Several words have broken spacing and possible OCR errors such as 'ti', 'Compute r', 'Lhe', and 'Mcintosh', which may be misreadings of Macintosh and other terms. Reading order of the copyright and trademark notices is clear but some fragments are garbled.

Printed product names
Macintosh · POSTSCRIPT
Printed dates
1986
Languages
English
PDF page 5

Contents Preface vii What's a computer language? vii What's a program? viii Do you have to program? viii Why would you want to learn to program? viii Patience required ix How to get started ix And now-begin! x Session 1 Getting Started 1 The elementary stuff 2 Editing: program first aid 4 Summary and review 5 Session 2 Arithmetic and Variables 7 Arithmetic 8 Precedence: the order of calculations 10 Use parentheses to change precedence 10 Variables 11 Naming variables 13 Break a few rules 14 Summary and review 15 Contents m

Reading notes: Final 'Contents' line reads 'm', possibly a damaged or OCR-misread page reference.

Languages
English
PDF page 6

iv Contents Session 3 The Outside World 17 INPUT 18 Prompts 19 More editing: adding lines 20 Cleaning up wi th HOME 20 LIST 21 String va riables 22 Variables rules recap 23 Debugging 23 Summary and review 25 Session 4 Using the Disk and Other Devices 27 CofTlpute r memory 28 Files and catalogs 29 How to save programs 29 Reading the catalog and retrieving a program 31 Cleaning up 32 For printer owne rs: printing your listings 33 Using what you've learned 34 Summary and review 34 Session 5 Loops and Conditions 35 Loops 36 GOTO 36 Conditional branching w ith IF .. . THEN 37 Build ing o n the model 38 Re lational operato rs 38 Use REi\1 for remarks 41 Practi ce lime 41 Summary and review 42

Reading notes: Source text is a table of contents with a broken character spacing in places (e.g., 'CoflTlpute r', 'Re lational'), which may reflect OCR artifacts.

Languages
English
PDF page 7

Session 6 Graphics 43 Text and graphics 44 A 40-by-40 canvas 45 Seeing your listing again 46 Plotting colors with COLOR= 47 Using variables for plotting and coloring 47 Incrementing columns and rows 48 Drawing horizontal and vertical lines 48 A u niversal line-drawer 49 Random graphics 50 Summary and review 52 Session 7 Controlled Loops 53 FOR\NEXT 54 Using STEP with FOR\NEXT 56 Delay loops 57 A quick review 59 Experiment before you continue 60 Summary and review 60 Session 8 Programming With Style: Modular Progra mming 6 1 GOSUB\RETURN 62 END protects subroutines 63 Subroutines and organization 64 Multiple instructions on one line 65 Organizing your programs: one step at a time 66 The great checkbook balancing program challenge 67 One version of a checkbook balancing program 67 Summary and review 68 Contents v

Reading notes: Source is a table of contents; no headline, products, prices, or dates are printed as advertising copy. Page numbers and running header text are uncertain due to spacing artifacts such as 'Pro gramming' and 'mostly unreadable' fragments like 'u niversal' and 'Mod ular'.

Languages
English
PDF page 8

Session 9 Formatting Screens 69 Horizontal and vertical tabs 70 Prompt placement 73 Getting noticed: INVERSE and NORMAL 74 A text-centering algorithm 75 One solution to the centering problem 75 Summary and review 76 Session 10 Programming for People 77 A sordid history 78 People-program guidelines 79 Humanizing programs isn't easy 81 It gets easier 81 Where do you go from here? 81 Do it! 82 A parting word 83 Appendix A A Summary of Applesoft Instructions 85 Appendix B Reserved Words 99 Glossary 101 Index 107 vi Contents

Reading notes: Source appears to be a table of contents; no advertised products, prices, or dates are present. Primary heading not clearly identifiable from the supplied copy.

Languages
English
PDF page 9

Preface This tutorial will help you get started writing simple Applesoft BASIC computer programs on your Apple® 11 computer. You won't learn all there is to know about Applesoft BASIC from just this tutorial; but by the time you finish these ten sessions, you'll be able to decide whether you want to continue learning about programming. 'fhe product training disk that came with your computer gives you a brief introduction to Applesoft; you might want to work with that disk before you read this tutorial. What's a computer language? A computer language is like the languages that people speak. It has a vocabulary and a syntax-word order is important and spelling counts. Your Apple computer speaks a language called Applesoft BASIC. (It speaks other languages, too, but they aren't bu ilt into the computer; you buy them on disks.) The compute r reads the BASIC instructions you type from the keyboard, and then it does exactly what it's told. Luckily, it's easier to learn BASIC than a human language because BASIC has far fewer words, and its grammar is usually very straightfo rward. •!• BASIC by any other name ..• There are many variations on the BASIC computer language. But in this little tutorial the terms BASIC, Applesofl BASIC, and Applesofl all refer to the same thing. What's a computer language? vii

Reading notes: OCR spacing and damaged characters in 'fhe' and 'Applesofl' readings Heading 'Preface' treated as section title; no primary headline confirmed

Printed product names
Apple® 11 · Applesoft BASIC · Applesoft
Languages
English
PDF page 10

What's a program? Computer programming is writing instructions for your computer. The entire set of instructions you give to a computer to make it do something is the program. Imagine that your computer is a pet you want to train. You can't talk to your pet in the same way you talk with a human; you have to use a limited vocabulary to tell it exactly what to do. If you wanted it to do a series of things, you would give it a set of instructions, one instruction at a time. For instance, suppose you want your pet to sit, lie down, and roll over. You'd do it like this: "King, sit. 11 (King sits.) "King, lie down." (King lies down.) "King, roll over. 11 (King rolls ove r.) "Good dog!" (King wags tail.) Of course your Apple won't sit, lie down, or roll over, but it will do a lot of thi ngs for you if you give it instructions in a systematic and logical order. You use the same kind of directness, simplicity, and order in computer programming as in pet training (except that you don't have to praise your computer when it does what you tell it). Do you have to program? You don't have to write programs to use your computer. Thousands of programs have already been written for your Apple-programs for word processing, financial analysis, computerized file cabinets, and dozens of other applications. You just put a disk with programs on it into your disk drive and turn on your computer. Why would you want to learn to program? first of all, you might find programming to be a lot of fun. When you learn to program, you discover that your Apple isn't really magical (although it certainly seems that way at times); it's just following the instructions that you give it. When you program your compute r, you make it do what you want it to do-you get to create you r own magic. Second, you learn a lot about how a computer works as you learn to v iii Preface

Reading notes: Page header 'Preface' and page marker 'v iii' appear at the end of the source text Dialogue examples with quoted pet-training instructions appear in the copy

Printed product names
Apple
Languages
English
PDF page 11

program it. That gives you a better understanding of what your computer can and can't do. Finally, you might find that programming is something that really intrigues you and stimulates your own creativity in ways you'd never thought about. You might eventually decide to become a professional programmer. You can create simple entertainment, educational, and business programs with just an elementary set of instructions. For example, you can write very effective e ducational games in Applesoft BASIC, or even home budgeting and checkbook programs to keep your finances in order. Writing your own program is an option available on your Apple. While you're likely to find programming useful and interesting, you don't have to learn how to program to use your computer. But if you do want to program, you'll find Applesoft BASIC a great place to start. Patience required Learning to program is a little like learning how to become a chef. You've got to be an experie nced chef to pull off great seven-course meals; but the essentials of the craft begin with me lting butter, turning an egg, and so on. And the payoff is similar, too. You don't have to be a master chef to enjoy a homemade omelette (or amaze your friends with your culinary prowess). From time to time, you'll just have to be patient-but only for a little while. Have faith. How to get started Applesoft is built into your Apple II computer. But you need to prepare your computer to store the programs you create so that you can use them again. (You'll learn more about storing your programs onto disk in Session 4.) Here are the steps to take to begin your study of Applesoft BASIC: 1. Read your Apple computer owner's guide first. It contains lots of valuable information about the computer that you'll need to know before you can begin to use Applesoft. Pay special attention to the section on formatting disks. You'll need at least one formatted disk before you can start. 2. Insert the u tilities disk that came with your computer into the disk drive, close the disk drive door, and turn on the computer. (See your owner's manual for instructions.) Choose the Applesoft BASIC o ption and press Return; you should see this symbo l: J. 3. Remove the disk from the drive and replace it with a formatte d disk. Be sure to close the drive door. How to get started ix

Reading notes: Some words are split across line breaks with spacing artifacts (e.g., 'e ducational', 'experie nced'). Page-number fragment 'ix' appears at the end, reading order uncertain.

Printed product names
Applesoft BASIC · Apple II
Languages
English