Start on lab 6
cd
cd cs101
mkdir lab6
cd lab6
Your program
Purpose The purpose of this lab is to give you more hands-on experience with designing interactive programs, in particular programs that process lists.
Sample Problem Create an animated Halloween visualization in which you display some list of objects. On each tick the list should update.
Think about your program design before you begin. What will remain constant? What changes? For the former we need basic constant definitions; for the latter we need a data definition.
Add your program header and basic constant definitions to your definitions area. Here are some to start with:
My code and its output are found at the bottom of this page.
(require 2htdp/image)
(require 2htdp/universe)
...
(define BACKGROUND (empty-scene WIDTH HEIGHT))
(define P1 (make-posn 90 100))
(define P2 (make-posn 70 240))
(define P3 (make-posn 100 170))
(define PL1 (list P1 P2 P3))
Part 2 Decide what will animate over time and get that working during class. You can finish the background later.
Hint Define the main function, which sets up the event handlers and the rendering function. In this program your WorldState should be a List of Posn.
;; WorldState -> WorldState
Happy Halloween! (code example without random, code example with random movement)