dark mode light mode Search Menu

The Game of Ups and Downs

Andrés Moreno on Flickr

Elevator Saga is a free JavaScript coding game that you can play in your web browser. Players are presented with challenges in programming an elevator system to meet a passenger quota within a specific time. Each completed challenge increases the complexity – more floors to service, more elevators, and more passengers to carry to their destinations. This game works best for intermediate-level coders familiar with JavaScript. Reading the documentation will help, too!

Elevator Saga is event-driven: the elevator and call buttons trigger events, and you can assign functions like floor_button_pressed, and passing_ floor when these events occur. Ultimately, the game is about making decisions, the same way an elevator makes decisions. For example, is your elevator going up or down? When you pass a floor, is there anyone waiting to board the elevator going in its current direction? It’s also helpful to keep track of which floor buttons have been pushed and for which direction—up or down.

Finally, there is a Solutions page to show you how others have solved the game and made the game work for them. You can copy and paste the solution code into the game and modify it if you want to play and learn how the game and JavaScript work.