99 Bottles of Beer

For everything that's not in any way related to PureBasic. General chat etc...
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

99 Bottles of Beer

Post by techjunkie »

Nice! PureBasic is represented, but no music and a bad score. :cry:

http://www.99-bottles-of-beer.net

Maybe we can contribute with a "better" version?!? :)
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

My mod of Philipp Winterberg's code. :P 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
:twisted:
--Kale

Image
Straker
Enthusiast
Enthusiast
Posts: 701
Joined: Wed Apr 13, 2005 10:45 pm
Location: Idaho, USA

Post by Straker »

I for one, say "Submit it!"
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Kale wrote:My mod of Philipp Winterberg's code. :P 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
:twisted:
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).
bye,
Daniel
techjunkie
Addict
Addict
Posts: 1126
Joined: Wed Oct 15, 2003 12:40 am
Location: Sweden
Contact:

Post by techjunkie »

Kale wrote:My mod of Philipp Winterberg's code. :P 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... :lol:
Image
(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

techjunkie wrote:Great!! I must be insane allready?!? :roll: I played it for 30 minutes and liked it more and more... :lol:
Don't worry, that's normal considering your age... :P
Good programmers don't comment their code. It was hard to write, should be hard to read.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Yes - submit it.

BTW - The perl version is incredible.

cheers
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

Huh, your PureBasic code is places on the Top-Lists No.1 :D

PB roXX. :lol:
Tranquil
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

--Kale

Image
JCV
Enthusiast
Enthusiast
Posts: 580
Joined: Fri Jun 30, 2006 4:30 pm
Location: Philippines

Post by JCV »

rsts wrote:Yes - submit it.

BTW - The perl version is incredible.

cheers
yeah :D
I run it and it works.

Code: Select all

    ''=~(        '(?{'        .('`'        |'%')        .('['        ^'-')
    .('`'        |'!')        .('`'        |',')        .'"'.        '\\$'
    .'=='        .('['        ^'+')        .('`'        |'/')        .('['
    ^'+')        .'||'        .(';'        &'=')        .(';'        &'=')
    .';-'        .'-'.        '\\$'        .'=;'        .('['        ^'(')
    .('['        ^'.')        .('`'        |'"')        .('!'        ^'+')
   .'_\\{'      .'(\\$'      .';=('.      '\\$=|'      ."\|".(      '`'^'.'
  ).(('`')|    '/').').'    .'\"'.+(    '{'^'[').    ('`'|'"')    .('`'|'/'
 ).('['^'/')  .('['^'/').  ('`'|',').(  '`'|('%')).  '\".\"'.(  '['^('(')).
 '\"'.('['^  '#').'!!--'  .'\\$=.\"'  .('{'^'[').  ('`'|'/').(  '`'|"\&").(
 '{'^"\[").(  '`'|""").(  '`'|"\%").(  '`'|"\%").(  '['^(')')).  '\").\"'.
 ('{'^'[').(  '`'|"\/").(  '`'|"\.").(  '{'^"\[").(  '['^"\/").(  '`'|"\(").(
 '`'|"\%").(  '{'^"\[").(  '['^"\,").(  '`'|"\!").(  '`'|"\,").(  '`'|(',')).
 '\"\\}'.+(  '['^"\+").(  '['^"\)").(  '`'|"\)").(  '`'|"\.").(  '['^('/')).
 '+_,\",'.(  '{'^('[')).  ('\\$;!').(  '!'^"\+").(  '{'^"\/").(  '`'|"\!").(
 '`'|"\+").(  '`'|"\%").(  '{'^"\[").(  '`'|"\/").(  '`'|"\.").(  '`'|"\%").(
 '{'^"\[").(  '`'|"\$").(  '`'|"\/").(  '['^"\,").(  '`'|('.')).  ','.(('{')^
 '[').("\["^  '+').("\`"|  '!').("\["^  '(').("\["^  '(').("\{"^  '[').("\`"|
 ')').("\["^  '/').("\{"^  '[').("\`"|  '!').("\["^  ')').("\`"|  '/').("\["^
 '.').("\`"|  '.').("\`"|  '$')."\,".(  '!'^('+')).  '\",_,\"'  .'!'.("\!"^
 '+').("\!"^  '+').'\"'.  ('['^',').(  '`'|"\(").(  '`'|"\)").(  '`'|"\,").(
 '`'|('%')).  '++\\$="})'  );$:=('.')^  '~';$~='@'|  '(';$^=')'^  '[';$/='`';

http://search.cpan.org/dist/Acme-EyeDro ... yeDrops.pm
Post Reply