Hotel

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

Hotel is an esoteric programming language designed by user k.

Hotel takes place in a building designed by the user, in which each floor has 8 rooms (1-8).

Designing a Building

To design a building, you will first need a strong foundation. Keep in mind that the lowest floor has to be a foundation, but other floors can also incorporate foundation elements.

Foundation Bases
Character Description Effects
/ Frail on its own, but sturdier if next to \. -1 On its own / +2 next to \
\ Frail on its own, but sturdier if next to /. -1 on its own / +2 next to /
| Solid foundation, but could get very damaged if there is a water leak or earthquake. +1 without water leak or earthquake / 0 when water leak or earthquake
# Very good foundation, but it is recommended to not put two of them next to eachother, as earthquakes can snap them in half. +2 on its own, 0 when next to itself, -2 when earthquakes, -4 when earthquakes and next to itself

You can arrange these parts by surrounding them in walls. There are 2 walls, which both do the same thing :

Walls
Character
{}
)(

Stacking floors

Every floor has to be the same length character-wise.

{floor 3}

{floor 2}

{floor 1}

{|||||||}

This is an example of a very basic building. However, it is missing an essential part:

Elevators

Elevators are an essential part of Hotel programs, as they are the only flow control element.

There are 4 characters an elevator can contain. Each does something different.

Elevators
Character Description
^ When the elevator is reached, go up a floor.
v Goes down a floor if the current floor is empty.
< Goes back to the start of a floor if the last checked room in that floor is not empty and the person in that room isn't broke.
> If every room on the current floor is full, then remove the latest person to get on the elevator from the elevator.

It is recommended that elevator commands are surrounded in square brackets.

Coding a floor

The code in a floor is what controls who comes in from the elevator and back out.

Commands
Character Description
$ Adds $1 to the latest person on the elevator's bank account.
% Removes $1 from the latest person on the elevator's bank account.
! Takes the person in the current room and puts them on the elevator.
? Puts a person from the elevator into the current room.
@ Takes a person from the deepest pits of hell who has forgotten their identity and lost all their money and teleports them into the elevator.
" Prints the latest person to get into the elevator's name.
' Prints the latest person to get into the elevator's financial status.
= Moves the latest person to get into the elevator to the back of the line.
_ Concatinates the next ascii character to the end of the latest person to get into the elevator's name, and skips that character.
; Gets an input and concatinates it to the end of the latest person to get into the elevator's name.
+ Gets an input and adds it to the end of the latest person to get into the elevator's bank account.

Events

Every hotel has a stability score. These are affected by the foundation and the walls. If a hotel's stability score drops to 0 or lower, it collapses and the program stops immediatly.

Events can randomly happen :


Earthquake : 1/100 chance every command

Downpour  : 1/100 chance every command

Water leak : 1/25 chance every command


There is a 1/10 chance every command that every event will turn off.

Examples

"Hello, world!" program :

{@_H_e_l_l_o_,_ _W_o_r_l_d_!"[^]}

)/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\|(


Implementations

A Lua implementation is currently being created.