Code Guru Challenge 3
Written by Jibrael Jos, PhD
In this challenge, reaching
Level 3 Very Good
Level 5 Excellent
Level 0
Create an array in Python of size 10 by 10
Fill it with Zeros
Place in 5,5 position number 1
Place a number 2 in position 0,0
Level 1(Ant goes towards Sugar)
Assume 0 is empty space , 1 is Sugar, 2 is an ant
In every iteration of a loop
Get Pramila Madhava & Jibrael Jos, PhD’s stories in your inbox
Join Medium for free to get updates from this writer.
Ant should move towards the Sugar particle
When it reaches Sugar, then Sugar(1) in the cell will be replaced by Ant (2)
Level 2 (Two Sugar Particles)
Add two particles of sugar in 5,5 and 3,8
Ant should move towards the closest sugar
Level 3 (Two Ants, Two Sugar Particles)
Add two particles of sugar in 5,5 and 3,8
Add two Ants 0,0 and 9,9
Both Ants should move towards the closest sugar
Level 4(Continue Eating)
Even after eating 1 sugar particle, Ants should move to the next closest Sugar
Level 5(Dynamic Search)
In case one Ant eats a sugar particle, the other ant should stop walking in that direction




