Dubai
The problem of implementing an elevator that opens onto a large number of floors often challenges novice interactive fiction authors. It also raises a fundamental design problem -- how to implement a large building in an interesting way. It is tempting to write a hotel with an elevator and innumerable tedious and identical floors just for the sake of realism; in many cases it is a better idea simply to omit any locations that contribute nothing to the story or the play of the game.
In charity, though, let us assume that the author has a legitimate reason for wanting to implement an elevator that opens onto some generic floors. We will go whole-hog, and set this in the world's tallest hotel: Burj al-Arab, Dubai.
(Since our budget did not run to visiting Burj al-Arab, the descriptions place implicit faith in the hotel's website.)
level | floor |
0 | Al Mahara |
1 | Burj al-Arab Lobby |
2 | Al Iwan |
3 | Juna Lounge |
4 | Sahn Eddar |
15 | Al Falak Ballroom |
18 | Assawan Spa |
24 | Presidential Suite |
25 | Royal Suite |
27 | Al Muntaha |
Test me with "press 3 / in / press button 3 / look / out / in / press 27 / out / s / in / n / in / press 15 / out / in / press 18 / out / s / in / n / in / press 4 button / out".
The 202-suite Burj al-Arab - or Tower of the Arabs - stands 321 metres (1,060 feet) high, and floats on its own man-made island. It is shaped like the sail of a boat; just crossing the private bridge to reach this place set you back $55.
You can enter the elevator here.
>(Testing.)
>[1] press 3
You cannot control the express panoramic lift unless you are yourself inside.
>[2] in
Lift
This is not a mere elevator: it is an express panoramic lift, traveling six meters a second, and capable of taking you from lobby to the rooftop restaurant in an astonishingly short time. The illuminated number above the door says 1 - though you can make it move by pressing a numbered button.
>[3] press button 3
You press button 3. The lift whirs into action and moves to the correct level.
>[4] look
Lift
This is not a mere elevator: it is an express panoramic lift, traveling six meters a second, and capable of taking you from lobby to the rooftop restaurant in an astonishingly short time. The illuminated number above the door says 3 - though you can make it move by pressing a numbered button.
>[5] out
Juna Lounge
Two humidors that offer one of the largest selections of the finest Havana cigars in Dubai.
You can enter the elevator here.
>[6] in
Lift
This is not a mere elevator: it is an express panoramic lift, traveling six meters a second, and capable of taking you from lobby to the rooftop restaurant in an astonishingly short time. The illuminated number above the door says 3 - though you can make it move by pressing a numbered button.
>[7] press 27
You press button 27. The lift whirs into action and moves to the correct level.
>[8] out
Al Muntaha
A top-floor restaurant with a magnificent view: the name means the ultimate or the highest, suitable for a place that stands at 200 metres above the Arabian Gulf. It offers modern European cuisine; and just off to the south is the Skyview Bar.
You can enter the elevator here.
>[9] s
Skyview Bar
"A wonderful location for pre- and post dinner drinks," claims the hotel's brochure, and certainly you can't fault the view.
>[10] in
You can't go that way.
>[11] n
Al Muntaha
A top-floor restaurant with a magnificent view: the name means the ultimate or the highest, suitable for a place that stands at 200 metres above the Arabian Gulf. It offers modern European cuisine; and just off to the south is the Skyview Bar.
You can enter the elevator here.
>[12] in
Lift
This is not a mere elevator: it is an express panoramic lift, traveling six meters a second, and capable of taking you from lobby to the rooftop restaurant in an astonishingly short time. The illuminated number above the door says 27 - though you can make it move by pressing a numbered button.
>[13] press 15
You press button 15. The lift whirs into action and moves to the correct level.
>[14] out
Al Falak Ballroom
A palatial, two-tiered, domed ballroom crowned with a unique crystal chandelier.
You can enter the elevator here.
>[15] in
Lift
This is not a mere elevator: it is an express panoramic lift, traveling six meters a second, and capable of taking you from lobby to the rooftop restaurant in an astonishingly short time. The illuminated number above the door says 15 - though you can make it move by pressing a numbered button.
>[16] press 18
You press button 18. The lift whirs into action and moves to the correct level.
>[17] out
Assawan Spa
Treatment rooms, hydrotherapy baths, oriental massage, stand-up solarium, sauna, steam rooms and jacuzzi, two swimming pools, squash court, two fully equipped fitness studios and an aerobics floor. To the south is a shopping area, for those who do not find exercise adequately therapeutic.
You can enter the elevator here.
>[18] s
Shopping Area
In a setting that would make a poet sigh, you may enjoy the services of (among others) Bulgari, Black Pearl Caviar, Albarajeel Carpet Shop, Abdul Samed Al Qurashi (amber and Arabic perfumes), Dianoor (jewellery), and the Commercial Bank of Dubai.
>[19] in
You can't go that way.
>[20] n
Assawan Spa
Treatment rooms, hydrotherapy baths, oriental massage, stand-up solarium, sauna, steam rooms and jacuzzi, two swimming pools, squash court, two fully equipped fitness studios and an aerobics floor. To the south is a shopping area, for those who do not find exercise adequately therapeutic.
You can enter the elevator here.
>[21] in
Lift
This is not a mere elevator: it is an express panoramic lift, traveling six meters a second, and capable of taking you from lobby to the rooftop restaurant in an astonishingly short time. The illuminated number above the door says 18 - though you can make it move by pressing a numbered button.
>[22] press 4 button
You press button 4. The lift whirs into action and moves to the correct level.
>[23] out
Sahn Eddar
At the base of the world's tallest atrium, the Sahn Eddar restaurant offers light fine fare and Afternoon Tea. At the center, a 32-meter water column leaps toward the roof of the atrium.
You can enter the elevator here.
This will all work very well, unless the player has portable objects; in that case, anything he drops on the Generic Floor will be there every time he goes back -- whether it's masquerading as Floor 6 or Floor 23. There are there are two ways round this -- (i) the cheeky way. When we drop something, the unobtrusive yet ever-vigilant maids pick it up and take it down to the Foyer's lost property office; and (ii) the super-duper way, in which things are moved out of play but with their floor numbers remembered, so that the scenario can be reconstructed each time. (i) is probably in fact the more true-to-life, considering the hotel's boasts about its service, but we will demonstrate both methods.
Here is the version with vigilant maids:
Notice that we tie the maid service to the pressing of the lift button, so that if the player just goes into the lift and comes out again, the maids will not have had a chance to clear his possessions.
Alternatively:
The "enclosed by" line clears even things left on, say, small un-portable side-tables or whatever; but because we do "in" first, we make sure to move any containers or supporters undisturbed. The next bit could be more tidily incorporated into our previous "before going outside" rule, but since we are writing this code to be optionally pasted onto the end of the first bit, we'll express the rule separately:
And now we have a situation in which the player's valuables are left untouched wherever in the hotel he happens to abandon them.
Incidentally, this example was almost set in an entirely different location: the largest hotel in the world may some day be the Ryugyong Hotel in Pyongyang, North Korea, with its 105 floors -- but for some years construction halted at the creation of the building's huge concrete shell.