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.
Setting up Quil - Clojure Tutorial
From the course: Code Clinic: Clojure
Setting up Quil
- [Instructor] In this video, we'll start setting up Quil for our project. Let's define our name space. I'll call it theremin.core. And in a require expression, I'll pull in quil.core and we'll alias that as q. We'll use this quite a lot. Next, I'll pull in quil.middleware and I'll alias this as m. We'll use this Quil middleware for the functional mode that we've been talking about. That's all we need for the require expression for now. And lastly, I'll use a gen-class keyword in an expression, so that Leiningen can compile our program. Now, I'll need to set up our three functions for functional mode. Those are setup, update-state, and draw-state. So first, I'll do setup. This function doesn't take any arguments, and it will return a map of data. We'll fill in the map later. Next, we'll have update-state, which takes the current state of the application, and returns a new state. So for now, we'll just pass through the state and not change anything. Lastly, we'll have the draw-state…
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.