(define (number-checker)
(define userinput (read))
(cond
[(eof-object? userinput) print-fun)]
[else
(set! tries (+ 1 userinput))
(number-checker)]))
If i want to quit the program what would i have to write in order for program to go to print-fun?
It’s not compiling for me (using Racket):
also after fixing the typo:
If I understand correctly it’s supposed to read the user-input from prompt and bail-out when the “end of file” character arrives. But, this code will definitely won’t work. what is
print-fun? etc.UPDATE:
The working code is:
It works like this:
UPDATE 2:
another screenshot that shows the eof button that appears after you run
(number-checker):