- TCL 99bottles
- 16 Sep 2010 11:24:56 pm
- Last edited by _player1537 on 16 Sep 2010 11:38:38 pm; edited 2 times in total
Recently found the TCL shell on alberhtro's server, so I started playing with it. In less than 20 minutes, I had this beauty written out
Code:
I'll be adding a check to see if it is the last bottle, and fix the pluralization (or lack there-of)
Code:
proc 99bottles {} {
for { set i 99 } {$i > 0} {incr i -1} {
puts "$i bottles of beer on the wall!"
puts "$i bottles of beer!"
puts "Take one down, pass it around!"
set a [expr $i -1]
if {$a > 1} {puts "$a bottles of beer on the wall!" }
if {$a == 1} {puts "1 bottle of beer on the wall!" }
after 500
puts ""
}
puts "No bottles of beer on the wall!"
}
I'll be adding a check to see if it is the last bottle, and fix the pluralization (or lack there-of)