Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language GRAFORTH

Date:05/18/05
Author:Mike Gogulski
URL:n/a
Comments:2
Info:n/a
Score: (2.86 in 29 votes)
( GRAFORTH version of 99 Bottles )
( By Mike Gogulski <mike@gogulski.com> 21 March 2005 )
( GRAFORTH is a graphics-oriented FORTH for the Apple ][ series computers )
( Tested under DOS 3.3 under Apple //e ROM under MESS 0.94b under Windows 2000 )
 
: DRINK
0 99 DO
I
DUP . PRINT "  bottle(s) of beer on the wall, " CR
DUP . PRINT "  bottle(s) of beer! " CR
PRINT " Take one down, pass it around, " CR
1 -
. PRINT "  bottle(s) of beer on the wall! " CR
-1 +LOOP
;
 
DRINK

Download Source | Write Comment

Alternative Versions

Comments

>>  asfdsdf said on 10/06/08 04:09:15

asfdsdf in stead of " Take one down, pass it around, "
should be " Take one down and pass it around, "


the first and third CR will produce extra not wanted carriage returns, like:

99 bottles of beer on the wall,
99 bottles of beer.
Take one down and pass it around,
98 bottles of beer on the wall.


>>  Robert Dell said on 04/04/10 15:56:32

Robert Dell enclosed is the program working in gforth

( GRAFORTH version of 99 Bottles )
( By Mike Gogulski <mike@gogulski.com> 21 March 2005 )
( GRAFORTH is a graphics-oriented FORTH for the Apple ][ series computers )
( Tested under DOS 3.3 under Apple //e ROM under MESS 0.94b under Windows 2000 )

: DRINK
1 99 DO
I
. ." bottle(s) of beer on the wall, " CR
r@
. ." bottle(s) of beer! " CR
r@
." Take one down, pass it around, " CR
1 -
. ." bottle(s) of beer on the wall! " CR
r@
-1 +LOOP
;

CR
DRINK

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!

Name:

eMail:

URL:

Security Code:
  
Comment: