SlideShare a Scribd company logo
1 of 34
Download to read offline
 StarLogo  Nova  Cookbook  
1.   Basic  Set-­up    
2. Add  or  rename  breeds  
3. Giving  your  agents  built  in  traits  
4. Creating  new  traits  for  your  agents  
5. Basic  wiggle  walk  and  random  walk    
6. Basic  geometry  coordinates    
7. Headings    
8. Tilt  screen  to  see  in  3d  
9. Copy  and  paste  code  
10.  Loops  
11.  Sliders  -­  basic  (#  of  turtles)  and  percentage  (%  of  turtles  that  are  
purple)  
12.  Change  the  terrain  color  during  setup  
13.  Change  the  terrain  color  as  the  program  is  running  
14.  Making  turtles  react  to  patch  color    
15.  Scatter  turtles  randomly  on  a  certain  terrain  color  
16.  Collisions  -­-­  create/delete  turtles  on  collision,  set  or  modify  traits  
17.  Stop  code  
18.  Data  boxes  
19.  Line  graph  
20.  Hide  and  show  graph    
21.  Chase  another  breed  
22.  Run  away  from  another  breed  
  
     
Basic  Setup    
These  blocks  to  set  up  your  world  should  be  placed  on  the  world  tab.    Usually,  you  
want  to  delete  everyone  (agents  tab)  and  to  clear  terrain  (environment  tab)  before  
creating  your  new  world.    To  create  turtles,  use  the  larger  create  block  from  the  
agents  tab  –  the  “create  do”  -­‐-­‐  so  you  can  set  agent  traits.        Type  in  the  number  of  
turtles  you  want  to  create,  and  select  “Turtle”  from  the  drop-­‐down  menu.    It  is  also  
common  to  scatter  the  agents  by  attaching  a  “scatter  everyone”  (from  the  agents  
drawer)  underneath  the  create  block.    If  you  only  want  to  scatter  a  certain  type  of  
agent,  you  can  put  a  simple  “scatter”  block  under  the  word    “do”  in  the  create/do  
block.     
  
You  tube  GUTS  channel:    Flower  Power  1:10-­‐3:20  demonstrates  a  setup  block  (no  
scatter  or  traits);  3:50  –  4:15  makes  turtles  move  forward  3  on  setup  
https://www.youtube.com/watch?v=48X6PP931fE     
  
Adding  or  Renaming  Breeds  
To  add  or  rename  a  breed,  go  to  the  interface  and  click  on  the  “edit  breeds’  button.  
  
You  can  rename  the  turtle  breed  or  click  on  “add  breed”  to  create  another  breed.     
  
  
Each  breed  that  you  add  also  adds  a  page  (tab)  where  you  can  place  blocks  that  will  
control  that  breed.  
  
  
Setting  the  built-­‐in  traits  for  your  agents.     
You  can  give  your  turtles  traits  (from  the  traits  drawer)  by  setting  them  in  a  
“create-­‐do”  block  when  you  create  the  turtles.    You  can  type  in  a  number  in  a  blank  
space,  for  example  to  set  the  size  or  coordinate,  but  don’t  try  to  type  anything  else  -­‐-­‐  
if  you  try  to  type  in  words  like  “red”  to  set  the  color  of  the  block,  it  will  not  work.  
Instead,  you  need  to  drag  a    “color”  or  “built-­‐in  shape”  block  from  the  traits  drawer  
into  the  blank  space,  and  use  the  drop-­‐down  menu  in  that  block  to  set  those  traits.    
  
     
Creating  a  new  trait  for  agents.     
In  addition  to  using  the  build  in  traits,  you  can  also  give  your  agents  other  traits.    All  
agents  of  that  breed  will  have  the  trait  and  it  can  be  set  at  startup.    First,  go  to  the  
interface  screen  and  select  the  “edit  breeds”  button.     
     
  Then,  choose  “data”  and  give  your  trait  a  name,  then  click  OK.     
  
Get  a  “set  my  ____”  traits  block  from  the  traits  drawer  and  use  the  drop-­‐down  menu  
on  select  the  new  trait,  and  give  it  an  initial  value.  
  
Use  an  “if”  or  “collision”  block  to    trigger  a  change  in  energy.    Be  sure  to  use  the  
agent’s  existing  energy  and  add  or  subtract  from  it  to  change  the  energy  gradually  as  
the  program  runs.    
 
     
Wiggle  Walk  &  Random  Walk    
To  make  your  agents  move  in  a  natural  way,  you  can  use  the  “wiggle  walk”  or  the  
“random  walk”.    
In  the  wiggle  walk,  agents  move  forward  but  randomly  turn  a  little  bit  to  the  right  
then  a  little  bit  to  the  left  at  each  step.    Randomness  in  the  amount  that  they  turn  
causes  them  to  wander  across  the  world.    Change  the  size  of  the  random  turns  to  
make  them  walk  in  a  mostly  straight  line  or  walk  in  tight  random  patterns.  
  
The  random  walk  just  has  the  turtles  set  their  heading  to  a  random  number,  then  
step  forward.     
  
Guts  You  Tube  channel:    Flower  Turtles  
https://www.youtube.com/watch?v=48X6PP931fE  
4:40  –  6:40    Shows  how  to  get  out  forever,  while  toggled,  put  in  forward  and  left  
movement,  pen  down  
     
Basic  geometry  coordinates  in  Nova:    
  
Nova  creates  spaceland  as  a  grid  that  is  101  patches  high  and  101  patches  wide,  
with  0,0  in  the  center.     
  
  
As  a  default,  agents  are  setup  in  the  center  of  the  screen  (and  at  ground  level,  z  
=  0).    They  can  be  randomly  scattered  by  using  the  scatter  and  scatter  everyone  
blocks  from  the  agent  drawer,  or  by  using  this  formula:     
  
  
To  randomly  scatter  turtles  over  a  limited  part  of  blockland:     
  
To  change  where  the  turtles  scatter,  change  the  x  or  y  coordinate  in  this  formula.  
For  example,  to  scatter  them  randomly  on  the  lower  half  of  the  screen,  change  
the  y-­coordinate  to  return  a  random  number  between  0-­50,  and  then  subtract  50.    
  
       
     
Headings  in  Nova:  
  
If  you  create  a  single  turtle,  its  default  heading  will  be  0  degrees.    If  you  create  
two  turtles,  the  first  will  face  0  degrees  and  the  second  will  face  180  degrees;;  if  
you  create  4,  they  will  each  face  a  compass  direction,  as  illustrated  below  (by  
having  turtles  move  with  pen  down).     
  
  
The  code  that  creates  this  demonstration  pattern  is  here:  
  
  
  
Additional  turtles  will  set  up  on  default  to  evenly  divide  the  circle  by  the  number  of  
turtles  creates  -­-­  360  turtles  will  each  face  1  degree  apart  in  the  circle.     
  
You  can  change  the  default  heading  by  using  the  “set  my  ___  to  ___”  from  the  
traits  drawer,  within  a  create/do  block  or  in  a  procedure  or  collision  block:  
  
  
You  can  also  have  the  turtles  face  in  a  general  direction  (with  some  degree  of  
randomness)  by  using  a  formula  to  set  the  heading.    This  formula  will  set  the  
turtle’s  heading  between  0  and  180,  or  facing  the  upper  half  of  the  screen.  
  
  
     
Tilt  screen  to  see  in  3d:  
In  some  models,  like  the  greenhouse  model,  it  is  difficult  to  see  what  is  
happening  on  the  interface  using  a  two-­‐dimensional  or  overhead  view.     
Two  dimensional  view  of  greenhouse  model  (with  cars  and  bus):  
  
To  tilt  the  screen  up  on  edge  and  view  it  as  a  three-­‐dimensional  
interface,  click  on  the  green  part  of  the  interface  (blockland)  then  hold  
down  the  “option”  key  while  you  click  the  mouse  or  keypad,  and  drag  
down  the  screen  (toward  the  bottom)  to  tilt  blockland.    It  is  easy  to  
lose  your  place  -­‐-­‐  if  you  do,  just  click  “reset  camera”  at  the  top  of  the  
interface  to  restore  the  aerial  view  and  try  again.     
Three-­‐dimensional  view:  
 
  
Another  way  to  have  a  view  of  spaceland  based  on  the  perspective  of  an  agent  
or  breed  is  to  drag  a  “take  camera”  button  from  the  agents  drawer  into  the  
“create/do”  block  where  you  create  the  agent  you  want  to  have  the  camera.    
     
In  this  example,  the  clownfish  “takes”  the  camera,  and  on  setup,  the  interface  
looks  like  this:  
  
     
Cut,  Copy  and  Paste  code:  
It  can  be  very  useful  to  copy  a  long  piece  of  code  that  exists  for  one  
agent,  and  change  the  specific  settings  to  apply  to  a  different  agent,  or  
to  move  code  created  on  one  tab  to  another  tab.    Click  and  drag  your  
mouse  or  touchpad  to  make  a  box  (shown  by  a  dotted  green  line)  
around  the  entire  block  of  code  you  want  to  copy.    (Nova  will  only  copy  
a  complete  block  of  code,  so  if  you  want  only  a  piece  of  a  block,  detach  
it  from  the  larger  block  before  copying).    Then,  click  “copy”  (at  the  
bottom  left  of  the  screen,  beneath  the  drawers).    Finally,  click  “paste”  
to  copy  your  code,  creating  additional  copies  by  clicking  paste  again.    
  
Nova  will  sometimes  paste  the  code  on  the  extreme  upper  right  of  the  
tab  –  use  the  horizontal  and  vertical  scroll  bars  to  find  it.     
     
Loops:  
Any  button  created  using  the  “while  ___  toggled”  will  be  a  loop,  continuing  to  execute  
the  commands  in  order  (top  to  bottom)  until  the  button  is  toggled  off.    So,  putting  a  
series  of  movement  commands  inside  a  “while  forever  toggled”  will  make  the  turtles  
move  in  a  wiggle  until  the  forever  button  is  toggled  off.     
  
You  can  also  use  a  block  from  the  logic  drawer,  “while  ___”  to  have  agents  continue  a  
behavior  only  as  long  as  a  certain  condition  is  true.     
  
You  can  use  a  repeat  block,  from  the  logic  drawer,  to  get  turtles  to  perform  a  
command  or  series  of  commands  a  set  number  of  times.     
 
  
Adding  a  Slider  
Sliders  are  useful  for  changing  a  value  that  you  will  use  inside  your  model.  To  create  
a  slider,  go  to  the  interface  screen,  click  “Edit  Widgets”  on  the  upper  left,  and  then  
click  the  red  New  Widget  buttons  to  call  the  Create  Widget  screen.     
  
Select  horizontal  slider  (upper  right),  name  your  slider,  and  click  “Add  Widget”  
Your  slider  will  appear  on  the  interface  –  drag  it  where  you  want  it,  and  set  the  
minimum  and  maximum  values  by  typing  in  the  desired  numbers  –  be  sure  to  hit  the  
return  (enter)  key  after  typing  in  your  desired  values  while  still  on  this  screen.  
Then  click  “Edit  Widgets”  again  to  return  to  the  interface  screen.     
Now,  go  to  the  setup  block  on  the  world  page  where  you  created  your  turtles.    In  the  
Interface  drawer,  scroll  down  to  select  the  “___  slider  value”  block.    Put  it  into  the  
create  block  where  you  set  the  number  of  turtles,  and  select  the  name  of  your  slider.     
 
The  number  of  turtles  you  create  on  setup  should  now  reflect  the  slider  setting.  
To  use  a  slider  to  create  a  percent:  
Follow  the  directions  above  to  create  and  name  a  slider.      Be  sure  to  set  the  slider  
maximum  value  to  100.    Put  the  slider  value  block  into  the  code  to  replace  number  
you  want  to  use  as  a  variable,  using  the  following  formula:    
  
     
Change  the  color  of  the  terrain  on  setup  
  
Nova  does  not  allow  the  terrain  color  to  be  changed  directly,  so  to  change  it  you  
must  create  a  turtle  to  do  the  work  and  then  delete  that  turtle.    On  setup,  create  a  
turtle,  set  it  to  a  large  size,  set  its  x  and  y  coordinates  to  the  beginning  corner  of  
the  desired  patch  to  re-­color,  and  set  its  heading  toward  the  end  of  the  desired  
patch.    Put  a  stamp  command  from  the  terrain  drawer,  with  a  “my  color”  block  
from  the  traits  drawer,  and  a  forward  command  (movement  drawer)  inside  a  
repeat  block  (logic  drawer)  to  have  the  turtle  walk  along,  stamping  the  desired  
terrain  color.    Then,  delete  the  turtle.    For  example,  you  can  make  the  top  half  of  
spaceland  look  like  the  sky:  
  
  
  
Call  the  “make  sky”  procedure  in  the  set-­up  block,  after  clearing  the  terrain,  
deleting  everyone,  and  clearing  any  data  boxes  or  graphs,  and  before  creating  
the  actual  agents  for  the  model.    To  “make  earth”  or  the  ground  in  that  model,  
follow  a  very  similar  procedure,  changing  the  y-­coordinate  to  -­25,  and  the  color  to  
brown.     
     
To  change  the  color  of  the  terrain  as  the  program  is  running:  
    
Create  a  widget  to  push  when  you  want  the  terrain  to  change,  for  example,  if  you  
want  it  to  appear  that  flowers  get  planted  randomly  in  the  landscape  at  a  certain  
point  (see  the  entry  for  Hiding  and  Showing  Graphs  for  a  review  of  how  to  create  
widgets).    Here,  the  widget  is  named  “plant  flowers”  and  is  a  “when  ___  pushed”  
widget.    In  that  widget,  create  an  agent  (it  can  be  an  agent  you  use  elsewhere,  or  
a  separate  breed)  and  set  its  size  to  zero.    Then,  in  a  repeat  block  (repeat  as  
many  times  as  you  like),  set  the  agent  to  random  x  and  y  coordinate,  to  a  visible  
size,  have  it  stamp  a  color,  then  set  its  size  to  zero.    Delete  the  agent  at  the  end  
of  the  widget’s  code.     
  
  
  
     
To  make  turtles  react  to  patch  color:    
To  make  your  turtles  react  to  a  certain  condition,  like  the  color  of  a  
patch,  use  conditional  blocks  from  the  logic  drawer.    When  you  want  
agents  to  change  their  behavior  if  a  certain  condition  is  true,  use  the  
“if”  block.    For  example:     
  
This  code  will  make  the  turtles  turn  left  if  they  hit  a  red  patch  on  the  
terrain.     
You  can  have  agents  follow  different  sets  of  commands,  depending  on  
whether  a  condition  is  true  or  false,  by  using  the  “if  else”  block  (from  
the  logic  drawer).     
 
This  code  allows  you  to  set  the  percent  of  turtles  created  on  setup  that  
are  red,  and  set  the  color  of  the  rest  of  the  turtles  to  blue.     
GUTS  you  tube  channel  –  Bumper  Turtles:  
https://www.youtube.com/watch?v=W1iOByo6vzM  
Conditionals  code  for  turtles  to  react  to  patch  color  at  3:15  –  4:10  
     
To  scatter  turtles  according  to  terrain  color:     
  
If  you  have  created  a  terrain  color  on  set-­up  and  want  to  scatter  your  agents  
randomly  within  that  particular  color  or  exclude  them  from  a  particular  color,  you  
can  create  a  scatter  procedure  that  calls  itself,  or  a  “recursion.”     
  
For  example,  in  this  water  pumping  model,  the  turtles  (acting  as  groundwater)  
need  to  scatter  randomly  on  the  bottom  half  of  the  screen  only  (the  earth,  which  
has  been  colored  brown),  and  not  in  the  sky,  which  is  cyan.    Drag  a  procedure  
block  onto  the  turtle  tab,  and  name  it.    Put  a  simple  scatter  first,  and  then  add  a  
conditional  (“if”)  block  from  the  logic  drawer.    Ask  the  turtle  to  look  at  the  terrain  
color,  and  if  it  has  scattered  onto  the  wrong  color  (cyan)  it  calls  the  scatter  
procedure  again  (recursion).     
  
  
  
Don’t  forget  to  call  this  procedure  in  the  setup  block  on  the  world  page.     
  
You  can  also  use  recursion  and  set  the  x  and  y  coordinates  to  random  numbers,  
to  accomplish  the  same  goal.    Here,  the  turtles  (consumers)  need  to  scatter  
randomly  except  in  the  yellow  portion  of  the  terrain.     
 
  
Again,  the  procedure  must  be  called  in  the  setup  block,  as  well  as  in  itself.     
     
Collisions  
Turtles  will  simply  walk  through  each  other  unless  you  tell  them  to  
react  to  a  collision.    Using  the  collision  blocks,  you  can  have  various  
events  occur  when  agents  collide,  with  each  other  or  with  a  different  
breed.    To  show  the  spread  of  an  infection,  for  example,  you  might  
want  blue  (healthy)  turtles  to  turn  red  (infected)  when  they  collide  
with  a  red  turtle.    Use  a  collision  block  (from  the  detection  drawer)  and  
select  “Turtle”  from  the  drop-­‐down  menu.    Then,  have  the  colliding  
turtle  check  whether  it  is  colliding  with  (the  collidee)  is  red.    If  so,  the  
colliding  turtle  should  turn  red:  
  
If  you  want  a  collision  between  breeds,  you  should  pay  attention  to  
where  you  are  placing  the  collision  block.    For  example,  you  might  
want  to  make  a  shark  to  appear  to  “eat”  a  turtle  on  collision.      Put  the  
collision  block  on  the  shark  page,  and  delete  the  “collidee”  or  turtle.  
  
     
Stop  code  
  
When  you  are  using  a  model  to  collect  data,  it  is  useful  to  have  the  model  stop  
running  after  a  set  period  of  time,  so  the  data  can  be  recorded.    You  need  to  run  
the  model  long  enough  to  see  results,  but  not  so  long  that  repeated  trials  of  the  
same  experiment  become  burdensome.     
  
To  have  a  model  stop  after  500  ticks,  use  a  conditional  logic  block  inside  each  
use  of  the  “while  forever  toggled”  in  your  code.    For  example,  this  code  will  call  all  
the  procedures  and  will  update  the  data  box  for  500  ticks.    The  program  will  then  
stop  running  (although  the  forever  button  is  still  pushed),  and  the  data  can  be  
recorded  before  the  next  trial  of  the  experiment  begins.     
  
  
  
Data  boxes:  
  
To  have  the  computer  count  agents  for  you,  create  and  name  a  data  
box.    Nova  automatically  opens  a  new  project  with  a  data  box  called  
“score”  but  you  can  create  as  many  others  as  you  would  like.    On  the  
interface,  check  “Edit  Widgets”  and  then  click  the  red  button  to  create  a  
“New  Widget.”    Choose  “Data  Box”  and  name  your  widget,  then  click  
“Add  Widget.”  
  
Drag  your  widget  where  you  want  it  on  the  interface  page,  and  click  
the  Edit  Widgets  button  again  to  exit  this  screen.     
Look  in  the  interface  drawer  for  two  blocks:    “when  forever  toggled”  
and  “set  ___  data  box  to  ___”    and  drag  them  onto  the  world  tab.    Use  the  
drop-­‐down  menu  to  select  the  title  of  your  data  box.    Then,  from  the  
detection  drawer,  add  a  block  that  will  allow  you  to  count  the  agents,  
or  as  in  this  example,  the  agents  with  a  particular  characteristic:     
  
The  world  agent  will  count  the  turtles  within  a  certain  number  of  steps  
from  itself  (located  in  the  center  of  the  screen,  at  0,0),  so  be  sure  to  use  
a  number  that  will  count  all  turtles  on  the  101  x  101  step  screen.     
If  you  want  to  clear  the  data  box  on  setup,  use  the  set  data  box  code  to  
set  the  data  box  to  0.    Be  sure  to  place  this  box  above  the  blocks  
creating  the  turtles.     
  
     
Line  graph  
Creating  a  line  graph  is  similar  to  creating  a  data  box,  with  just  a  few  
more  steps.    On  the  interface,  click  the  “edit  widgets”  button  and  create  
a  new  widget.    Select  line  graph,  name  your  graph,  and  click  Add  
Widget.  
  
Place  your  graph  on  the  interface  (you  cannot  resize  it,  although  
another  cookbook  entry  explains  how  to  hide  or  show  a  graph).      While  
you  are  still  on  the  gray  screen  to  edit  widgets,  double  click  at  the  
bottom  of  the  graph  on  “series  1”  to  name  the  series.      Click  on  the  
colored  square  to  choose  the  color  of  the  line  in  the  graph,  and  click  
“Accept.”    
  
Click  on  “add  series”  to  create  another  input  into  the  graph,  name  it,  
and  choose  the  color  of  the  line.      When  you  have  created  all  relevant  
series,  click  edit  widgets  to  exit  the  editing  screen.     
Get  a  “when  forever  toggled”  block  and  a  block  called  “add  data  to  line  
graph”  from  the  interface  drawer,  and  place  them  on  the  World  tab.  
Use  the  drop-­‐down  menu  to  select  the  name  of  your  line  graph  and  to  
select  the  first  series  in  your  graph.      Put  a  “count  ___  within  ___”  
command  from  the  detection  drawer  into  the  y-­‐axis  slot.      The  world  
agent  will  count  the  agents  within  a  certain  number  of  steps  from  the  
center  of  the  screen,  so  use  200  steps  to  cover  the  entire  screen.    Get  a  
“clock”  block  from  the  environment  drawer  and  place  it  in  the  slot  for  
the  x-­‐axis.    Repeat  this  process  for  each  series  in  your  graph.     
  
You  can  also  clear  the  graph  on  setup  by  using  the  “clear  graph”  block  
from  the  interface  drawer.    Be  sure  to  place  this  block  above  the  create  
agents  blocks.     
 
     
Hide  and  show  graphs:     
  
Since  the  graphs  cannot  be  resized  in  Nova,  they  can  block  the  view  of  the  
interface  (blockland).    You  can  solve  this  problem  by  creating  a  widget  to  hide  
and  show  the  graphs.    On  the  interface,  click  Edit  Widgets  and  then  the  red  
button  to  Create  a  New  Widget.    Select  “Push  button”  on  the  upper  left,  name  
your  widget,  and  click  “Add  Widget.”    Create  another  Push  button  widget  called  
“Show  graph”,  place  the  buttons  where  you  want  them  on  the  interface,  and  then  
click  the  Edit  Widgets  button  again  to  exit  this  screen.     
  
  
  
To  create  the  code  to  make  these  widgets  work,  go  to  the  world  tab,  open  the  
interface  drawer  and  select  the  “when  ___  pushed”  block  and  a  “hide  ___”  block.  
Use  the  drop-­down  menus  to  select  first  the  name  of  your  new  push  button  
(“Hide  graphs”)  and  then  the  name  of  your  graph  (“heat”).    Add  a  hide  block  for  
each  additional  graph  (“co2  levels”).    Follow  the  same  procedure  for  your  “show  
graphs”  button.     
  
  
  
  
Chase:  
  
Instead  of  having  agents  always  move  in  a  random  wiggle,  you  can  make  a  
predator  agent  chase  the  closest  prey  agent.    In  this  example,  create  a  
procedure  on  the  tab  for  your  predator  agent  (mountain  lion)  using  the  face  
towards  and  forward  blocks  from  the  movement  drawer,  and  a    “nearest  ___  
within  ___  steps”  from  the  detection  drawer.    Put  them  together  so  you  are  
asking  the  mountain  lion  to  face  towards  the  nearest  rabbit  (prey)  within  100  
steps,  and  move  forward  1.    The  lion  will  follow  the  nearest  rabbit  until  it  catches  
(and  eats)  it,  and  then  will  choose  another  rabbit  to  follow:     
  
  
  
You  can  call  this  procedure  inside  a  forever  button,  so  the  lion  is  always  moving  
forward  straight  toward  the  nearest  rabbit.    Or,  you  can  use  an  “if/else”  logic  
block  to  have  the  lion  move  in  a  wiggle  unless  a  rabbit  is  nearby,  and  then  follow  
the  chase  procedure.     
  
 
  
This  second  method  allows  you  to  change  the  speed  and  the  energy  loss  for  the  
lion,  depending  on  whether  it  is  chasing  a  rabbit  or  just  wandering  around.     
     
Run  Away:    To  make  the  prey  breed  wander  around  unless  a  predator  is  nearby,  
create  a  basic  move  or  wiggle  procedure  for  your  prey  (rabbits)  on  the  prey  tab  
and  call  the  procedure  in  a  forever  block.    Create  another  procedure  for  them  to  
run  away,  and  call  this  procedure  in  the  same  forever  block,  below  the  wiggle  
procedure.  
  
  
A  rabbit  will  follow  its  wiggle  procedure  (which  is  called  first  in  the  forever  block)  
until  a  lion  comes  within  10  steps.    Then,  the  rabbit  executes  the  runaway  
procedure,  where  it  faces  towards  the  nearest  lion,  then  turns  around  and  takes  a  
small  step  away  (there  is  no  block  to  ask  the  rabbit  to  “face  away”  from  the  lion,  it  
can  only  face  towards  it  and  then  turn  around).      It  will  continue  to  take  small  
steps  away  from  the  lion  until  the  lion  is  more  than  10  steps  away,  when  the  
rabbit  will  wiggle  again.     
  
  

More Related Content

What's hot

Approaches in teaching and learning mathematics
Approaches in teaching and learning mathematicsApproaches in teaching and learning mathematics
Approaches in teaching and learning mathematicstangyokechoo
 
Math workshop for primary teachers
Math workshop for primary teachersMath workshop for primary teachers
Math workshop for primary teachersshallybhardwaj
 
Haciendo visible el aprendizaje: Rutinas de pensamiento,mapas mentales y visu...
Haciendo visible el aprendizaje: Rutinas de pensamiento,mapas mentales y visu...Haciendo visible el aprendizaje: Rutinas de pensamiento,mapas mentales y visu...
Haciendo visible el aprendizaje: Rutinas de pensamiento,mapas mentales y visu...Inma Contreras
 
Ict tel demo lesson plan 2.3
Ict tel demo lesson plan 2.3Ict tel demo lesson plan 2.3
Ict tel demo lesson plan 2.3Arfah Rahman
 
PresentacióN Audacity
PresentacióN AudacityPresentacióN Audacity
PresentacióN AudacityAna Hidalgo
 
4A's Detailed Lesson Plan Grade 2
4A's Detailed Lesson Plan Grade 24A's Detailed Lesson Plan Grade 2
4A's Detailed Lesson Plan Grade 2janehbasto
 
A detailed lesson plan final copy( final demo)
A detailed lesson plan final copy( final demo)A detailed lesson plan final copy( final demo)
A detailed lesson plan final copy( final demo)Jhon Michael Rino
 
Secuencia didactica fracciones entrega
Secuencia didactica fracciones entregaSecuencia didactica fracciones entrega
Secuencia didactica fracciones entregarealesycomplejas
 
DETAILED LESSON PLAN (MATH 6)
DETAILED LESSON PLAN (MATH 6)DETAILED LESSON PLAN (MATH 6)
DETAILED LESSON PLAN (MATH 6)Ryan Parpa
 

What's hot (10)

Approaches in teaching and learning mathematics
Approaches in teaching and learning mathematicsApproaches in teaching and learning mathematics
Approaches in teaching and learning mathematics
 
Math workshop for primary teachers
Math workshop for primary teachersMath workshop for primary teachers
Math workshop for primary teachers
 
REGLAS DEL JUEGO DOMINÓ DE FRACCIONES
REGLAS DEL JUEGO DOMINÓ DE FRACCIONESREGLAS DEL JUEGO DOMINÓ DE FRACCIONES
REGLAS DEL JUEGO DOMINÓ DE FRACCIONES
 
Haciendo visible el aprendizaje: Rutinas de pensamiento,mapas mentales y visu...
Haciendo visible el aprendizaje: Rutinas de pensamiento,mapas mentales y visu...Haciendo visible el aprendizaje: Rutinas de pensamiento,mapas mentales y visu...
Haciendo visible el aprendizaje: Rutinas de pensamiento,mapas mentales y visu...
 
Ict tel demo lesson plan 2.3
Ict tel demo lesson plan 2.3Ict tel demo lesson plan 2.3
Ict tel demo lesson plan 2.3
 
PresentacióN Audacity
PresentacióN AudacityPresentacióN Audacity
PresentacióN Audacity
 
4A's Detailed Lesson Plan Grade 2
4A's Detailed Lesson Plan Grade 24A's Detailed Lesson Plan Grade 2
4A's Detailed Lesson Plan Grade 2
 
A detailed lesson plan final copy( final demo)
A detailed lesson plan final copy( final demo)A detailed lesson plan final copy( final demo)
A detailed lesson plan final copy( final demo)
 
Secuencia didactica fracciones entrega
Secuencia didactica fracciones entregaSecuencia didactica fracciones entrega
Secuencia didactica fracciones entrega
 
DETAILED LESSON PLAN (MATH 6)
DETAILED LESSON PLAN (MATH 6)DETAILED LESSON PLAN (MATH 6)
DETAILED LESSON PLAN (MATH 6)
 

Similar to Star logo nova code cookbook(1)

Scratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsScratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsDavid Oromaner
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditBibekPandit2
 
7.Advanced Scripts in Scratch.pptx
7.Advanced Scripts in Scratch.pptx7.Advanced Scripts in Scratch.pptx
7.Advanced Scripts in Scratch.pptxdipalishewale2
 
Start developing projects with Scratch Programming
Start developing projects with Scratch ProgrammingStart developing projects with Scratch Programming
Start developing projects with Scratch ProgrammingPrakritiDhang
 
Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...
Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...
Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...LaurenMichelle11
 
Drawing Splines on 3D
Drawing Splines on 3DDrawing Splines on 3D
Drawing Splines on 3Dgraphitech
 
Scratch_1022
Scratch_1022Scratch_1022
Scratch_1022Seok Lee
 
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docxpaynetawnya
 
Policy analysis for the kaibab plateau (and introduction to vensim)
Policy analysis for the kaibab plateau (and introduction to vensim)Policy analysis for the kaibab plateau (and introduction to vensim)
Policy analysis for the kaibab plateau (and introduction to vensim)Benjamin Chang-Kwon Chung
 
AUTO CAD CIVIL ENGINEERING PPT REPORT
AUTO CAD CIVIL ENGINEERING PPT REPORTAUTO CAD CIVIL ENGINEERING PPT REPORT
AUTO CAD CIVIL ENGINEERING PPT REPORTDEEPAKKUMAR3980
 
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKey
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKeyInstructions for Scratch Pong Game Adaptation to use with MaKey MaKey
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKeyRenee Neumeier
 

Similar to Star logo nova code cookbook(1) (20)

Scratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsScratch Lesson 1 – Basics
Scratch Lesson 1 – Basics
 
Sln skill cards
Sln skill cardsSln skill cards
Sln skill cards
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek pandit
 
Rolling The Dice
Rolling The DiceRolling The Dice
Rolling The Dice
 
7.Advanced Scripts in Scratch.pptx
7.Advanced Scripts in Scratch.pptx7.Advanced Scripts in Scratch.pptx
7.Advanced Scripts in Scratch.pptx
 
Start developing projects with Scratch Programming
Start developing projects with Scratch ProgrammingStart developing projects with Scratch Programming
Start developing projects with Scratch Programming
 
Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...
Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...
Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...
 
Drawing Splines on 3D
Drawing Splines on 3DDrawing Splines on 3D
Drawing Splines on 3D
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Scratch_1022
Scratch_1022Scratch_1022
Scratch_1022
 
Poser presentation1
Poser presentation1Poser presentation1
Poser presentation1
 
mastercam_full
mastercam_fullmastercam_full
mastercam_full
 
mastercam_full
mastercam_fullmastercam_full
mastercam_full
 
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
 
Policy analysis for the kaibab plateau (and introduction to vensim)
Policy analysis for the kaibab plateau (and introduction to vensim)Policy analysis for the kaibab plateau (and introduction to vensim)
Policy analysis for the kaibab plateau (and introduction to vensim)
 
AUTO CAD CIVIL ENGINEERING PPT REPORT
AUTO CAD CIVIL ENGINEERING PPT REPORTAUTO CAD CIVIL ENGINEERING PPT REPORT
AUTO CAD CIVIL ENGINEERING PPT REPORT
 
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKey
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKeyInstructions for Scratch Pong Game Adaptation to use with MaKey MaKey
Instructions for Scratch Pong Game Adaptation to use with MaKey MaKey
 
Introducing Scratch
Introducing ScratchIntroducing Scratch
Introducing Scratch
 
Flash Tutorial
Flash TutorialFlash Tutorial
Flash Tutorial
 
Flash Tutorial
Flash TutorialFlash Tutorial
Flash Tutorial
 

More from Barbara M. King (20)

Dia de los muertos 2019
Dia de los muertos 2019Dia de los muertos 2019
Dia de los muertos 2019
 
Chavez web quest
Chavez web questChavez web quest
Chavez web quest
 
Pancho villa
Pancho villaPancho villa
Pancho villa
 
Spain's royal family
Spain's royal familySpain's royal family
Spain's royal family
 
Adverbios
AdverbiosAdverbios
Adverbios
 
Stem changing verbs final
Stem changing verbs finalStem changing verbs final
Stem changing verbs final
 
Everyday expressions
Everyday expressionsEveryday expressions
Everyday expressions
 
Me gusta task
Me gusta taskMe gusta task
Me gusta task
 
Python
PythonPython
Python
 
Codesters word wall
Codesters word wallCodesters word wall
Codesters word wall
 
Codesters
CodestersCodesters
Codesters
 
Dia de los muertos
Dia de los muertosDia de los muertos
Dia de los muertos
 
Bullfighting
BullfightingBullfighting
Bullfighting
 
Robotics
RoboticsRobotics
Robotics
 
Scratch
ScratchScratch
Scratch
 
Scratch
ScratchScratch
Scratch
 
Problem solving
Problem solvingProblem solving
Problem solving
 
Do now
Do nowDo now
Do now
 
Social media
Social mediaSocial media
Social media
 
Computer Hardware
Computer HardwareComputer Hardware
Computer Hardware
 

Recently uploaded

4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 

Recently uploaded (20)

4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

Star logo nova code cookbook(1)

  • 1.  StarLogo  Nova  Cookbook   1.  Basic  Set-­up     2. Add  or  rename  breeds   3. Giving  your  agents  built  in  traits   4. Creating  new  traits  for  your  agents   5. Basic  wiggle  walk  and  random  walk     6. Basic  geometry  coordinates     7. Headings     8. Tilt  screen  to  see  in  3d   9. Copy  and  paste  code   10.  Loops   11.  Sliders  -­  basic  (#  of  turtles)  and  percentage  (%  of  turtles  that  are   purple)   12.  Change  the  terrain  color  during  setup   13.  Change  the  terrain  color  as  the  program  is  running   14.  Making  turtles  react  to  patch  color     15.  Scatter  turtles  randomly  on  a  certain  terrain  color   16.  Collisions  -­-­  create/delete  turtles  on  collision,  set  or  modify  traits   17.  Stop  code   18.  Data  boxes   19.  Line  graph   20.  Hide  and  show  graph     21.  Chase  another  breed   22.  Run  away  from  another  breed        
  • 2. Basic  Setup     These  blocks  to  set  up  your  world  should  be  placed  on  the  world  tab.    Usually,  you   want  to  delete  everyone  (agents  tab)  and  to  clear  terrain  (environment  tab)  before   creating  your  new  world.    To  create  turtles,  use  the  larger  create  block  from  the   agents  tab  –  the  “create  do”  -­‐-­‐  so  you  can  set  agent  traits.        Type  in  the  number  of   turtles  you  want  to  create,  and  select  “Turtle”  from  the  drop-­‐down  menu.    It  is  also   common  to  scatter  the  agents  by  attaching  a  “scatter  everyone”  (from  the  agents   drawer)  underneath  the  create  block.    If  you  only  want  to  scatter  a  certain  type  of   agent,  you  can  put  a  simple  “scatter”  block  under  the  word    “do”  in  the  create/do   block.       You  tube  GUTS  channel:    Flower  Power  1:10-­‐3:20  demonstrates  a  setup  block  (no   scatter  or  traits);  3:50  –  4:15  makes  turtles  move  forward  3  on  setup   https://www.youtube.com/watch?v=48X6PP931fE      
  • 3. Adding  or  Renaming  Breeds   To  add  or  rename  a  breed,  go  to  the  interface  and  click  on  the  “edit  breeds’  button.     You  can  rename  the  turtle  breed  or  click  on  “add  breed”  to  create  another  breed.         Each  breed  that  you  add  also  adds  a  page  (tab)  where  you  can  place  blocks  that  will   control  that  breed.      
  • 4. Setting  the  built-­‐in  traits  for  your  agents.     You  can  give  your  turtles  traits  (from  the  traits  drawer)  by  setting  them  in  a   “create-­‐do”  block  when  you  create  the  turtles.    You  can  type  in  a  number  in  a  blank   space,  for  example  to  set  the  size  or  coordinate,  but  don’t  try  to  type  anything  else  -­‐-­‐   if  you  try  to  type  in  words  like  “red”  to  set  the  color  of  the  block,  it  will  not  work.   Instead,  you  need  to  drag  a    “color”  or  “built-­‐in  shape”  block  from  the  traits  drawer   into  the  blank  space,  and  use  the  drop-­‐down  menu  in  that  block  to  set  those  traits.          
  • 5. Creating  a  new  trait  for  agents.     In  addition  to  using  the  build  in  traits,  you  can  also  give  your  agents  other  traits.    All   agents  of  that  breed  will  have  the  trait  and  it  can  be  set  at  startup.    First,  go  to  the   interface  screen  and  select  the  “edit  breeds”  button.          Then,  choose  “data”  and  give  your  trait  a  name,  then  click  OK.       Get  a  “set  my  ____”  traits  block  from  the  traits  drawer  and  use  the  drop-­‐down  menu   on  select  the  new  trait,  and  give  it  an  initial  value.     Use  an  “if”  or  “collision”  block  to    trigger  a  change  in  energy.    Be  sure  to  use  the   agent’s  existing  energy  and  add  or  subtract  from  it  to  change  the  energy  gradually  as   the  program  runs.    
  • 6.      
  • 7. Wiggle  Walk  &  Random  Walk     To  make  your  agents  move  in  a  natural  way,  you  can  use  the  “wiggle  walk”  or  the   “random  walk”.     In  the  wiggle  walk,  agents  move  forward  but  randomly  turn  a  little  bit  to  the  right   then  a  little  bit  to  the  left  at  each  step.    Randomness  in  the  amount  that  they  turn   causes  them  to  wander  across  the  world.    Change  the  size  of  the  random  turns  to   make  them  walk  in  a  mostly  straight  line  or  walk  in  tight  random  patterns.     The  random  walk  just  has  the  turtles  set  their  heading  to  a  random  number,  then   step  forward.       Guts  You  Tube  channel:    Flower  Turtles   https://www.youtube.com/watch?v=48X6PP931fE   4:40  –  6:40    Shows  how  to  get  out  forever,  while  toggled,  put  in  forward  and  left   movement,  pen  down      
  • 8. Basic  geometry  coordinates  in  Nova:       Nova  creates  spaceland  as  a  grid  that  is  101  patches  high  and  101  patches  wide,   with  0,0  in  the  center.         As  a  default,  agents  are  setup  in  the  center  of  the  screen  (and  at  ground  level,  z   =  0).    They  can  be  randomly  scattered  by  using  the  scatter  and  scatter  everyone   blocks  from  the  agent  drawer,  or  by  using  this  formula:         To  randomly  scatter  turtles  over  a  limited  part  of  blockland:       To  change  where  the  turtles  scatter,  change  the  x  or  y  coordinate  in  this  formula.   For  example,  to  scatter  them  randomly  on  the  lower  half  of  the  screen,  change   the  y-­coordinate  to  return  a  random  number  between  0-­50,  and  then  subtract  50.                
  • 9. Headings  in  Nova:     If  you  create  a  single  turtle,  its  default  heading  will  be  0  degrees.    If  you  create   two  turtles,  the  first  will  face  0  degrees  and  the  second  will  face  180  degrees;;  if   you  create  4,  they  will  each  face  a  compass  direction,  as  illustrated  below  (by   having  turtles  move  with  pen  down).        
  • 10. The  code  that  creates  this  demonstration  pattern  is  here:         Additional  turtles  will  set  up  on  default  to  evenly  divide  the  circle  by  the  number  of   turtles  creates  -­-­  360  turtles  will  each  face  1  degree  apart  in  the  circle.       You  can  change  the  default  heading  by  using  the  “set  my  ___  to  ___”  from  the   traits  drawer,  within  a  create/do  block  or  in  a  procedure  or  collision  block:       You  can  also  have  the  turtles  face  in  a  general  direction  (with  some  degree  of   randomness)  by  using  a  formula  to  set  the  heading.    This  formula  will  set  the   turtle’s  heading  between  0  and  180,  or  facing  the  upper  half  of  the  screen.          
  • 11. Tilt  screen  to  see  in  3d:   In  some  models,  like  the  greenhouse  model,  it  is  difficult  to  see  what  is   happening  on  the  interface  using  a  two-­‐dimensional  or  overhead  view.     Two  dimensional  view  of  greenhouse  model  (with  cars  and  bus):     To  tilt  the  screen  up  on  edge  and  view  it  as  a  three-­‐dimensional   interface,  click  on  the  green  part  of  the  interface  (blockland)  then  hold   down  the  “option”  key  while  you  click  the  mouse  or  keypad,  and  drag   down  the  screen  (toward  the  bottom)  to  tilt  blockland.    It  is  easy  to   lose  your  place  -­‐-­‐  if  you  do,  just  click  “reset  camera”  at  the  top  of  the   interface  to  restore  the  aerial  view  and  try  again.     Three-­‐dimensional  view:  
  • 12.     Another  way  to  have  a  view  of  spaceland  based  on  the  perspective  of  an  agent   or  breed  is  to  drag  a  “take  camera”  button  from  the  agents  drawer  into  the   “create/do”  block  where  you  create  the  agent  you  want  to  have  the  camera.         In  this  example,  the  clownfish  “takes”  the  camera,  and  on  setup,  the  interface   looks  like  this:        
  • 13. Cut,  Copy  and  Paste  code:   It  can  be  very  useful  to  copy  a  long  piece  of  code  that  exists  for  one   agent,  and  change  the  specific  settings  to  apply  to  a  different  agent,  or   to  move  code  created  on  one  tab  to  another  tab.    Click  and  drag  your   mouse  or  touchpad  to  make  a  box  (shown  by  a  dotted  green  line)   around  the  entire  block  of  code  you  want  to  copy.    (Nova  will  only  copy   a  complete  block  of  code,  so  if  you  want  only  a  piece  of  a  block,  detach   it  from  the  larger  block  before  copying).    Then,  click  “copy”  (at  the   bottom  left  of  the  screen,  beneath  the  drawers).    Finally,  click  “paste”   to  copy  your  code,  creating  additional  copies  by  clicking  paste  again.       Nova  will  sometimes  paste  the  code  on  the  extreme  upper  right  of  the   tab  –  use  the  horizontal  and  vertical  scroll  bars  to  find  it.        
  • 14. Loops:   Any  button  created  using  the  “while  ___  toggled”  will  be  a  loop,  continuing  to  execute   the  commands  in  order  (top  to  bottom)  until  the  button  is  toggled  off.    So,  putting  a   series  of  movement  commands  inside  a  “while  forever  toggled”  will  make  the  turtles   move  in  a  wiggle  until  the  forever  button  is  toggled  off.       You  can  also  use  a  block  from  the  logic  drawer,  “while  ___”  to  have  agents  continue  a   behavior  only  as  long  as  a  certain  condition  is  true.       You  can  use  a  repeat  block,  from  the  logic  drawer,  to  get  turtles  to  perform  a   command  or  series  of  commands  a  set  number  of  times.    
  • 15.    
  • 16. Adding  a  Slider   Sliders  are  useful  for  changing  a  value  that  you  will  use  inside  your  model.  To  create   a  slider,  go  to  the  interface  screen,  click  “Edit  Widgets”  on  the  upper  left,  and  then   click  the  red  New  Widget  buttons  to  call  the  Create  Widget  screen.       Select  horizontal  slider  (upper  right),  name  your  slider,  and  click  “Add  Widget”   Your  slider  will  appear  on  the  interface  –  drag  it  where  you  want  it,  and  set  the   minimum  and  maximum  values  by  typing  in  the  desired  numbers  –  be  sure  to  hit  the   return  (enter)  key  after  typing  in  your  desired  values  while  still  on  this  screen.   Then  click  “Edit  Widgets”  again  to  return  to  the  interface  screen.     Now,  go  to  the  setup  block  on  the  world  page  where  you  created  your  turtles.    In  the   Interface  drawer,  scroll  down  to  select  the  “___  slider  value”  block.    Put  it  into  the   create  block  where  you  set  the  number  of  turtles,  and  select  the  name  of  your  slider.    
  • 17.   The  number  of  turtles  you  create  on  setup  should  now  reflect  the  slider  setting.   To  use  a  slider  to  create  a  percent:   Follow  the  directions  above  to  create  and  name  a  slider.      Be  sure  to  set  the  slider   maximum  value  to  100.    Put  the  slider  value  block  into  the  code  to  replace  number   you  want  to  use  as  a  variable,  using  the  following  formula:          
  • 18. Change  the  color  of  the  terrain  on  setup     Nova  does  not  allow  the  terrain  color  to  be  changed  directly,  so  to  change  it  you   must  create  a  turtle  to  do  the  work  and  then  delete  that  turtle.    On  setup,  create  a   turtle,  set  it  to  a  large  size,  set  its  x  and  y  coordinates  to  the  beginning  corner  of   the  desired  patch  to  re-­color,  and  set  its  heading  toward  the  end  of  the  desired   patch.    Put  a  stamp  command  from  the  terrain  drawer,  with  a  “my  color”  block   from  the  traits  drawer,  and  a  forward  command  (movement  drawer)  inside  a   repeat  block  (logic  drawer)  to  have  the  turtle  walk  along,  stamping  the  desired   terrain  color.    Then,  delete  the  turtle.    For  example,  you  can  make  the  top  half  of   spaceland  look  like  the  sky:         Call  the  “make  sky”  procedure  in  the  set-­up  block,  after  clearing  the  terrain,   deleting  everyone,  and  clearing  any  data  boxes  or  graphs,  and  before  creating   the  actual  agents  for  the  model.    To  “make  earth”  or  the  ground  in  that  model,   follow  a  very  similar  procedure,  changing  the  y-­coordinate  to  -­25,  and  the  color  to   brown.        
  • 19. To  change  the  color  of  the  terrain  as  the  program  is  running:       Create  a  widget  to  push  when  you  want  the  terrain  to  change,  for  example,  if  you   want  it  to  appear  that  flowers  get  planted  randomly  in  the  landscape  at  a  certain   point  (see  the  entry  for  Hiding  and  Showing  Graphs  for  a  review  of  how  to  create   widgets).    Here,  the  widget  is  named  “plant  flowers”  and  is  a  “when  ___  pushed”   widget.    In  that  widget,  create  an  agent  (it  can  be  an  agent  you  use  elsewhere,  or   a  separate  breed)  and  set  its  size  to  zero.    Then,  in  a  repeat  block  (repeat  as   many  times  as  you  like),  set  the  agent  to  random  x  and  y  coordinate,  to  a  visible   size,  have  it  stamp  a  color,  then  set  its  size  to  zero.    Delete  the  agent  at  the  end   of  the  widget’s  code.              
  • 20. To  make  turtles  react  to  patch  color:     To  make  your  turtles  react  to  a  certain  condition,  like  the  color  of  a   patch,  use  conditional  blocks  from  the  logic  drawer.    When  you  want   agents  to  change  their  behavior  if  a  certain  condition  is  true,  use  the   “if”  block.    For  example:       This  code  will  make  the  turtles  turn  left  if  they  hit  a  red  patch  on  the   terrain.     You  can  have  agents  follow  different  sets  of  commands,  depending  on   whether  a  condition  is  true  or  false,  by  using  the  “if  else”  block  (from   the  logic  drawer).    
  • 21.   This  code  allows  you  to  set  the  percent  of  turtles  created  on  setup  that   are  red,  and  set  the  color  of  the  rest  of  the  turtles  to  blue.     GUTS  you  tube  channel  –  Bumper  Turtles:   https://www.youtube.com/watch?v=W1iOByo6vzM   Conditionals  code  for  turtles  to  react  to  patch  color  at  3:15  –  4:10      
  • 22. To  scatter  turtles  according  to  terrain  color:       If  you  have  created  a  terrain  color  on  set-­up  and  want  to  scatter  your  agents   randomly  within  that  particular  color  or  exclude  them  from  a  particular  color,  you   can  create  a  scatter  procedure  that  calls  itself,  or  a  “recursion.”       For  example,  in  this  water  pumping  model,  the  turtles  (acting  as  groundwater)   need  to  scatter  randomly  on  the  bottom  half  of  the  screen  only  (the  earth,  which   has  been  colored  brown),  and  not  in  the  sky,  which  is  cyan.    Drag  a  procedure   block  onto  the  turtle  tab,  and  name  it.    Put  a  simple  scatter  first,  and  then  add  a   conditional  (“if”)  block  from  the  logic  drawer.    Ask  the  turtle  to  look  at  the  terrain   color,  and  if  it  has  scattered  onto  the  wrong  color  (cyan)  it  calls  the  scatter   procedure  again  (recursion).           Don’t  forget  to  call  this  procedure  in  the  setup  block  on  the  world  page.       You  can  also  use  recursion  and  set  the  x  and  y  coordinates  to  random  numbers,   to  accomplish  the  same  goal.    Here,  the  turtles  (consumers)  need  to  scatter   randomly  except  in  the  yellow  portion  of  the  terrain.    
  • 23.     Again,  the  procedure  must  be  called  in  the  setup  block,  as  well  as  in  itself.        
  • 24. Collisions   Turtles  will  simply  walk  through  each  other  unless  you  tell  them  to   react  to  a  collision.    Using  the  collision  blocks,  you  can  have  various   events  occur  when  agents  collide,  with  each  other  or  with  a  different   breed.    To  show  the  spread  of  an  infection,  for  example,  you  might   want  blue  (healthy)  turtles  to  turn  red  (infected)  when  they  collide   with  a  red  turtle.    Use  a  collision  block  (from  the  detection  drawer)  and   select  “Turtle”  from  the  drop-­‐down  menu.    Then,  have  the  colliding   turtle  check  whether  it  is  colliding  with  (the  collidee)  is  red.    If  so,  the   colliding  turtle  should  turn  red:     If  you  want  a  collision  between  breeds,  you  should  pay  attention  to   where  you  are  placing  the  collision  block.    For  example,  you  might   want  to  make  a  shark  to  appear  to  “eat”  a  turtle  on  collision.      Put  the   collision  block  on  the  shark  page,  and  delete  the  “collidee”  or  turtle.        
  • 25. Stop  code     When  you  are  using  a  model  to  collect  data,  it  is  useful  to  have  the  model  stop   running  after  a  set  period  of  time,  so  the  data  can  be  recorded.    You  need  to  run   the  model  long  enough  to  see  results,  but  not  so  long  that  repeated  trials  of  the   same  experiment  become  burdensome.       To  have  a  model  stop  after  500  ticks,  use  a  conditional  logic  block  inside  each   use  of  the  “while  forever  toggled”  in  your  code.    For  example,  this  code  will  call  all   the  procedures  and  will  update  the  data  box  for  500  ticks.    The  program  will  then   stop  running  (although  the  forever  button  is  still  pushed),  and  the  data  can  be   recorded  before  the  next  trial  of  the  experiment  begins.          
  • 26. Data  boxes:     To  have  the  computer  count  agents  for  you,  create  and  name  a  data   box.    Nova  automatically  opens  a  new  project  with  a  data  box  called   “score”  but  you  can  create  as  many  others  as  you  would  like.    On  the   interface,  check  “Edit  Widgets”  and  then  click  the  red  button  to  create  a   “New  Widget.”    Choose  “Data  Box”  and  name  your  widget,  then  click   “Add  Widget.”     Drag  your  widget  where  you  want  it  on  the  interface  page,  and  click   the  Edit  Widgets  button  again  to  exit  this  screen.     Look  in  the  interface  drawer  for  two  blocks:    “when  forever  toggled”   and  “set  ___  data  box  to  ___”    and  drag  them  onto  the  world  tab.    Use  the   drop-­‐down  menu  to  select  the  title  of  your  data  box.    Then,  from  the   detection  drawer,  add  a  block  that  will  allow  you  to  count  the  agents,   or  as  in  this  example,  the  agents  with  a  particular  characteristic:      
  • 27. The  world  agent  will  count  the  turtles  within  a  certain  number  of  steps   from  itself  (located  in  the  center  of  the  screen,  at  0,0),  so  be  sure  to  use   a  number  that  will  count  all  turtles  on  the  101  x  101  step  screen.     If  you  want  to  clear  the  data  box  on  setup,  use  the  set  data  box  code  to   set  the  data  box  to  0.    Be  sure  to  place  this  box  above  the  blocks   creating  the  turtles.          
  • 28. Line  graph   Creating  a  line  graph  is  similar  to  creating  a  data  box,  with  just  a  few   more  steps.    On  the  interface,  click  the  “edit  widgets”  button  and  create   a  new  widget.    Select  line  graph,  name  your  graph,  and  click  Add   Widget.     Place  your  graph  on  the  interface  (you  cannot  resize  it,  although   another  cookbook  entry  explains  how  to  hide  or  show  a  graph).      While   you  are  still  on  the  gray  screen  to  edit  widgets,  double  click  at  the   bottom  of  the  graph  on  “series  1”  to  name  the  series.      Click  on  the   colored  square  to  choose  the  color  of  the  line  in  the  graph,  and  click   “Accept.”       Click  on  “add  series”  to  create  another  input  into  the  graph,  name  it,   and  choose  the  color  of  the  line.      When  you  have  created  all  relevant   series,  click  edit  widgets  to  exit  the  editing  screen.    
  • 29. Get  a  “when  forever  toggled”  block  and  a  block  called  “add  data  to  line   graph”  from  the  interface  drawer,  and  place  them  on  the  World  tab.   Use  the  drop-­‐down  menu  to  select  the  name  of  your  line  graph  and  to   select  the  first  series  in  your  graph.      Put  a  “count  ___  within  ___”   command  from  the  detection  drawer  into  the  y-­‐axis  slot.      The  world   agent  will  count  the  agents  within  a  certain  number  of  steps  from  the   center  of  the  screen,  so  use  200  steps  to  cover  the  entire  screen.    Get  a   “clock”  block  from  the  environment  drawer  and  place  it  in  the  slot  for   the  x-­‐axis.    Repeat  this  process  for  each  series  in  your  graph.       You  can  also  clear  the  graph  on  setup  by  using  the  “clear  graph”  block   from  the  interface  drawer.    Be  sure  to  place  this  block  above  the  create   agents  blocks.    
  • 30.      
  • 31. Hide  and  show  graphs:       Since  the  graphs  cannot  be  resized  in  Nova,  they  can  block  the  view  of  the   interface  (blockland).    You  can  solve  this  problem  by  creating  a  widget  to  hide   and  show  the  graphs.    On  the  interface,  click  Edit  Widgets  and  then  the  red   button  to  Create  a  New  Widget.    Select  “Push  button”  on  the  upper  left,  name   your  widget,  and  click  “Add  Widget.”    Create  another  Push  button  widget  called   “Show  graph”,  place  the  buttons  where  you  want  them  on  the  interface,  and  then   click  the  Edit  Widgets  button  again  to  exit  this  screen.           To  create  the  code  to  make  these  widgets  work,  go  to  the  world  tab,  open  the   interface  drawer  and  select  the  “when  ___  pushed”  block  and  a  “hide  ___”  block.   Use  the  drop-­down  menus  to  select  first  the  name  of  your  new  push  button   (“Hide  graphs”)  and  then  the  name  of  your  graph  (“heat”).    Add  a  hide  block  for   each  additional  graph  (“co2  levels”).    Follow  the  same  procedure  for  your  “show   graphs”  button.            
  • 32. Chase:     Instead  of  having  agents  always  move  in  a  random  wiggle,  you  can  make  a   predator  agent  chase  the  closest  prey  agent.    In  this  example,  create  a   procedure  on  the  tab  for  your  predator  agent  (mountain  lion)  using  the  face   towards  and  forward  blocks  from  the  movement  drawer,  and  a    “nearest  ___   within  ___  steps”  from  the  detection  drawer.    Put  them  together  so  you  are   asking  the  mountain  lion  to  face  towards  the  nearest  rabbit  (prey)  within  100   steps,  and  move  forward  1.    The  lion  will  follow  the  nearest  rabbit  until  it  catches   (and  eats)  it,  and  then  will  choose  another  rabbit  to  follow:           You  can  call  this  procedure  inside  a  forever  button,  so  the  lion  is  always  moving   forward  straight  toward  the  nearest  rabbit.    Or,  you  can  use  an  “if/else”  logic   block  to  have  the  lion  move  in  a  wiggle  unless  a  rabbit  is  nearby,  and  then  follow   the  chase  procedure.      
  • 33.     This  second  method  allows  you  to  change  the  speed  and  the  energy  loss  for  the   lion,  depending  on  whether  it  is  chasing  a  rabbit  or  just  wandering  around.        
  • 34. Run  Away:    To  make  the  prey  breed  wander  around  unless  a  predator  is  nearby,   create  a  basic  move  or  wiggle  procedure  for  your  prey  (rabbits)  on  the  prey  tab   and  call  the  procedure  in  a  forever  block.    Create  another  procedure  for  them  to   run  away,  and  call  this  procedure  in  the  same  forever  block,  below  the  wiggle   procedure.       A  rabbit  will  follow  its  wiggle  procedure  (which  is  called  first  in  the  forever  block)   until  a  lion  comes  within  10  steps.    Then,  the  rabbit  executes  the  runaway   procedure,  where  it  faces  towards  the  nearest  lion,  then  turns  around  and  takes  a   small  step  away  (there  is  no  block  to  ask  the  rabbit  to  “face  away”  from  the  lion,  it   can  only  face  towards  it  and  then  turn  around).      It  will  continue  to  take  small   steps  away  from  the  lion  until  the  lion  is  more  than  10  steps  away,  when  the   rabbit  will  wiggle  again.