I am trying to animate a word letter by letter using Beginner Student Language on Racket. However, this code gives me an error "function call: expected a function after the open parenthesis, but found a part". I bolded the part that is giving me problems. Any suggestions?
(define theWord "blahlahblahblahblahbla")
(define (letterByLetter a)
(overlay ((substring theWord 0 a) 50 "red") (empty-scene 500 500)))
(animate letterByLetter)
This is because overlay takes two or more images as arguments. It looks like you want the first argument to be a call to text so the form should be
However, note that animate will call
letterByLetter
28 times a second in an infinite loop so will run out of letters and raise an exception! Perhaps you could comparea
and(string-length theWord)
...