Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #
- # Usage: ./braintest.pl <# of digits>
- #
- #
- # Change rand(10) to rand(2) to do binary
- # sleep(15) allows 15 seconds to memorize obviously for longer strings much more time will be needed.
- #
- for($x = 0; $x < $ARGV[0]; $x++)
- {
- $num = int(rand(10));
- $bin = $bin.$num;
- }
- print "$bin\n";
- sleep(15);
- for($x = 0; $x < 1000; $x++){print "\n"; }
- print "Enter number: ";
- $test = <STDIN>;
- chomp($test);
- if($test == $bin) { print "Correct!\n"; }
- else { print "Wrong $bin\n";}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement