You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
332 B
Perl
12 lines
332 B
Perl
#!/usr/local/bin/perl
|
|
|
|
print ("What is 17 plus 26?\n");
|
|
$correct_answer = 43; # the correct answer
|
|
$input_answer = <STDIN>;
|
|
chop ($input_answer);
|
|
until ($input_answer == $correct_answer) {
|
|
print ("Wrong! Keep trying!\n");
|
|
$input_answer = <STDIN>;
|
|
chop ($input_answer);
|
|
}
|
|
print ("You've got it!\n"); |