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 AutoHotkey

(w/ Notepad)

Date:11/19/06
Author:Jonny
URL:n/a
Comments:1
Info:http://www.autohotkey.com/
Score: (2.82 in 11 votes)
SetKeyDelay,0
Run,notepad
WinWaitActive,Untitled - Notepad

Loop 99
{
  Send,% 100-A_Index . " bottle" . IsPlural(A_Index) . " of beer on the wall,`n"
       . 100-A_Index . " bottle" . IsPlural(A_Index) . " of beer.`n"
       . "Take one down and pass it around,`n"
       . IsEnd(A_Index) . " bottle"
       . IsPlural(A_Index+1) . " of beer on the wall.`n`n"
}

Send,No more bottles of beer on the wall, no more bottles of beer.`n
Send,Go to the store and buy some more, 99 bottles of beer on the wall.
return

IsPlural(iter) {
  If iter != 99
    ReturnVal = s
  return ReturnVal
}

IsEnd(iter) {
  If iter = 99
    ReturnVal = No more
  Else
    ReturnVal := 99 - iter
  return ReturnVal
}

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
Shows a GUI with the song displayed.Erik08/27/080

Comments

>>  Boris Brodski said on 05/06/08 11:12:23

Boris Brodski Great! You could improve your performance by using clipboard and pasting text into notepad :-)

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: