PDA

View Full Version : A (Very) Small Perl Game


sourav123
04-06-2008, 09:09 PM
A few into after starting with Perl, I have managed to write a small and simple perl game. It does not do big things but can be used as a timepass. The idea is about guessing a random number correctly. Every time you run the program, it will create a random number between 1 to 100. As you enter your guess, it will tell you whether your guess is more or less than the number. The program finishes when you guess the correct number. The point is to minimize the number of wrong attempts.

Below is the source code for the game written in Perl. You will need a Perl interpreter to execute this. After you have Perl, type perl random_guess.pl to execute the program after you save it in a file random_guess.pl

Please find the sourcecode here: http://pastebin.com/f3ebc28cb

Let me know your comments.

j1n M@tt
04-06-2008, 09:22 PM
hmm gud work man......

mehulved
04-06-2008, 09:52 PM
What kind of archive is this? I am unable to unzip it.

sourav123
04-06-2008, 10:11 PM
What kind of archive is this? I am unable to unzip it.

Hi Mehul,

There was some issues with the original file. I have corrected this. You can try now. Thanks for pointing.

mehulved
04-06-2008, 10:13 PM
Still unable to unzip it. You can just pastebin it and provide the url here.

sourav123
04-06-2008, 10:17 PM
Still unable to unzip it. You can just pastebin it and provide the url here.

Updated with the pastebin URL.

mehulved
04-06-2008, 10:24 PM
working now :)

hullap
06-06-2008, 02:13 PM
hmm, nice work man :)