This is another assignment for the Viking Code School
You live in a 25 story building with one elevator. The central microcontroller got eaten by rats and the building manager has asked you to code up the elevator’s operating procedure until he can get a new one. You figure you’ll have to learn to actually code soon but you first want to think things through and pseudocode your design.
Your job is to design a properly working elevator. It should stop on each floor it is physically able to during a given trip to pick up whoever is going the same direction. Additionally, make sure that no one is:
- smashed into the ground
- pushed through the roof
- squished by the doors
- let off in between floors
- stuck going the wrong direction (unless they choose not to exit)
This will be good practice thinking about all the edge cases and scenarios that a user can do.
The point isn’t to follow any strict guidelines of syntax but rather to focus on getting the logic of the problem figured out and then organizing it into modules that accomplish the sub-tasks that are required.
- Using a loop around everything to keep your pseudocode (and elevator) running.
- Writing everything in one giant mess to start with and then refactoring it to break apart the modules so it feels less cluttered and messy.
This is Pseudo-Code.elevator1