← Apple II A Touch of Applesoft BASIC 1986

Apple II A Touch of Applesoft BASIC 1986

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

A cover-style page with a rainbow Apple logo at upper left, a black label reading Apple II beside the title, and a large blue-bordered screen showing colorful horizontal and vertical bars on black with BASIC program lines printed across the bottom of the screen.

Reading notes: Line 70 wraps onto a second line showing the number 40, which is part of the same statement; reading order follows the screen layout. The ® symbol after Apple and the trademark ™ after IIGS are small and read as likely registration marks. Screen text is pixel-style and slightly distorted, so exact characters such as the zeros and the spacing in the program lines are approximate.

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 colorful Apple II screen display of randomly placed multicolored horizontal and vertical bars on a black field framed by blue, with BASIC program lines printed at the bottom, beside the Apple rainbow logo at upper left.

Reading notes: Program line '70 PLOT RND (1) * 40, RND (1) * 40' wraps onto a second line showing '40' which may be a line wrap rather than separate text. The trademark symbol after IIGS is rendered as superscript and transcribed as ™.

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

The image is a entirely blank white page with no visible artwork, layout elements, or text.

Reading notes: No visible text found; the page appears blank.

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 cover with the Apple logo at upper left and a striped title bar above the title, over a photo of a colorful blocky bar-and-line graphics display on a monitor with BASIC program lines printed at the bottom.

Reading notes: Program lines at bottom of the screen photo are partly overlapped by the wrapped line '40' under 'PLOT RND (1) * 40, RND (1) *'; reading order follows the wrapped line placement. The registered trademark symbol after 'Apple' is small and may be ambiguous.

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

ti APPLE COMPUfER, INC. ©Copyright 1986, Apple Computer, Inc., for all non- textual material, graphics, figures, photographs, and all computer program listings or code in any form, including object and source code. All rights reserved. Apple and the Apple logo are registered trademarks of Apple Computer, Inc. Macintosh is a trademark of Mcintosh Laboratories, Inc., and is being used with express permission of its owner. Microsoft is a registered trade- mark of Microsoft Corporation. POSTSCRIPT is a trademark of Adobe Systems Incorporated. ITC Garamond, ITC Avant Garde Gothic, and ITC Zapf Dingbats are registered trademarks of International Typeface Corporation. Printed in Singapore.

Reading notes: Headline not clearly identifiable as a primary heading; the opening line 'APPLE COMPUTER, INC.' is treated as a masthead and headline set to null. 'Mcintosh Laboratories' appears as printed, possibly a misspelling of 'McIntosh' in the source.

Printed product names
Apple · Macintosh · Microsoft · POSTSCRIPT · ITC Garamond · ITC Avant Garde Gothic · ITC Zapf Dingbats
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 S 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 1S Contents lti

Reading notes: OCR-style errors such as 'S' for '5' and 'lti' for 'iii' in the table of contents; page numbers uncertain No primary heading identified; the text is a table of contents for a programming book

Languages
English
PDF page 6

iv Contents Session 3 The Outside World 17 INPUT 18 Prompts 19 More editing: adding lines 20 Cleaning up with l lOME 20 LIST 21 Stri ng va riables 22 Va riables ru les recap 23 Debugging 23 Summary and review 25 Session 4 Using the Disk and Other Devices 27 Compute r me mory 28 Files and catalogs 29 How to save programs 29 Reading the catalog and retrieving a program 31 Cleaning up 32 For printer owners: 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 with ff ... THEN 37 Building on the model 38 Relational operators 38 Use R.EJ'vl for remarks 41 Practice time 41 Summary and review 42

Reading notes: Source text is a table of contents with OCR-damaged characters such as 'Stri ng va riables' and 'Va riables ru les recap' Ambiguous OCR of 'Use R.EJ'vl for remarks' and 'ff ... THEN' likely represents REM and IF

Languages
English
PDF page 7

Session 6 Graphic s 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 Programming 61 GOSUB\RETURN 62 END protects subroutines 63 Subroutines and organizatio n 64 Multiple instru ctio ns on one line 65 Organizing your programs: one step at a time 66 The great checkbook balancing program challenge 67 One versio n o f a checkbook balancing program 67 Summary and revie w 68 Contents v

Reading notes: Source appears to be a table of contents rather than advertising copy; no headline or advertised products identified. Some session titles contain OCR-like spacing artifacts (e.g., 'Graphic s', 'u niversal', 'instru ctio ns', 'revie w') preserved as printed.

Languages
English
PDF page 8

Session 9 Formatting Scree ns 69 Horizontal and vertical tabs 70 Prompt placement 73 Getting noticed : INVERSE and NORMAL 74 A text-ce nte ring algorithm 75 One solutio n to the centering problem 75 Summary and review 76 Session 10 Programming for People 77 A sordid histo ry 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 8 Reserved Words 99 Glossary 101 Index 107 vi Contents

Reading notes: Several words are broken by spacing artifacts (e.g., 'Scree ns', 'nte ring', 'solutio n'), likely from extraction. Source is a table of contents with page numbers rather than advertising copy; no headline or product, price, or date information is present.

Languages
English
PDF page 9

Preface This tutorial will help you get started writing simple Applesoft BASIC computer programs on your Apple® II 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. The 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 built into the computer; you buy them on disks.) The computer 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 straightforward. •:• BASIC by any other name ... There are many variations on the EASIC computer language. But in this little tutorial the terms BASIC, Applesoft BASIC, and Applesofl all refer to the same thing. What's a computer language? vii

Reading notes: OCR reads 'EASIC' and 'Applesofl' in the final note, likely misprints for 'BASIC' and 'Applesoft'

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

What's a program? Computer programming is wriLing instru ctions 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 pct 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 insLruction 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." (King sits.) "King, lie down. " (King lies down.) "King, roll over. " (King rolls over.) "Good dog!" (King wags tail.) Of course your Apple won't sit, lie down, or roll over, but it will do a lot of things for you if you give it insLruclions 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 w ith programs on i t into your disk d rive and turn on your computer. Why would you want to learn to program? First o f 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 computer, you make it do what you want it to do--you get to create your own magic. Second, you learn a lot about how a computer works as you learn to viii Preface

Reading notes: Several words are damaged by line breaks or character errors, e.g. 'wriLing', 'insLruction', 'insLruclions'. Page header 'viii Preface' appears at the end of the text and may not belong to the reading order.

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 educational 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 g reat place to start. Patience required Learning to program is a little like learning how to become a chef. You've got to be an experienced chef to pull off great seven-course meals; but the essentials of the craft begin with melting 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 the m 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 utilities disk that came with your computer into the disk drive, close the disk d rive door, and turn on the computer. (See your owner's manual for instru ctions.) Choose the Applesoft BASIC option and press Return; you should see this symbol: ]. 3. Remove the disk from the drive and replace it with a formatted disk. Be sure to close the drive door. How to get started ix

Reading notes: Running headers and page-break text (e.g., 'How to get started ix') may affect reading order.

Printed product names
Applesoft BASIC · Apple II · Apple
Languages
English