Page 1 of 1
99 Bottles of Beer
Posted: Wed Jan 11, 2006 12:37 am
by techjunkie
Nice! PureBasic is represented, but no music and a bad score.
http://www.99-bottles-of-beer.net
Maybe we can contribute with a "better" version?!?

Posted: Wed Jan 11, 2006 1:47 am
by Kale
My mod of Philipp Winterberg's code.

Don't leave it on too long or you will go insane!
Code: Select all
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

Posted: Wed Jan 11, 2006 2:41 am
by Straker
I for one, say "Submit it!"
Posted: Wed Jan 11, 2006 6:07 am
by DarkDragon
Kale wrote:My mod of Philipp Winterberg's code.

Don't leave it on too long or you will go insane!
Code: Select all
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

First I thought: Awesome!
Now I think: You can do a screensaver with it and no thief will take your computer if it's running(he goes insane before).
Posted: Wed Jan 11, 2006 11:39 am
by techjunkie
Kale wrote:My mod of Philipp Winterberg's code.

Don't leave it on too long or you will go insane!
Great!! I must be insane allready?!? :roll: I played it for 30 minutes and liked it more and more...

Posted: Wed Jan 11, 2006 11:40 am
by traumatic
techjunkie wrote:Great!! I must be insane allready?!? :roll: I played it for 30 minutes and liked it more and more...

Don't worry, that's normal considering your age...

Posted: Wed Jan 11, 2006 1:38 pm
by rsts
Yes - submit it.
BTW - The perl version is incredible.
cheers
Posted: Thu Jan 12, 2006 7:30 am
by Tranquil
Huh, your PureBasic code is places on the Top-Lists No.1
PB roXX.

Posted: Tue Nov 21, 2006 1:14 am
by Kale
Posted: Tue Nov 21, 2006 2:22 am
by JCV
rsts wrote:Yes - submit it.
BTW - The perl version is incredible.
cheers
yeah

I run it and it works.
Code: Select all
''=~( '(?{' .('`' |'%') .('[' ^'-')
.('`' |'!') .('`' |',') .'"'. '\\$'
.'==' .('[' ^'+') .('`' |'/') .('['
^'+') .'||' .(';' &'=') .(';' &'=')
.';-' .'-'. '\\$' .'=;' .('[' ^'(')
.('[' ^'.') .('`' |'"') .('!' ^'+')
.'_\\{' .'(\\$' .';=('. '\\$=|' ."\|".( '`'^'.'
).(('`')| '/').').' .'\"'.+( '{'^'['). ('`'|'"') .('`'|'/'
).('['^'/') .('['^'/'). ('`'|',').( '`'|('%')). '\".\"'.( '['^('(')).
'\"'.('['^ '#').'!!--' .'\\$=.\"' .('{'^'['). ('`'|'/').( '`'|"\&").(
'{'^"\[").( '`'|""").( '`'|"\%").( '`'|"\%").( '['^(')')). '\").\"'.
('{'^'[').( '`'|"\/").( '`'|"\.").( '{'^"\[").( '['^"\/").( '`'|"\(").(
'`'|"\%").( '{'^"\[").( '['^"\,").( '`'|"\!").( '`'|"\,").( '`'|(',')).
'\"\\}'.+( '['^"\+").( '['^"\)").( '`'|"\)").( '`'|"\.").( '['^('/')).
'+_,\",'.( '{'^('[')). ('\\$;!').( '!'^"\+").( '{'^"\/").( '`'|"\!").(
'`'|"\+").( '`'|"\%").( '{'^"\[").( '`'|"\/").( '`'|"\.").( '`'|"\%").(
'{'^"\[").( '`'|"\$").( '`'|"\/").( '['^"\,").( '`'|('.')). ','.(('{')^
'[').("\["^ '+').("\`"| '!').("\["^ '(').("\["^ '(').("\{"^ '[').("\`"|
')').("\["^ '/').("\{"^ '[').("\`"| '!').("\["^ ')').("\`"| '/').("\["^
'.').("\`"| '.').("\`"| '$')."\,".( '!'^('+')). '\",_,\"' .'!'.("\!"^
'+').("\!"^ '+').'\"'. ('['^',').( '`'|"\(").( '`'|"\)").( '`'|"\,").(
'`'|('%')). '++\\$="})' );$:=('.')^ '~';$~='@'| '(';$^=')'^ '[';$/='`';
http://search.cpan.org/dist/Acme-EyeDro ... yeDrops.pm