Created
April 18, 2010 20:25
-
-
Save xenoterracide/370527 to your computer and use it in GitHub Desktop.
Guess a Number game
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# guess a number game | |
use feature 'say'; | |
use strict; | |
use warnings; | |
say "welcome"; | |
say "Guess the number: "; | |
my $guess = readline(*STDIN); | |
if ( $guess == 5 ) { | |
say "You Win!"; | |
} | |
else { | |
say "You Lose"; | |
} | |
say "Game over!"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment