W6D1 - Asteroids
Flying Circles
Remember that game where you fly around in a spaceship shooting asteroids and try not to get hit? We started that today! Right now it isn't much more than some circles (asteroids) moving around on a screen. Still, the canvas is pretty powerful and fun to work with, and I'm looking forward to finishing this project.
Currying
Haskell Curry was a 20th century mathematician who worked in logic. The functional programming language Haskell is named after him. So is one of the operations you can do in Haskell: currying. Today as a warmup exercise for Asteroids we wrote our own currying higher-order function in JavaScript. It sounds fancy, but all it really means is that you can create a new function out of an old one by holding one of its arguments constant. For example. if f(x, y, z) = x + y + z, then currying f, you could get a function g(y, z) = 5 + y + z, which is just f where x = 5. Using recursion and callbacks in JavaScript to do this was fun and enlightening.
















