From UBC Wiki

Escape Game

Authors: Jenny Ngo & Chris Ren

What is the problem?

The player forgot her laptop somewhere in the house. Trying to find it, pick it up, then head back outside of the house. Similar to a maze game.

What is the something extra?

Must have picked up a flashlight from a previous room to enter a room with the light off. Must remove shoes before moving around in the house.

What did we learn from doing this?

Is functional programming suitable for (part-of) the task?

Yes it was fairly easy to program this game using prolog. To implement dynamic aspects, we just had to use retract and assert to change the states.

However, it did feel redundant having to repeat the conditions numerous times. For example, to create two rooms that were connected, it had to be done twice - once for one direction and again for the opposite direction. Also for conditions we had to write long lines of code using negation instead of an if else statement.

Links to code etc

Got the idea of a maze game from slide 14 of this pdf: https://www.cl.cam.ac.uk/teaching/0809/Prolog/Prolog08ML4R2.pdf