Language Sinclair ZX-Spectrum Basic
(Pre-defined functions in the early 80ies)
Date: | 08/04/05 |
Author: | Mirko Mönninghoff |
URL: | n/a |
Comments: | 4 |
Info: | http://www.worldofspectrum.org |
Score: | ![]() |
10 REM 99 bottles of beer 20 REM Sinclair ZX-Spectrum Version 30 REM by Mirko Moenninghoff 100 DEF FN n$(b)="no more" AND NOT b 110 DEF FN m$(b)=(STR$ b) AND b 120 DEF FN o$(b)="s" AND (b>1) 130 DEF FN b$(b)=FN m$(b)+FN n$(b) 140 DEF FN p$(b)=FN o$(b)+("s" AND NOT b) 150 FOR i=99 TO 0 STEP -1 160 LET x$=FN b$(i) 170 IF x$(1)="n" THEN LET x$(1)="N" 180 PRINT x$; 190 PRINT " bottle";FN o$(i);" of beer on the wall, "'FN b$(i);" bottle";FN p$(i);" of beer." 200 IF NOT i THEN GO TO 300 210 PRINT "Take one down"'"and pass it around, "; 220 PRINT FN b$(i-1);" bottle";FN p$(i-1);" of beer on the wall." 230 PRINT 240 NEXT i 300 PRINT "Go to the store and buy some more, 99 bottles of beer on the wall."
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
in 16 KB Ram you could Program in BASIC, PASCAL and COBOL
hoo haa
Raj
I am Speccy fan since 1983...
I beautyfied the ZX version, mostly by removing ';' end line 210 and making it "a" store to go to since that fits better in 32 chars which in the length of one line in ZX Spectrum standard char.
the POKE is for smooth page scrolling.
And the 'pause' is getting shorter the more they drink (littl' joke)
10 REM 99 bottles of beer
20 REM Sinclair ZX-Spectrum Version
30 REM by Mirko Moenninghoff,'beautyfied' by Crisis13
100 DEF FN n$(b)="no more" AND NOT b
110 DEF FN m$(b)=(STR$ b) AND b
120 DEF FN o$(b)="s" AND (b>1)
130 DEF FN b$(b)=FN m$(b)+FN n$(b)
140 DEF FN p$(b)=FN o$(b)+("s" AND NOT b)
150 FOR i=99 TO 0 STEP -1
160 LET x$=FN b$(i)
170 IF x$(1)="n" THEN LET x$(1)="N"
180 PRINT x$;
190 PRINT " bottle";FN o$(i);" of beer on the wall, "'FN b$(i);" bottle";FN p$(i);" of beer."
200 IF NOT i THEN GO TO 300\#013210 PRINT "Take one down"'"and pass it around, "
220 PRINT FN b$(i-1);" bottle";FN p$(i-1);" of beer on the wall."
230 PRINT
240 PAUSE 500-i*5
250 POKE 23692,-1
260 NEXT i
300 PRINT "Go to a store and buy some more 99 bottles of beer on the wall."
310 PAUSE 1500
320 RUN
in line 200 you see \#013210
remove the \#013 and FREE line 210 in this way
its Crisis time again