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 Mouse 83

(more modern and powerful)

Date:11/24/07
Author:Lee Bradley
URL:http://primepuzzle.com/
Comments:0
Info:http://en.wikipedia.org/wiki/Mouse_%28programming_language%29
Score: (2.67 in 3 votes)
~ 99bot.mse - 3/13-16,19,20/2007 4/30/2007 - lrb

~ This is a 99 bottles of beer program in Mouse-83

~ Original version by Peter Grogono in "Mouse: A Language for
~ Microcomputers", Byte Magazine, July 1979, pp. 198 ff. and later revised
~ by David G. Simpson

"!Enter delay value [100,800] ? "?D:"!"

("How many verses? (99 max 0 to quit) "?s:"!"s.^100s.-[#V,s.;])

$V 1%[ ~ play a verse
 #N,1%;#B,1%;#W;",!"
 #N,1%;#B,1%;".!"
 #F;"!"
 #N,1%1-;#B,1%1-;#W;".!!"
 #D;
 #V,1%1-;
 ]@

$B " green bottle"1%1=0=["s"]" of Irish beer"@

$W " on the wall"@

$F "If one of those green bottles of Irish beer should happen to fall ..."@

$N ~ print bottle count in English
1%u:0w:
1%9>[
 1%10/w:1%10\v:
 w.1=[
  v.0=["Ten"@]
  v.1=["Eleven"@]
  v.2=["Twelve"@]
  v.3=["Thirteen"@]
  v.4=["Fourteen"@]
  v.5=["Fifteen"@]
  v.6=["Sixteen"@]
  v.7=["Seventeen"@]
  v.8=["Eighteen"@]
  v.9=["Nineteen"@]
  ]
 w.9=["Nine"]
 w.8=["Eigh"]
 w.7=["Seven"]
 w.6=["Six"]
 w.5=["Fif"]
 w.4=["For"]
 w.3=["Thir"]
 w.2=["Twen"]
 "ty"v.0=[@]"-"v.u:
 ]
u.9=[w.["n"]w.0=["N"]"ine"@]
u.8=[w.["e"]w.0=["E"]"ight"@]
u.7=[w.["s"]w.0=["S"]"even"@]
u.6=[w.["s"]w.0=["S"]"ix"@]
u.5=[w.["f"]w.0=["F"]"ive"@]
u.4=[w.["f"]w.0=["F"]"our"@]
u.3=[w.["t"]w.0=["T"]"hree"@]
u.2=[w.["t"]w.0=["T"]"wo"@]
u.1=[w.["o"]w.0=["O"]"ne"@]
u.0=["No"@]

$D ~ delay
D.w:(w.^D.v:(v.^v.1-v:)w.1-w:)@

Download Source | Write Comment

Alternative Versions

Comments

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: