Back to Parent

Psuedocode:

runSimulation:
for each person
  if round = 1
    location = center
    direction = corner
   else if round = 2
     location = corner
     direction = center
   else
     location = random
     direction = random
   timer = 0
   if round = 5
    walk backwards
   else
    walk
if round = 4
  phone in pocket
else
  phone in hand
while timer < 120
  if timer mod 30 = 0 /*multiple of 30 seconds/*
     direction = random
  if person1 bumps person2
     person1 direction = person2 direction
     person2 direction = person1 direction
  if person bumps object not person
     if round = 1 or 2
       turn right
  else if round = 4
     turn left
  else
     if (timer div 10) mod 2 = 0 /*10s digit of seconds is even*/
         turn right
     else
         turn left
  increment timer
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0