Nature of code - Autonomous agents exercise 6.2


I am trying to do the exercise 6.2 from The Nature of Code Autonomous Agents chapter.

I did something like this but is not working:

I looked on the github repository for this exercise, but it doesn’t seem to do what the exercise says.

Is anybody that did this exercise ? and if yes, can you give me some tips please ?
If you need the full source code, please let me know.

Thank you!