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 Purebasic

(Musical Version)

Date:11/02/06
Author:Gary Willoughby (Kale)
URL:http://pb-beginners.co.uk
Comments:0
Info:http://www.purebasic.com
Score: (3.00 in 40 votes)
Procedure PlaySong(Music.s, Duration)
	For x.l = 1 To Len(Music)
		Select Mid(Music, x, 1)
			Case "A" : Beep_(220, Duration)
			Case "D" : Beep_(147, Duration)
			Case "E" : Beep_(165, Duration)
			Case "F" : Beep_(185, Duration)
			Case "G" : Beep_(196, Duration)
			Case "0" : Delay(Duration)
		EndSelect
	Next x
EndProcedure

OpenConsole()
a$ = " bottle(s) of beer" : ConsoleTitle("99" + a$) : c$ = " on the wall" : ClearConsole()
For b = 99 To 1 Step -1
	PrintN(" " + Str(b) + a$ + c$ + ",") : PlaySong("GGGDDDGGGG00", 125)
	PrintN(" " + Str(b) + a$ + ".") : PlaySong("AAAEEEA0000", 125)
	PrintN(" Take one down, pass it around,") : PlaySong("GFFFFFFFFFF00", 125)
	PrintN(Chr(32) + Str(b - 1) + a$ + c$ + Chr(46)) : PlaySong("DDDDEFGGGG00", 125)
	PrintN(Chr(32))
Next b
CloseConsole()
End

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
GUI versionAnonymous04/20/051
standard versionPhilipp Winterberg04/20/050

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: