Forum     

Go Back   Digit Technology Discussion Forum > Software > Open Source
Register FAQ Calendar Mark Forums Read

Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems.

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 04-06-2008, 09:09 PM   #1 (permalink)
Thinking Different
 
sourav123's Avatar
 
Join Date: Dec 2005
Location: Bangalore, India
Posts: 156
Default A (Very) Small Perl Game

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.
__________________
There is nothing more powerful than an idea whose time has come.

Last edited by sourav123; 04-06-2008 at 10:19 PM. Reason: Updated with pastebin link
sourav123 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 04-06-2008, 09:22 PM   #2 (permalink)
Wise Old Owl
 
j1n M@tt's Avatar
 
Join Date: Jun 2007
Location: Kochi
Posts: 1,094
Default Re: A (Very) Small Perl Game

hmm gud work man......
__________________
j1n M@tt || "a guy who gets off bed only b'coz of technology..."
j1n M@tt is offline  
Old 04-06-2008, 09:52 PM   #3 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: A (Very) Small Perl Game

What kind of archive is this? I am unable to unzip it.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 04-06-2008, 10:11 PM   #4 (permalink)
Thinking Different
 
sourav123's Avatar
 
Join Date: Dec 2005
Location: Bangalore, India
Posts: 156
Default Re: A (Very) Small Perl Game

Quote:
Originally Posted by mehulved View Post
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.
__________________
There is nothing more powerful than an idea whose time has come.
sourav123 is offline  
Old 04-06-2008, 10:13 PM   #5 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: A (Very) Small Perl Game

Still unable to unzip it. You can just pastebin it and provide the url here.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 04-06-2008, 10:17 PM   #6 (permalink)
Thinking Different
 
sourav123's Avatar
 
Join Date: Dec 2005
Location: Bangalore, India
Posts: 156
Default Re: A (Very) Small Perl Game

Quote:
Originally Posted by mehulved View Post
Still unable to unzip it. You can just pastebin it and provide the url here.
Updated with the pastebin URL.
__________________
There is nothing more powerful than an idea whose time has come.
sourav123 is offline  
Old 04-06-2008, 10:24 PM   #7 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: A (Very) Small Perl Game

working now
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 06-06-2008, 02:13 PM   #8 (permalink)
Wise Old Owl
 
hullap's Avatar
 
Join Date: Dec 2006
Location: delhi
Posts: 1,425
Default Re: A (Very) Small Perl Game

hmm, nice work man
hullap is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl Basics Abhishek Dwivedi Programming 5 29-06-2008 10:28 PM
Learning Perl sourav123 Programming 6 08-05-2008 01:24 PM
Bus Driver(small Game) gangadhar Gamerz 1 21-06-2007 10:05 PM
Damn small linux made my pen drive small abhinavchadda Software Q&A 4 17-05-2006 01:25 AM


All times are GMT +5.5. The time now is 12:09 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2