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 Game Maker Language

Date:05/25/05
Author:Jake Gilbert
URL:http://www.olddoom.com/
Comments:8
Info:http://www.cs.uu.nl/people/markov/gmaker/doc/html/400_index.html
Score: (2.69 in 26 votes)
//in create event:
bottles    = 99;
s          = "s";
sm1        = "s";
room_speed = 1;
text       = "";


//in draw event:
if ((bottles>2) || (bottles=0)) {s = "s"; sm1 = "s";}
if (bottles = 1) {s = ""; sm1 = "s";}
if (bottles = 2) {s = "s"; sm1 = "";}

text =  (string(bottles) + " bottle" + s + " of beer on the wall, ");
text += (string(bottles) + " bottle" + s + " of beer." + "#");
text += ("Take one down, pass it around, ");
text += (string(bottles-(bottles>0)) + " bottle" + sm1 + " of beer on the wall.");
draw_text(10,10,text);
if (bottles > 0) bottles -= 1;

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
GMLv6, requires no extra coding to enablScoochi205/04/072
1 var, no loops/recursion, EOB adaptablebrac3710/24/090

Comments

>>  UR MOM said on 07/16/05 02:37:03

UR MOM OMFG LMAO THATS F'IN AWESOME!!!

>>  Alegria said on 12/07/05 20:05:36

Alegria Very clever. Well done.

>>  Pallav said on 04/17/06 13:08:18

Pallav Very good

>>  Sten said on 06/27/06 13:17:44

Sten WOW, love it!

>>  thedrunkendead said on 08/04/06 07:02:42

thedrunkendead Good job. Couldn't have done better myself.

>>  leemcd56 said on 08/06/06 05:04:47

leemcd56 I, myself, am a Game Maker user and this code is pretty easy. I've been using it since '03!

>>  Cynical said on 10/23/06 22:40:23

Cynical Nice... I was going to make this, but now I don't have to :).

>>  Scoochi2 said on 05/04/07 15:07:26

Scoochi2 The code works, but first we must create an object, and create those events, and put the code snippets in the right events. Then we need to put the object in a room.
I have made an alternate version where all you need to do is to create a room (Game Maker will not let you run the game otherwise) and put my code in the room creation code. Voila :)

You can find my version at the follwing URL:
http://scoochi2.freehostia.com/beerbottles.php

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: