Goal for the day: produce a sequence of images to use for “hangman” and load it into Racket.
Draw a sequence of images hang-0.png
, hang-1.png
, etc., with the appropriate number of parts of the person filled in. Use “File -> Export as…” to save each file with a different name.
Tools:
The best way to load an image from a file is to use bitmap/file
.
Examples:
(bitmap/file "hang-0.png")
(bitmap/file "pics/hang-1.png")
For the simplest loading, save the Racket file in the same folder as your images. “Untitled” programs will not find your images - save!
The only cases of file corruption I have seen involve large images being pasted into DrRacket files. Keeping the images in separate files prevents that problem.