Created
October 29, 2009 06:52
-
-
Save kbutti/221218 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #osak先生の数当てゲーム 普通の生徒用 TAの模範解答 | |
| $score = 0; | |
| while(){ | |
| for($i=0; $i<=3; ++$i){ | |
| $rnd[$i] = int(rand(99)); | |
| } | |
| @rnd = sort @rnd; | |
| print "Input 0..99 number->"; | |
| my $in = <STDIN>; | |
| if($in >= $rnd[0] && $in <= $rnd[3] ){ | |
| $score = $score + 10; | |
| print "Clear! Score=$score\n"; | |
| }else{ | |
| print "OUT! Score=$score\n"; | |
| last; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment