Re: [racket-users] Animation-problem

2016-12-05 Thread Daniel Prager
My pleasure. Good on you for doing the exercise. Here's a slightly modified version that: - removes the use of set!: it's cleaner "functional" style to avoid mutation where possible - illustrates the use of match-define to unpack world - other small tweaks and tricks Dan #lang

Re: [racket-users] Animation-problem

2016-12-05 Thread Janiho
Thank you Dan, that was very helpful! I haven't used that function big-bang but it seems quite simple. I also add that counter what you suggested. It take some time to figure out how I convert that counter's value to image. -- #lang racket (require 2htdp/universe) (require 2htdp/image)

Re: [racket-users] Animation-problem

2016-12-04 Thread Daniel Prager
Hi Janiho This should help get you get going ... The function big-bang takes minimally: * an initial "state of the world", * a function that that takes the current world state and evolves it with every tick of a notional clock, and * a function that takes the state of the world and draws it.