From the course: Code Clinic: Clojure
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Quil overview
- [Narrator] For our solution, we'll be using Quil in what it calls fun-mode, which stands for functional mode. In this video, I'll demonstrate how we'll leverage fun-mode to write our solution in a purely functional way. With this mode, the state of our program is explicit and managed by Quil. We'll implement three functions that hook into Quil. These are setup, update-state, and draw-state. Program will begin by calling setup. Then it will call draw-state and update-state in an infinite loop, until the program is close. Setup will initialize our program, running any code that needs to happen before our program begins handling events or doing any drawing. For our program, this will set the color mode, and do some other configuration. This function also returns a map of data with initial values, which contains all of the data that our program will update and draw from. The update-state function takes this map of data as its argument, and returns a new map of data. This function is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.