Smell something smoky? Take a look at this forest fire.
Let's go ahead and format our new NetLogo code the same way:
Recall what each of the keywords are doing!
❓ What does to
and end
mean?
❓ What is clear-all
doing?
❓ What is setup
and go
?
reset-ticks
is new. We'll discuss this soon.
to setup
clear-all
reset-ticks
end
to go
; we will fill this in later
end
See page below for more info about patches! Patches are important, so it deserves its own page.
Let's use some command to make a forest and make the entire world green!
⁉️ Hold up. Forests aren't all trees...
We need some way for some of the patches to be green, while the other stay black. Sometimes there's random dirt or rocks where fires shouldn't spread.
How should we address this?
In the command center:
> show random 6
Random numbers are super useful. Imagine you played a game that was the exact same every time: that wouldn't be any fun at all. Our world is filled with random things that random people do that have random results. Randomness is essential to building NetLogo models!