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
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)
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.
3 matches
Mail list logo