revised turtles project from Boston ClojureBridge

4 views
Skip to first unread message

Elena Machkasova

unread,
Jan 9, 2017, 4:16:08 AM1/9/17
to clojurebridge-curriculum
Hi All --

Boston ClojureBridge group has put changed the turtles project in several significant ways. Our version is here: https://github.com/clojurebridge-boston/track1-turtles 

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:
  1. 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. 
  2. Turtle state is now one hashmap that includes the name: {:x 0, :y 0, :angle 90, :color :purple, :name :trinityThis is done to simplify filtering and conditionals.
  3. We have added color names for basic colors (red, purple, etc.). Turtles trail now is of the same color as the turtle. 
  4. 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

Yoko Harada

unread,
Jan 10, 2017, 12:48:55 PM1/10/17
to clojurebridg...@googlegroups.com
Elena,

Thanks for the feedback! Boston team is awesome.

I think the change 1 and 2 are really nice. But, I have a different opinion on 3, a color of the line. Changing color of the line is to visualize the effect of a function. Also, it will add artistic factor. Often, student's turtle window is really beautiful.

But, once the student get more than one turtle, having the same color tail as the head always may make things clear. So, it should be conditional depends on the number of turtles?

Best,
- Yoko

--
You received this message because you are subscribed to the Google Groups "clojurebridge-curriculum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurebridge-curriculum+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurebridge-curriculum.
For more options, visit https://groups.google.com/d/optout.

Elena Machkasova

unread,
Jan 10, 2017, 1:10:22 PM1/10/17
to clojurebridg...@googlegroups.com
You can still choose random colors. And perhaps we can add "rainbow" as a color option? I need to look into this.

Elena

To unsubscribe from this group and stop receiving emails from it, send an email to clojurebridge-curriculum+unsubscr...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "clojurebridge-curriculum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurebridge-curriculum+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurebridge-curriculum.
For more options, visit https://groups.google.com/d/optout.



--
Dr. Elena Machkasova
Associate Professor of Computer Science
Division of Science and Mathematics
University of Minnesota, Morris
Office: Sci 2325

Reply all
Reply to author
Forward
0 new messages