GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • All topics
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 20 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
Log inStart free
Gamified challengesLooping Robot

Gamified challenge · Simulation

Looping Robot

A robot starts at (0, 0) facing north on an endless floor. Its program is a string of G (step forward one square), L (turn 90° left on the spot) and R (turn 90° right on the spot). When it reaches the end of the program it starts again from the beginning, forever.

Write bounded(program) that returns true if the robot never leaves some circle around the start, and false if it drifts away without limit. Example: "GGLLGG" walks north 2, turns round and walks back, so it is true; "GG" walks north forever, so it is false. An empty program never moves: true.

Sign in to play Looping Robot

This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.

Sign in with Google

or log in with email · create an account