DIGIT-ARC read-only archive · snapshot: July 23, 2026

A (Very) Small Perl Game

8 posts · originally from https://geek.digit.in/community/threads/a-very-small-perl-game.89692/

sourav123
sourav123 Original post #1
Jun 4, 2008 at 9: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: *pastebin.com/f3ebc28cb

Let me know your comments.
j1n M@tt
Jun 4, 2008 at 9:22 PM
hmm gud work man......
M
Jun 4, 2008 at 9:52 PM
What kind of archive is this? I am unable to unzip it.
sourav123
Jun 4, 2008 at 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.
M
Jun 4, 2008 at 10:13 PM
Still unable to unzip it. You can just pastebin it and provide the url here.
M
Jun 4, 2008 at 10:24 PM
working now :)
hullap
hullap #8
Jun 6, 2008 at 2:13 PM
hmm, nice work man :)