Bender Depressed Robot : declare function to detect loop