First rule of fight club is that we dont talk about fight club.. ;)
Today we tested our fight program, and we had a detailed review of the program.
Our winner was Maddy, the girl robot!
This program offers students a look into how an actual program would operate and control a robot.
We had functions that would read sensors and return a value. For instance the left-eye function would tell us how close something is to us on the left, and the right-eye function would do the same for the right.
We then would call simple functions that we created and reviewed in class. Like the average and absolute difference functions. These functions would return the average or difference between the left and right eye inputs. This would allow us to make decisions on what course of action to take.
Here is Maddy! The Winner of Fight Club! and her operator!
Here is the average function:
to average :a :b
output ( (:a + :b) / 2 )
This is how it is called to set the variable eyeavg:
seteyeavg average lefteye righteye
I will be posting an entry where I dissect the program and explain it line by line.
Maddy in action!