« Schematic - Round 2 (Class Final) | Main | flocking continued 12_16_04 »

December 16, 2004

psudo code for better flocking pre-alpha

some jibber jabber to get me thinking

if there is a light on left
set leftPhotolightVar = true
end it

if there is a light on right
set rightPhotolightVar = true
end it

if there is a light on center
set centerPhotolightVar = true
end it

is the leftPhotolightVar = true?
is the turnCounter < Y
turn leftForward
is the center lit?
turnCounter = 0
leftPhotolightVar
foundCenter = true
else
turnCounter = 0
end if
end if

if foundCenter = true
go forward
lastFoundCenter = true
else
if lasfFoundcenter = true
iLostit = true
endif
endif

if iLostit
sine and cos the motors? look and then just move around
endif

ir behavior routine here

Posted by cm1002 at December 16, 2004 05:31 PM

Comments

Post a comment




Remember Me?