ARTICLE AD BOX
I am a university student working on a Data Structures lab about simulating maze navigation using a stack with limited memory.
The stack must have a fixed capacity of 25 moves, and the movement rules are:
Move forward → push(direction) → +10 points
Dead-end → pop() → –5 points
Current position → peek/top
Try to push when stack is full → overflow (–20 points)
Try to pop when stack is empty → underflow
Exit reached → +50 points
Example movement sequence:
push("Left") push("Right") pop() # dead-end push("Forward") push("Left") push(...) # beyond stack capacity → test overflow pop repeatedly # return to startWhat I need help with:
Stack implementation using a Python list (no built-in stack libraries)
Handling overflow, underflow, and scoring
Printing stack content and score after each move
Missing Code:
I started defining a stack class but I am unsure how to apply scoring and full/empty conditions properly.
I need a complete example that simulates the sequence above and prints stack state and score step-by-step.
Preferred language: Python
Thanks!
