THE LACK THEREOF

Lesson 05 - IF THEN ELSE

$num = int(rand(10)) + 1;
  print "Try to guess my number! You get one try.\n";
  print "Your guess: ";
  $guess = <>;
  chomp $guess;
  if ($guess == $num) {
    print "You guess my number!!\n";
  } else {
    print "Sorry... you guessed $guess, but my number was $num.\n";
  }

  

Navigation

Blog

https://thelackthereof.org/pics/16px-Feed-icon.svg.png Blog RSS Feed

Tweets


2019-08-18

2019-08-16

2019-07-21

2019-07-17

2019-07-16

Toots (Mastodon)

2018-07-02

2018-06-30

Code

Follow @awwaiid

Wiki Edits

https://thelackthereof.org/pics/16px-Feed-icon.svg.png Wiki RSS Feed

... more changes