sd-8516_user_s_guide
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| sd-8516_user_s_guide [2026/02/21 10:16] – appledog | sd-8516_user_s_guide [2026/02/21 10:20] (current) – appledog | ||
|---|---|---|---|
| Line 15: | Line 15: | ||
| Type this right now (press ENTER after the line): | Type this right now (press ENTER after the line): | ||
| - | | + | <codify BASIC> |
| + | ? "HELLO WORLD" | ||
| + | </ | ||
| The computer should immediately display: | The computer should immediately display: | ||
| Line 23: | Line 25: | ||
| Now try: | Now try: | ||
| - | | + | <codify BASIC> |
| + | ? 42 + 8 | ||
| + | </ | ||
| It prints 50. You can do math right away, no program needed. This is called **direct mode,** directly entering commands on the terminal. | It prints 50. You can do math right away, no program needed. This is called **direct mode,** directly entering commands on the terminal. | ||
| Line 34: | Line 38: | ||
| Now carefully type these lines (press ENTER after each one): | Now carefully type these lines (press ENTER after each one): | ||
| - | | + | <codify BASIC> |
| - | 20 GOTO 10 | + | 10 PRINT "HELLO WORLD" |
| + | 20 GOTO 10 | ||
| + | </ | ||
| Type **RUN** and press ENTER. | Type **RUN** and press ENTER. | ||
| Line 48: | Line 54: | ||
| You don't have to type lines in order, the computer will sort them for you automatically. Try this: | You don't have to type lines in order, the computer will sort them for you automatically. Try this: | ||
| - | | + | <codify BASIC> |
| - | 10 ? "BUT LINE 10 RUNS FIRST" | + | 20 ? "LINE 20 COMES FIRST ANYWAY!" |
| + | 10 ? "BUT LINE 10 RUNS FIRST" | ||
| + | </ | ||
| **RUN** | **RUN** | ||
| Line 67: | Line 75: | ||
| Try this in direct mode: | Try this in direct mode: | ||
| - | | + | <codify BASIC> |
| - | + | LET A = 25 | |
| - | ? A | + | |
| + | ? A | ||
| + | </ | ||
| It prints 25. | It prints 25. | ||
| Line 75: | Line 85: | ||
| Now a tiny counting program: | Now a tiny counting program: | ||
| - | | + | <codify BASIC> |
| - | 20 ? A | + | 10 LET A = 1 |
| - | 30 LET A = A + 1 | + | 20 ? A |
| - | 40 IF A <= 10 THEN GOTO 20 | + | 30 LET A = A + 1 |
| - | 50 ? "BLAST OFF!" | + | 40 IF A <= 10 THEN GOTO 20 |
| + | 50 ? "BLAST OFF!" | ||
| + | </ | ||
| **RUN** | **RUN** | ||
| Line 110: | Line 122: | ||
| Add these lines to make a simple checker: | Add these lines to make a simple checker: | ||
| - | | + | <codify BASIC> |
| - | 50 IF E <> 42 THEN ? "TRY AGAIN!" | + | 40 IF E = 42 THEN GOTO 70 |
| - | 60 GOTO 10 | + | 50 IF E <> 42 THEN ? "TRY AGAIN!" |
| - | 70 PRINT "YOU FOUND THE ANSWER!" | + | 60 GOTO 10 |
| + | 70 PRINT "YOU FOUND THE ANSWER!" | ||
| + | </ | ||
| **RUN** and try a guess until you hit 42. (42 is a reference to the Hitchhiker' | **RUN** and try a guess until you hit 42. (42 is a reference to the Hitchhiker' | ||
| Line 158: | Line 172: | ||
| Here is an example program: | Here is an example program: | ||
| - | | + | <codify BASIC> |
| - | 20 PRINT A | + | 10 LET A = 5 |
| - | 30 LET A = A - 1 | + | 20 PRINT A |
| - | 40 IF A > 0 THEN GOTO 20 | + | 30 LET A = A - 1 |
| - | 50 PRINT " | + | 40 IF A > 0 THEN GOTO 20 |
| + | 50 PRINT " | ||
| + | </ | ||
| Next, type **RUN.** You will see a countdowns to 1, then " | Next, type **RUN.** You will see a countdowns to 1, then " | ||
| Line 173: | Line 189: | ||
| Here is an example of a GOSUB helper function: | Here is an example of a GOSUB helper function: | ||
| - | | + | <codify BASIC> |
| - | 20 LET A = 2 | + | 10 REM GOSUB SQUARE DEMO |
| - | 30 GOSUB 1000 | + | 20 LET A = 2 |
| - | 40 LET A = 3 | + | 30 GOSUB 1000 |
| - | 50 GOSUB 1000 | + | 40 LET A = 3 |
| - | 60 LET A = 4 | + | 50 GOSUB 1000 |
| - | 70 GOSUB 1000 | + | 60 LET A = 4 |
| - | 80 LET A = 5 | + | 70 GOSUB 1000 |
| - | 90 GOSUB 1000 | + | 80 LET A = 5 |
| - | 100 GOTO 9000 | + | 90 GOSUB 1000 |
| - | 9000 REM END | + | 100 GOTO 9000 |
| + | 9000 REM END | ||
| - | | + | 1000 REM THIS HELPER FUNCTION WILL PRINT THE SQUARE OF A |
| - | 1010 PRINT A * A | + | 1010 PRINT A * A |
| - | 1020 RETURN | + | 1020 RETURN |
| + | </ | ||
| After you enter this program and type RUN, you will see the result 4, 9, 16, 25. As you can see, every time the program calls **GOSUB 1000,*** it runs the code at LINE NO 1000 and then **RETURN**s to continue in the main program. | After you enter this program and type RUN, you will see the result 4, 9, 16, 25. As you can see, every time the program calls **GOSUB 1000,*** it runs the code at LINE NO 1000 and then **RETURN**s to continue in the main program. | ||
| Line 199: | Line 217: | ||
| **NEW** then type: | **NEW** then type: | ||
| - | 10 ? "" | + | <codify BASIC> |
| + | 10 PRINT "" | ||
| 20 GOSUB 900 : REM SHOW INSTRUCTIONS | 20 GOSUB 900 : REM SHOW INSTRUCTIONS | ||
| 30 A=1 : B=100 | 30 A=1 : B=100 | ||
| Line 244: | Line 263: | ||
| 940 RETURN | 940 RETURN | ||
| 5000 REM END | 5000 REM END | ||
| + | </ | ||
| - | Ty to **RUN** this program and play a few rounds! The subroutines make it modular. If you want fancier win/lose messages later, just edit those GOSUB lines. | + | Try to **RUN** this program and play a few rounds! The subroutines make it modular. If you want fancier win/lose messages later, just edit those GOSUB lines. |
| **Negative Numbers in Action** | **Negative Numbers in Action** | ||
| Line 251: | Line 271: | ||
| Since negatives are fully supported, try tweaking the game or make a countdown timer: | Since negatives are fully supported, try tweaking the game or make a countdown timer: | ||
| + | <codify BASIC> | ||
| 10 PRINT " | 10 PRINT " | ||
| 20 LET A = 0 | 20 LET A = 0 | ||
| Line 257: | Line 278: | ||
| 50 IF A >= - 10 THEN GOTO 30 | 50 IF A >= - 10 THEN GOTO 30 | ||
| 60 PRINT "BLAST OFF INTO NEGATIVE SPACE!" | 60 PRINT "BLAST OFF INTO NEGATIVE SPACE!" | ||
| + | </ | ||
| === WHILE, DO-WHILE, and FOR-NEXT Part I | === WHILE, DO-WHILE, and FOR-NEXT Part I | ||
| Line 305: | Line 326: | ||
| Example: Countdown from 10 to 0, check at top. | Example: Countdown from 10 to 0, check at top. | ||
| - | |||
| <codify BASIC> | <codify BASIC> | ||
sd-8516_user_s_guide.1771669014.txt.gz · Last modified: by appledog
