Irpan's posts with tag: 99 bottles

What are tags? You can give your posts a "tag", which is like a keyword. Tags help you find content which has something in common. You can assign as many tags as you wish to each post.
View posts by people in your network with tag 99 bottles
Posted by Irpan on Feb 8, '07 6:57 AM for everyone
Sebenernya sudah cukup lama nemu lagu unik ini di internet, lirik asli lagunya ada disini
Sekarang kita coba nyanyiin ya bareng-bareng dengan gaya Pop pake bahasa Java

class bottles
{
public static void main(String args[])
{
String s = "s";
for (int beers=99; beers>-1;)
{
System.out.print(beers + " bottle" + s + " of beer on the wall, ");
System.out.println(beers + " bottle" + s + " of beer, ");
if (beers==0)
{
System.out.print("Go to the store, buy some more, ");
System.out.println("99 bottles of beer on the wall.\n");
System.exit(0);
}
else
System.out.print("Take one down, pass it around, ");
s = (--beers == 1)?"":"s";
System.out.println(beers + " bottle" + s + " of beer on the wall.\n");
}
}
}

atau, ada yang suka agak keras dikit, kita nyanyiin dengan gaya Rock ala C

#define MAXBEER (99)

void chug(int beers);

main()
{
register beers;

for(beers = MAXBEER; beers; chug(beers--))
puts("");

puts("\nTime to buy more beer!\n");

exit(0);
}

void chug(register beers)
{
char howmany[8], *s;

s = beers != 1 ? "s" : "";
printf("%d bottle%s of beer on the wall,\n", beers, s);
printf("%d bottle%s of beeeeer . . . ,\n", beers, s);
printf("Take one down, pass it around,\n");

if(--beers) sprintf(howmany, "%d", beers); else strcpy(howmany, "No more");
s = beers != 1 ? "s" : "";
printf("%s bottle%s of beer on the wall.\n", howmany, s);
}

Bisa juga Heavy Metal lho, bahasanya Common Lisp

(in-package "CL-USER")

(defun bottle-song (&optional (in-stock 99) (stream *standard-output*))

(format

stream
"-----~2%~
~{~&~1&~
~[~^~:;~
~1:*~@(~
~R~) bo~
ttle~:P o~
f beer on t~
he wall~01:*~[.~
~:;,~%~1:*~@(~R~
~) bottle~:*~P ~
of beer.~%You t~
ake one down, p~
ass it around, ~
~01%~[*No* more~
~:;~:01*~@(~R~)~
~] bottle~:*~P ~
of beer on the ~
wall.~2&-----~%~
~1%~:*~]~]~}~0%"

(loop for bottle from in-stock downto 0 collect bottle)))

tertarik nyanyiin pake bahasa lain dengan gaya yang beda-beda check this.


© 2008 Multiply, Inc.    About · Blog · Terms · Privacy · Corp Info · Contact Us · Help