Language AppleSoft
Date: | 04/20/05 |
Author: | Anonymous |
URL: | n/a |
Comments: | 7 |
Info: | n/a |
Score: | ![]() |
0 REM ************************ 1 REM ** 99 BOTTLES OF BEER ** 2 REM ** APPLESOFT VERSION ** 3 REM ** BY LEE FASTENAU ** 4 REM ************************ 10 TEXT : HOME 20 FOR Z = 99 TO 1 STEP - 1 30 A = Z: GOSUB 1000 40 PRINT " ON THE WALL." 50 GOSUB 1000 60 PRINT "." 70 GOSUB 2000 80 A = Z - 1: GOSUB 1000 90 PRINT " ON THE WALL." 100 NEXT 110 END 1000 IF A < 1 THEN A$ = "NO MORE": GOTO 1020 1010 A$ = STR$ (A) 1020 A$ = A$ + " BOTTLE" 1030 IF A < > 1 THEN A$ = A$ + "S" 1040 A$ = A$ + " OF BEER" 1050 PRINT A$; 1060 RETURN 2000 A$ = "TAKE" 2010 IF A > 1 THEN A$ = A$ + " ONE": GOTO 2030 2020 A$ = A$ + " IT" 2030 A$ = A$ + " DOWN, PASS IT AROUND." 2040 PRINT A$ 2050 RETURN
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments
Applesoft's PRINT statement is much more versatile than you give credit.
By combining lines 1040 and 1050 into 1040 PRINT A$;" OF BEER";
and lines 2030 and 2040 into 2040 PRINT A$;" DOWN AND PASS IT AROUND"
you have not made your program any less readable, but you have made
it shorter and faster (by less executed statements and fewer garbage
collections).
You forgot to send someone to the store to buy some more!
immediately impressed by your 6502 skills (my favorite processor EVER).
Please forgive me if the following questions make me an annoying butthole.
Why would a person with your obvious talents go through the trouble of
submitting a clearly sub-optimal and incomplete entry when a few extra
minutes of your time would have easily nailed it? Don't students, hobbyists,
and historians who come here looking for code examples deserve correct,
efficient, complete examples? Don't you want your name on a program (even a
trivial one) that you can be proud of?
If you feel that I'm over-reacting, please accept my apology.
setting me straight, sincerely.