A practical lesson in programming can come in the form of a game. Elevator Saga – The elevator programming game is a simple simulation of an elevator in a building responding to requests for service. There are multiple levels with increasingly different challenges. You must improve the logic employed as the challenges become more demanding, the number of elevators increase, and the number of floors increase.
At play.elevatorsaga.com, you are given a space for your code and a visualization of the elevator responding to your code. The first level is beatable by asking the elevator to visit each floor in a loop. To accomplish that, you can edit the code to add another line from the starting template to include the top floor. Hitting the apply button will reset the simulation and load your latest batch of code.
The interface shows you the statistics of your elevator and provides the ability to pause or speed up the visualization component.
The elevator, seen below, indicates multiple elevators responding to many people across several different floors, trying to move them fast enough to beat the challenge.
You can take a shot at creating a very efficient program to control the elevators at play.elevatorsaga.com. You can also read the Help and API documentation to learn more about the capabilities of the code within Elevator Saga. You can also find the source code available on Github.