← Back to Games
Spiral Runner
Watch boundaries shrink as you traverse the matrix in spiral order!
Top
0
Right
0
Bottom
0
Left
0
Layer:
1
→
Moving Right
New Matrix
Step →
▶ Auto Spiral
Reset
0
Visited
0
Total
🌀 Spiral Traversal Output
Elements will appear here...
📐 Spiral Traversal Algorithm
while (top <= bottom && left <= right) {
// 1. Top row: left → right, then top++
// 2. Right col: top → bottom, then right--
// 3. Bottom row: right → left, then bottom--
// 4. Left col: bottom → top, then left++
}