HackerRank challenge: Write a simple bot and understand the concept of Perception-Action cycles