Sha256: 409528ba8280ea72bdf432358f4530446032d39636a879dfb0e7a97ef2e48a2c

Contents?: true

Size: 463 Bytes

Versions: 2

Compression:

Stored size: 463 Bytes

Contents

(define number (+ (rand 9) 1))
  
(display "\n\nI'm thinking of a number between 1 and 10,\n")
(display "try to guess it!\n\n")

(define user-guess 
  (lambda () 
    (display "Take a guess - ")
    (define guess (string-to-num (gets)))
    (if (equal? guess number)
      (display "Good guess!\n")
      (begin
        (if (greater-than? guess number)
          (display "Lower!\n")
          (display "Higher!\n"))
        (user-guess)))))
        
(user-guess)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flea-0.1.1 examples/guess-the-number.scm
flea-0.1.0 examples/guess-the-number.scm