lispjam24/interpret.rkt

14 lines
415 B
Racket

#lang racket/gui
(provide interpret)
; expects all strings to be uppercase
(define (interpret command)
(if (or (string=? command "TYPE HERE...") (string=? command ""))
"You need to type something in the box."
(let* ([tokens (string-split command)]
[verb (first tokens)]
[args (rest tokens)])
(case verb
[else (~a "I don't understand the verb " verb)]))))