99 Bottles of Beer/Shell: Difference between revisions

Content added Content deleted
(AutoHotkey)
(autoit)
Line 40: Line 40:
ExitApp</lang>
ExitApp</lang>


Fast and Short
Fast and Short:
<lang AutoHotkey>b=99
<lang AutoHotkey>b=99
Loop, %b% {
Loop, %b% {
Line 60: Line 60:
GuiClose:
GuiClose:
ExitApp</lang>
ExitApp</lang>

=={{header|AutoIt}}==
<lang AutoIt>


local $bottleNo=99
local $lyrics=" "

While $bottleNo<>0
If $bottleNo=1 Then
$lyrics&=$bottleNo & " bottles of beer on the wall" & @CRLF
$lyrics&=$bottleNo & " bottles of beer" & @CRLF
$lyrics&="Take one down, pass it around" & @CRLF
Else
$lyrics&=$bottleNo & " bottles of beer on the wall" & @CRLF
$lyrics&=$bottleNo & " bottles of beer" & @CRLF
$lyrics&="Take one down, pass it around" & @CRLF
EndIf
If $bottleNo=1 Then
$lyrics&=$bottleNo-1 & " bottle of beer" & @CRLF
Else
$lyrics&=$bottleNo-1 & " bottles of beer" & @CRLF
EndIf
$bottleNo-=1
WEnd
MsgBox(1,"99",$lyrics)
</lang>

Easier to read output to Console:
<lang AutoIt>
$bottles = 99
$lyrics1 = " bottles of beer on the wall. "
$lyrics2 = " bottles of beer. Take one down and pass it around. "

For $i = $bottles To 1 Step -1
If $i = 1 Then
$lyrics1 = " bottle of beer on the wall. "
$lyrics2 = " bottle of beer. Take one down and pass it around. "
$lyrics3 = " Go to the store and get some more! No bottles of beer on the wall!"
ConsoleWrite($bottles & $lyrics1 & $bottles & $lyrics2 & $lyrics3 & @CRLF)
Else
ConsoleWrite($bottles & $lyrics1 & $bottles & $lyrics2 & $bottles - 1 & $lyrics1 & @CRLF)
$bottles -= 1
EndIf
Next
</lang>



=={{header|Batch File}}==
=={{header|Batch File}}==