Hi All --
The idea was to make it to allow turtle functions to be composed, which is more consistent with the functional nature of Clojure. We made a few other changes, too. Here's the summary of most important changes:
- Turtles functions now print the result of a move (e.g. ":trinity moved 20"), but return only the turtle name. This way we can compose functions, i.e. apply "forward" to the result of "turn". This becomes especially important if we want to compose higher order functions, e.g. we have a list of turtles and want to map "forward 30" and then map "turn 45" over the result of the first map.
- Turtle state is now one hashmap that includes the name: {:x 0, :y 0, :angle 90, :color :purple, :name :trinity} This is done to simplify filtering and conditionals.
- We have added color names for basic colors (red, purple, etc.). Turtles trail now is of the same color as the turtle.
- We have updated the lesson plan quite a bit to gradually introduce higher order functions: https://github.com/clojurebridge-boston/track1-turtles/blob/master/outline/TURTLE-SAMPLES.md
We found that this approach works very well. Towards the end of the day participants who are absolutely new to programming write recursive functions and use map. Some get to filter. We've heard very positive feedback about the material.
This is, of course, still work in progress. We have plans for updating it for the spring 2017 ClojureBridge. There are still some open issues, as well as some ideas for exercises.
Given that this project has diverged quite a bit from the initial turtles project, I am wondering what would be the best way to incorporate it into the list of ClojureBridge projects (perhaps both the original version and this one could be incorporated?) having said this, I really hope that other ClojureBridge organizing groups have access to it and get a chance to use it and to contribute. I feel like it is at a good level for ClojureBridge beginners and teaches important concepts in programming, functional style, and Clojure specifically.
I will be happy to answer any questions.
Cheers,
Elena