#!/usr/bin/env ruby
#
# Quote: 
#
#     Ruby is a language designed in the following steps:
#    
#      * take a simple lisp language (like one prior to CL).
#      * remove macros, s-expression.
#      * add simple object system (much simpler than CLOS).
#      * add blocks, inspired by higher order functions.
#      * add methods found in Smalltalk.
#      * add functionality found in Perl (in OO way).
#    
#     So, Ruby was a Lisp originally, in theory.
#     Let's call it MatzLisp from now on. ;-)
#
#                - Yukihiro Matsumoto ("Matz")

(def login
        (puts "enter password")

        (password = ((gets).chomp))

        (if (password != "treasure")
                (login)
         end)
 end)

(login)

(puts "how old are you?")

(age = ((gets).to_i))

(puts (if (age < 18)
             "you cannot drink in a pub"
       else
             "you can drink in a pub"
       end))

(puts "do you want to go on?")

(response = ((gets).chomp))

(if (response == "yes")
        (puts "who is prime minister?")

        (pm = ((gets).chomp))

        (puts (if (pm == "major")
                      "you got it right"
               else
                      "you got it wrong"
               end))
 end)

