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-06-07

2019-06-02

2019-04-06

2019-03-29

2019-03-28

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