diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..58bb00be --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ + +.ipynb_checkpoints/main-checkpoint.ipynb +main-checkpoint.ipynb +your-code/sample-code-Copy1.ipynb diff --git a/main.ipynb b/main.ipynb new file mode 100644 index 00000000..b6c1c1de --- /dev/null +++ b/main.ipynb @@ -0,0 +1,802 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 368 + }, + "id": "0YdTQaHuD6HC", + "outputId": "f24fab80-de5e-4b7a-a8bc-dc577faa28f1" + }, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (, line 19)", + "output_type": "error", + "traceback": [ + "\u001b[1;36m File \u001b[1;32m\"\"\u001b[1;36m, line \u001b[1;32m19\u001b[0m\n\u001b[1;33m \"value\": 5,\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n" + ] + } + ], + "source": [ + "# define rooms and items\n", + "count = 50\n", + "from colorama import Fore, Back, Style\n", + "from PIL import Image \n", + "# ============================ Games ==================================\n", + "game1 = {\n", + " \"name\": \"game_1\",\n", + " \"type\": \"game\",\n", + " \"question\": \" How much is 1 + 1? and it is not 7 BTW. If you dont get it is beacause you are not spanish and you are too old or maybe i am\",\n", + " \"value\": 5,\n", + " \"btw\": \"i think you get it. it was´t so difficult right? '(It's a rhetorical question, you don't have to answer me, well, you can't)'\" + '\\n'\n", + "}\n", + "\n", + "game2 = {\n", + " \"name\": \"game_2\",\n", + " \"type\": \"game\",\n", + " \"question\": \" can god create a rock he cannot lift? i will help you, the possible answer is: 'yes', 'no' or 'maybe' if you want to discouse with the game answer try next time. In this case i am like god what i decise it is the truth.\",\n", + " \"answer\": \"maybe\"\n", + " \"value\": 5,\n", + " \"btw\": \"yes it is maybe. because we need to get more information. If god is powerfull it mean he can create. however if he cant not lift it he is not enought powerfull\" + '\\n'\n", + "}\n", + "\n", + "game3 = {\n", + " \"name\": \"game_3\",\n", + " \"type\": \"game\",\n", + " \"question\": \"it is a pikachu, do you have a pokeball? i dont think so. Bad luck this happen only one time in life. so... i will give you the anwser this time type 'no'\",\n", + " \"answer\": \"no\" \n", + " \"value\": 5,\n", + " \"btw\": \"Sorry, a pikachu is too much for you try maybe with a magikarp\" + '\\n' \n", + "}\n", + "\n", + "game4 = {\n", + " \"name\": \"game_4\",\n", + " \"type\": \"game\",\n", + " \"question\": \"Which team is going to win?\",\n", + " \"answer\": \"spooky pumpkins\" \n", + " \"value\": 5,\n", + " \"btw\": \"yes you are right, spooky pumpkins are going to win, if it doesn't happen this invisible rabbit will disappear!. so you know who to vote for\" + '\\n' \n", + "}\n", + "\n", + "door_bonus = {\n", + " \"name\": \"door_bonus\",\n", + " \"type\": \"game\",\n", + " \"question\": \"This is a bonus room, you dont need to use a Key you need to use a the code. It should be something like the number pi. Good Luck! \",\n", + " \"answer\": \"3,14\" \n", + "}\n", + "\n", + "# ============================ Doors ==================================\n", + "\n", + "\n", + "door_a = {\n", + " \"name\": \"door a\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_b = {\n", + " \"name\": \"door b\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_c = {\n", + " \"name\": \"door c\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_d = {\n", + " \"name\": \"door d\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_e = {\n", + " \"name\": \"door e\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_f = {\n", + " \"name\": \"door f\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_g = {\n", + " \"name\": \"door g\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_h = {\n", + " \"name\": \"door h\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_i = {\n", + " \"name\": \"door i\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_j = {\n", + " \"name\": \"door j\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_k = {\n", + " \"name\": \"door k\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_l = {\n", + " \"name\": \"door l\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_t = {\n", + " \"name\": \"door t\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_m = {\n", + " \"name\": \"door m\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "\n", + "\n", + "# ============================ Keys ==================================\n", + "\n", + "key_a = {\n", + " \"name\": \"key for door a\",\n", + " \"type\": \"key\",\n", + " \"target\": door_a,\n", + " \"value\": 8,\n", + "}\n", + "\n", + "key_b = {\n", + " \"name\": \"key for door b\",\n", + " \"type\": \"key\",\n", + " \"target\": door_b,\n", + "}\n", + "\n", + "key_c = {\n", + " \"name\": \"key for door c\",\n", + " \"type\": \"key\",\n", + " \"target\": door_c,\n", + "}\n", + "\n", + "key_d = {\n", + " \"name\": \"key for door d\",\n", + " \"type\": \"key\",\n", + " \"target\": door_d,\n", + "}\n", + "\n", + "key_e = {\n", + " \"name\": \"key for door e\",\n", + " \"type\": \"key\",\n", + " \"target\": door_e,\n", + "}\n", + "\n", + "key_f = {\n", + " \"name\": \"key for door f\",\n", + " \"type\": \"key\",\n", + " \"target\": door_f,\n", + "}\n", + "\n", + "key_g = {\n", + " \"name\": \"key for door g\",\n", + " \"type\": \"key\",\n", + " \"target\": door_g,\n", + "}\n", + "\n", + "key_h = {\n", + " \"name\": \"key for door h\",\n", + " \"type\": \"key\",\n", + " \"target\": door_h,\n", + "}\n", + "\n", + "key_i = {\n", + " \"name\": \"key for door i\",\n", + " \"type\": \"key\",\n", + " \"target\": door_i,\n", + "}\n", + "\n", + "key_j = {\n", + " \"name\": \"key for door j\",\n", + " \"type\": \"key\",\n", + " \"target\": door_j,\n", + "}\n", + "\n", + "\n", + "key_k = {\n", + " \"name\": \"key for door k\",\n", + " \"type\": \"key\",\n", + " \"target\": door_k,\n", + "}\n", + "\n", + "\n", + "key_l = {\n", + " \"name\": \"key for door l\",\n", + " \"type\": \"key\",\n", + " \"target\": door_l,\n", + "}\n", + "\n", + "key_m = {\n", + " \"name\": \"key for door m\",\n", + " \"type\": \"key\",\n", + " \"target\": door_m, \n", + "}\n", + "\n", + "# ============================ Furnitures ==================================\n", + "\n", + "# ========= Game Room =========\n", + "\n", + "piano = {\n", + " \"name\": \"piano\",\n", + " \"type\": \"furniture\",\n", + " \"value\": 7,\n", + "}\n", + "\n", + "couch = {\n", + " \"name\": \"couch\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "round_table = {\n", + " \"name\": \"round table\",\n", + " \"type\": \"furniture\"\n", + "}\n", + "# ========= Bathroom =========\n", + "\n", + "bathtub = {\n", + " \"name\": \"bathtub\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "sink = {\n", + " \"name\": \"sink\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "toilet = {\n", + " \"name\": \"toilet\",\n", + " \"type\": \"furniture\",\n", + " \"value\": 2,\n", + "}\n", + "\n", + "# ========= Bedroom 1 =========\n", + "\n", + "queenbed = {\n", + " \"name\": \"queenbed\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dressing_table = {\n", + " \"name\": \"dressing table\",\n", + " \"type\": \"furniture\", \n", + "}\n", + "\n", + "# ========= Bedroom 2 =========\n", + "\n", + "doublebed = {\n", + " \"name\": \"doublebed\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dresser = {\n", + " \"name\": \"dresser\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "desktop = {\n", + " \"name\": \"desktop\",\n", + " \"type\": \"furniture\", \n", + "}\n", + "\n", + "desktop_chair = {\n", + " \"name\": \"desktop chair\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Living Room =========\n", + "\n", + "dining_table = {\n", + " \"name\": \"dining table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table_chair_1 = {\n", + " \"name\": \"dining table chair 1\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table_chair_2 = {\n", + " \"name\": \"dining table chair 2\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table_chair_3 = {\n", + " \"name\": \"dining table chair 3\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table_chair_4 = {\n", + " \"name\": \"dining table chair 4\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table_chair_5 = {\n", + " \"name\": \"dining table chair 5\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Dungeon =========\n", + "\n", + "bucket = {\n", + " \"name\": \"bucket\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "torture_table = {\n", + " \"name\": \"torture table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "blood_table = {\n", + " \"name\": \"blood table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= corridor =========\n", + "\n", + "\n", + "# ========= Lab =========\n", + "\n", + "flasks_cabinet = {\n", + " \"name\": \"flasks cabinet\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "table_lab = {\n", + " \"name\": \"randowm table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Kitchen =========\n", + "\n", + "kitchen_table = {\n", + " \"name\": \"kitchen table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "kitchen_sink = {\n", + " \"name\": \"kitchen sink\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "kitchen_countertop = {\n", + " \"name\": \"kitchen countertop\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "vitroceramic = {\n", + " \"name\": \"vitroceramic\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Bait Room =========\n", + "\n", + "toys_trunk = {\n", + " \"name\": \"toys trunk\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "candy_cabinet = {\n", + " \"name\": \"candy cabinet\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "console_station = {\n", + " \"name\": \"Xbox\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Dinning Room =========\n", + "\n", + "cabinet = {\n", + " \"name\": \"cabinet\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table = {\n", + " \"name\": \"dinning_table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_1 = {\n", + " \"name\": \"dinning_table chair 1\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_2 = {\n", + " \"name\": \"dinning_table chair 2\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_3 = {\n", + " \"name\": \"dinning_table chair 3\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_4 = {\n", + " \"name\": \"dinning_table chair 4\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_5 = {\n", + " \"name\": \"dinning_table chair 5\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_6 = {\n", + " \"name\": \"dinning_table chair 6\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_7 = {\n", + " \"name\": \"dinning_table chair 7\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_8 = {\n", + " \"name\": \"dinning_table chair 8\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "# ========= Entrance =========\n", + "\n", + "bench = {\n", + " \"name\": \"bench\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ============================ Rooms ==================================\n", + "\n", + "game_room = {\n", + " \"name\": \"game_room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map1.png\",\n", + "}\n", + "\n", + "bedroom_1 = {\n", + " \"name\": \"bedroom 1\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map3.png\",\n", + "}\n", + "\n", + "bathroom = {\n", + " \"name\": \"bathroom\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map2.png\",\n", + "}\n", + "\n", + "bedroom_2 = {\n", + " \"name\": \"bedroom 2\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map4.png\",\n", + "}\n", + "\n", + "living_room = {\n", + " \"name\": \"living room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map6.png\",\n", + "}\n", + "\n", + "dungeon = {\n", + " \"name\": \"dungeon\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map5.png\",\n", + "}\n", + "\n", + "kitchen = {\n", + " \"name\": \"kitchen\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map9.png\",\n", + "}\n", + "\n", + "lab = {\n", + " \"name\": \"lab\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map8.png\",\n", + "}\n", + "\n", + "bait_room = {\n", + " \"name\": \"bait room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map11.png\",\n", + "}\n", + "\n", + "dinning_room = {\n", + " \"name\": \"dinning room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map10.png\",\n", + "}\n", + "\n", + "corridor = {\n", + " \"name\": \"corridor\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map7.png\",\n", + "}\n", + "\n", + "entrance = {\n", + " \"name\": \"entrance\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map12.png\",\n", + "}\n", + "\n", + "outside = {\n", + " \"name\": \"outside\"\n", + "}\n", + "\n", + "all_rooms = [game_room, bathroom, bedroom_1, bedroom_2, living_room, dungeon, corridor, kitchen, lab, bait_room, dinning_room, entrance, outside]\n", + "\n", + "all_doors = [door_a, door_b, door_c, door_d, door_t, door_bonus, door_e, door_f, door_g, door_h, door_i, door_j, door_k, door_l]\n", + "\n", + "# define which items/rooms are related\n", + "\n", + "object_relations = {\n", + " # ===== Rooms =====\n", + " \n", + " \"game_room\": [couch, piano, door_a, door_t, door_e, game1],\n", + " \"living room\": [dining_table, door_g, dinning_table_chair_1, dinning_table_chair_2, dinning_table_chair_3, dinning_table_chair_4, dinning_table_chair_5 ],\n", + " \"bedroom 2\": [doublebed, dresser, door_b],\n", + " \"bedroom 1\": [queenbed, door_b, door_a, door_c, door_f],\n", + " \"bathroom\": [toilet, door_e, bathtub, sink],\n", + " \"dungeor\": [door_f,torture_table, blood_table, bucket],\n", + " \"kitchen\": [door_i, door_k, kitchen_table, kitchen_countertop, vitroceramic],\n", + " \"lab\": [door_j, door_i, door_h,flasks_cabinet, table_lab],\n", + " \"dinning room\": [dining_table, door_k, dinning_table_chair_1, dinning_table_chair_2, dinning_table_chair_3, dinning_table_chair_4, dinning_table_chair_5, dinning_table_chair_6, dinning_table_chair_7, dinning_table_chair_8, cabinet],\n", + " \"bait room\": [door_m, door_j, candy_cabinet, console_station, toys_trunk],\n", + " \"entrance\": [bench, door_l, door_m],\n", + " \n", + " # ===== keys =====\n", + " \n", + " \"piano\": [key_e],\n", + " \"queenbed\": [key_b],\n", + " \"dresser\": [key_d],\n", + " \"doublebed\": [key_f],\n", + " \"toilet\": [key_a],\n", + " \"bucket\": [key_c],\n", + " \"desktop\": [key_g],\n", + " \"dining table chair 4\": [key_h],\n", + " \"flask cabinet\": [key_i],\n", + " \"vitroceramic\": [key_j],\n", + " \"candy cabinet\": [key_k],\n", + " \"cabinet\": [key_m],\n", + " \"bench\": [key_l],\n", + " \n", + " \n", + " # ===== Doors =====\n", + "\n", + " \"door a\": [game_room, bedroom_1],\n", + " \"door b\": [bedroom_1, bedroom_2],\n", + " \"door c\": [bedroom_1, living_room],\n", + " \"door d\": [living_room, outside],\n", + " \"door e\": [game_room, bathroom],\n", + " \"door t\": [game_room],\n", + " \"door_bonus\": [game_room, bedroom_1],\n", + " \"outside\": [door_d]\n", + "} \n", + "\n", + "\n", + "# define game state. Do not directly change this dict. \n", + "# Instead, when a new game starts, make a copy of this\n", + "# dict and use the copy to store gameplay state. This \n", + "# way you can replay the game multiple times.\n", + "\n", + "INIT_GAME_STATE = {\n", + " \"current_room\": game_room,\n", + " \"keys_collected\": [],\n", + " \"target_room\": outside\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "RlvwftR0DnuK" + }, + "outputs": [], + "source": [ + "def linebreak():\n", + " \"\"\"\n", + " Print a line break\n", + " \"\"\"\n", + " print(\"\\n\\n\")\n", + "\n", + "def start_game():\n", + " \"\"\"\n", + " Start the game\n", + " \"\"\"\n", + " print(\"You wake up on a couch and find yourself in a strange house with no windows which you have never been to before. You don't remember why you are here and what had happened before. You feel some unknown danger is approaching and you must get out of the house, NOW!\" + '\\n')\n", + " print(\"You start with 50 points and the interaction with each object in each room will take point off. sometimes. However you can get extra point if you play each room minigame. So good luck, you will need it.\" + \"\\n\" + \"BTW if you find a problem it is not the game is you than does not understand how to play jajaja.\")\n", + " play_room(game_state[\"current_room\"])\n", + "\n", + " \n", + "def start_game_because_you_die():\n", + " \"\"\"\n", + " Start the game\n", + " \"\"\"\n", + " print(Fore.RED + \"you die, start again\")\n", + " play_room(game_state[\"current_room\"])\n", + "\n", + "\n", + "def play_room(room):\n", + " \"\"\"\n", + " Play a room. First check if the room being played is the target room.\n", + " If it is, the game will end with success. Otherwise, let player either \n", + " explore (list all items in this room) or examine an item found here.\n", + " \"\"\"\n", + " game_state[\"current_room\"] = room\n", + " if(game_state[\"current_room\"] == game_state[\"target_room\"]):\n", + " print(Fore.RED + \"Congrats! You escaped the room!\")\n", + " else:\n", + " play_sound()\n", + " #print(\"You are now in \" + room[\"name\"])\n", + " print(Fored.Blue + \"You are now in \" + room[\"name\"]+\" the \"+ meet_monster()+\" welcomes you!\" + '\\n')\n", + " intended_action = input(\"What would you like to do? Type '1' for explore, type '0' for examine, '2' for check the map or '3' to see you current points\").strip()\n", + " if intended_action == \"1\":\n", + " explore_room(room)\n", + " play_room(room)\n", + " elif intended_action == \"0\":\n", + " examine_item(input(\"What would you like to examine?\").strip())\n", + " elif intended_action == \"2\":\n", + " map = Image.open(room[\"map\"])\n", + " map.show()\n", + " play_room(room)\n", + " elif intended_action == \"3\":\n", + " print(count)\n", + " play_room(room)\n", + " else:\n", + " print(Fored.Red + \"Not sure what you mean. Type 'explore' or 'examine'.\")\n", + " play_room(room)\n", + " linebreak()\n", + "\n", + "def explore_room(room):\n", + " play_sound('ghosts.mp3')\n", + " \"\"\"\n", + " Explore a room. List all items belonging to this room.\n", + " \"\"\"\n", + " items = [i[\"name\"] for i in object_relations[room[\"name\"]]]\n", + " print(\"You explore the room. This is \" + room[\"name\"] + \". You find \" + \", \".join(items))\n", + "\n", + "def get_next_room_of_door(door, current_room):\n", + " play_sound('pain.mp3')\n", + " \"\"\"\n", + " From object_relations, find the two rooms connected to the given door.\n", + " Return the room that is not the current_room.\n", + " \"\"\"\n", + " connected_rooms = object_relations[door[\"name\"]]\n", + " for room in connected_rooms:\n", + " if(not current_room == room):\n", + " return room\n", + "\n", + "\n", + "def examine_item(item_name):\n", + " \"\"\"\n", + " Examine an item which can be a door or furniture.\n", + " First make sure the intended item belongs to the current room.\n", + " Then check if the item is a door. Tell player if key hasn't been \n", + " collected yet. Otherwise ask player if they want to go to the next\n", + " room. If the item is not a door, then check if it contains keys.\n", + " Collect the key if found and update the game state. At the end,\n", + " play either the current or the next room depending on the game state\n", + " to keep playing.\n", + " \"\"\"\n", + " current_room = game_state[\"current_room\"]\n", + " next_room = \"\"\n", + " output = None\n", + " global count\n", + " for item in object_relations[current_room[\"name\"]]:\n", + " if(item[\"name\"] == item_name):\n", + " output = \"You examine \" + item_name + \". \"\n", + " if(item[\"type\"] == \"door\"):\n", + " have_key = False\n", + " for key in game_state[\"keys_collected\"]:\n", + " if(key[\"target\"] == item):\n", + " have_key = True\n", + " if(have_key):\n", + " output += \"You unlock it with a key you have.\"\n", + " next_room = get_next_room_of_door(item, current_room)\n", + " else:\n", + " output += \"It is locked but you don't have the key.\" + '\\n'\n", + " elif(item[\"type\"] == \"game\"):\n", + " print(\"You fine a mini game called: \" + item[\"name\"] + \"and you need to answer it\" + item[\"question\"])\n", + " play_game = input(item[\"question\"]).strip()\n", + " if play_game != item[\"answer\"]:\n", + " print(Fore.RED + \"So sorry as we can see you are not enought SMART to play it (yes! i want to emphasize it), our recomendation is to try to google it and try again. However, i dont want to waste my time so try to check other things. BYE!\")\n", + " else:\n", + " print(Fore.RED + \"You win\")\n", + " count = count + item[\"value\"]\n", + " if count < 0:\n", + " print(Back.RED + \"you dont have more points\")\n", + " start_game_because_you_die ()\n", + " else:\n", + " if(item[\"name\"] in object_relations and len(object_relations[item[\"name\"]])>0):\n", + " item_found = object_relations[item[\"name\"]].pop()\n", + " game_state[\"keys_collected\"].append(item_found)\n", + " output += \"You find \" + (Fore.RED + item_found[\"name\"]) + \".\"\n", + " else:\n", + " output += \"There isn't anything interesting about it.\"\n", + " print(output + '\\n')\n", + " break\n", + "\n", + " if(output is None):\n", + " print(\"The item you requested is not found in the current room.\")\n", + " \n", + " if(next_room and input(\"Do you want to go to the next room? Ener 'yes' or 'no'\").strip() == 'yes'):\n", + " play_room(next_room)\n", + " else:\n", + " play_room(current_room)\n", + "\n", + "def meet_monster():\n", + " import pandas as pd\n", + " m = pd.read_csv (r'20171019_HalloweenCostumes_Frightgeist2.csv', header=2)\n", + " m1 = m.sample(1).iloc[0,0]\n", + " return m1\n", + "\n", + "def play_sound(sound):\n", + " from playsound import playsound\n", + " return playsound(sound)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "-vK3kjyqr-2a" + }, + "source": [ + "# Nueva sección" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "fbPsc0PCEFRP" + }, + "outputs": [], + "source": [ + "game_state = INIT_GAME_STATE.copy()\n", + "\n", + "start_game()" + ] + } + ], + "metadata": { + "colab": { + "collapsed_sections": [], + "name": "main.ipynb", + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.3" + } + }, + "nbformat": 4, + "nbformat_minor": 1 +} diff --git a/your-code/.ipynb_checkpoints/sample-code-Copy1-checkpoint.ipynb b/your-code/.ipynb_checkpoints/sample-code-Copy1-checkpoint.ipynb new file mode 100644 index 00000000..fd42b148 --- /dev/null +++ b/your-code/.ipynb_checkpoints/sample-code-Copy1-checkpoint.ipynb @@ -0,0 +1,762 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You wake up on a couch and find yourself in a strange house with no windows which you have never been to before. You don't remember why you are here and what had happened before. You feel some unknown danger is approaching and you must get out of the house, NOW!\n", + "You are now in game_room\n", + "What would you like to do? Type '1' for explore, type '0' for examine or type 2 to open the mapexamine\n", + "Not sure what you mean. Type 'explore' or 'examine'.\n", + "You are now in game_room\n", + "What would you like to do? Type '1' for explore, type '0' for examine or type 2 to open the mapexplore\n", + "Not sure what you mean. Type 'explore' or 'examine'.\n", + "You are now in game_room\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "Interrupted by user", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 700\u001b[0m \u001b[0mgame_state\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mINIT_GAME_STATE\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcopy\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 701\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 702\u001b[1;33m \u001b[0mstart_game\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32m\u001b[0m in \u001b[0;36mstart_game\u001b[1;34m()\u001b[0m\n\u001b[0;32m 596\u001b[0m \"\"\"\n\u001b[0;32m 597\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"You wake up on a couch and find yourself in a strange house with no windows which you have never been to before. You don't remember why you are here and what had happened before. You feel some unknown danger is approaching and you must get out of the house, NOW!\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 598\u001b[1;33m \u001b[0mplay_room\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mgame_state\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"current_room\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 599\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 600\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mplay_room\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mroom\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m\u001b[0m in \u001b[0;36mplay_room\u001b[1;34m(room)\u001b[0m\n\u001b[0;32m 621\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 622\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Not sure what you mean. Type 'explore' or 'examine'.\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 623\u001b[1;33m \u001b[0mplay_room\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mroom\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 624\u001b[0m \u001b[0mlinebreak\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 625\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m\u001b[0m in \u001b[0;36mplay_room\u001b[1;34m(room)\u001b[0m\n\u001b[0;32m 621\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 622\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Not sure what you mean. Type 'explore' or 'examine'.\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 623\u001b[1;33m \u001b[0mplay_room\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mroom\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 624\u001b[0m \u001b[0mlinebreak\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 625\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m\u001b[0m in \u001b[0;36mplay_room\u001b[1;34m(room)\u001b[0m\n\u001b[0;32m 609\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 610\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"You are now in \"\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mroom\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"name\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 611\u001b[1;33m \u001b[0mintended_action\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0minput\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"What would you like to do? Type '1' for explore, type '0' for examine or type 2 to open the map\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstrip\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 612\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mintended_action\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"1\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 613\u001b[0m \u001b[0mexplore_room\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mroom\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\ipykernel\\kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[1;34m(self, prompt)\u001b[0m\n\u001b[0;32m 858\u001b[0m \u001b[1;34m\"raw_input was called, but this frontend does not support input requests.\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 859\u001b[0m )\n\u001b[1;32m--> 860\u001b[1;33m return self._input_request(str(prompt),\n\u001b[0m\u001b[0;32m 861\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 862\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parent_header\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\ipykernel\\kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[1;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[0;32m 902\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 903\u001b[0m \u001b[1;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 904\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Interrupted by user\"\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 905\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 906\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwarning\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Invalid Message:\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexc_info\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mKeyboardInterrupt\u001b[0m: Interrupted by user" + ] + } + ], + "source": [ + "# define rooms and items\n", + "# ============================ Games ==================================\n", + "game1 = {\n", + " \"name\": \"game_1\",\n", + " \"type\": \"game\",\n", + " \"question\": \" How much is 1 + 1?\",\n", + " \"answer\": \"2\",\n", + "}\n", + "\n", + "game2 = {\n", + " \"name\": \"game_2\",\n", + " \"type\": \"game\",\n", + " \"question\": \" can god create a rock he cannot lift?\",\n", + " \"answer\": \"maybe\"\n", + "}\n", + "\n", + "game3 = {\n", + " \"name\": \"game_3\",\n", + " \"type\": \"game\",\n", + " \"question\": \" can god create a rock he cannot lift?\",\n", + " \"answer\": \"maybe\" \n", + "}\n", + "\n", + "door_bonus = {\n", + " \"name\": \"door_bonus\",\n", + " \"type\": \"game\",\n", + " \"question\": \"This is a bonus room, you dont need to use a Key you need to use a the code. It should be something like the number pi. Good Luck! \",\n", + " \"answer\": \"3,14\" \n", + "}\n", + "\n", + "# ============================ Doors ==================================\n", + "\n", + "\n", + "door_a = {\n", + " \"name\": \"door a\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_b = {\n", + " \"name\": \"door b\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_c = {\n", + " \"name\": \"door c\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_d = {\n", + " \"name\": \"door d\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_e = {\n", + " \"name\": \"door e\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_f = {\n", + " \"name\": \"door f\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_g = {\n", + " \"name\": \"door g\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_h = {\n", + " \"name\": \"door h\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_i = {\n", + " \"name\": \"door i\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_j = {\n", + " \"name\": \"door j\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_k = {\n", + " \"name\": \"door k\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_l = {\n", + " \"name\": \"door l\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_t = {\n", + " \"name\": \"door t\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_m = {\n", + " \"name\": \"door m\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "\n", + "\n", + "# ============================ Keys ==================================\n", + "\n", + "key_a = {\n", + " \"name\": \"key for door a\",\n", + " \"type\": \"key\",\n", + " \"target\": door_a,\n", + " \"value\": 8,\n", + "}\n", + "\n", + "key_b = {\n", + " \"name\": \"key for door b\",\n", + " \"type\": \"key\",\n", + " \"target\": door_b,\n", + "}\n", + "\n", + "key_c = {\n", + " \"name\": \"key for door c\",\n", + " \"type\": \"key\",\n", + " \"target\": door_c,\n", + "}\n", + "\n", + "key_d = {\n", + " \"name\": \"key for door d\",\n", + " \"type\": \"key\",\n", + " \"target\": door_d,\n", + "}\n", + "\n", + "key_e = {\n", + " \"name\": \"key for door e\",\n", + " \"type\": \"key\",\n", + " \"target\": door_e,\n", + "}\n", + "\n", + "key_f = {\n", + " \"name\": \"key for door f\",\n", + " \"type\": \"key\",\n", + " \"target\": door_f,\n", + "}\n", + "\n", + "key_g = {\n", + " \"name\": \"key for door g\",\n", + " \"type\": \"key\",\n", + " \"target\": door_g,\n", + "}\n", + "\n", + "key_h = {\n", + " \"name\": \"key for door h\",\n", + " \"type\": \"key\",\n", + " \"target\": door_h,\n", + "}\n", + "\n", + "key_i = {\n", + " \"name\": \"key for door i\",\n", + " \"type\": \"key\",\n", + " \"target\": door_i,\n", + "}\n", + "\n", + "key_j = {\n", + " \"name\": \"key for door j\",\n", + " \"type\": \"key\",\n", + " \"target\": door_j,\n", + "}\n", + "\n", + "\n", + "key_k = {\n", + " \"name\": \"key for door k\",\n", + " \"type\": \"key\",\n", + " \"target\": door_k,\n", + "}\n", + "\n", + "\n", + "key_l = {\n", + " \"name\": \"key for door l\",\n", + " \"type\": \"key\",\n", + " \"target\": door_l,\n", + "}\n", + "\n", + "key_m = {\n", + " \"name\": \"key for door m\",\n", + " \"type\": \"key\",\n", + " \"target\": door_m, \n", + "}\n", + "\n", + "# ======================= Maps =============================\n", + "\n", + "map_1 = {\n", + " \"name\": \"map for Game Room\",\n", + " \"type\": \"map\",\n", + " \"file\": \"Map1.png\",\n", + " \"room\": \"Game Room\",\n", + "}\n", + "\n", + "map_2 = {\n", + " \"name\": \"map for Game Room + Bathroom\",\n", + " \"type\": \"map\",\n", + " \"file\": \"Map2.png\",\n", + " \"room\": \"Bathroom\",\n", + "}\n", + "\n", + "map_3 = {\n", + " \"name\": \"map for Game Room\",\n", + " \"type\": \"map\",\n", + " \"file\": \"Map1.png\",\n", + " \"room\": \"Game Room\",\n", + "}\n", + "\n", + "# ============================ Furnitures ==================================\n", + "\n", + "# ========= Game Room =========\n", + "\n", + "piano = {\n", + " \"name\": \"piano\",\n", + " \"type\": \"furniture\",\n", + " \"value\": 7,\n", + "}\n", + "\n", + "couch = {\n", + " \"name\": \"couch\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "round_table = {\n", + " \"name\": \"round table\",\n", + " \"type\": \"furniture\"\n", + "}\n", + "# ========= Bathroom =========\n", + "\n", + "bathtub = {\n", + " \"name\": \"bathtub\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "sink = {\n", + " \"name\": \"sink\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "toilet = {\n", + " \"name\": \"toilet\",\n", + " \"type\": \"furniture\",\n", + " \"value\": 2,\n", + "}\n", + "\n", + "# ========= Bedroom 1 =========\n", + "\n", + "queenbed = {\n", + " \"name\": \"queenbed\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dressing_table = {\n", + " \"name\": \"dressing table\",\n", + " \"type\": \"furniture\", \n", + "}\n", + "\n", + "# ========= Bedroom 2 =========\n", + "\n", + "doublebed = {\n", + " \"name\": \"doublebed\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dresser = {\n", + " \"name\": \"dresser\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "desktop = {\n", + " \"name\": \"desktop\",\n", + " \"type\": \"furniture\", \n", + "}\n", + "\n", + "desktop_chair = {\n", + " \"name\": \"desktop chair\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Living Room =========\n", + "\n", + "dining_table = {\n", + " \"name\": \"dining table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table_chair_1 = {\n", + " \"name\": \"dining table chair 1\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table_chair_2 = {\n", + " \"name\": \"dining table chair 2\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table_chair_3 = {\n", + " \"name\": \"dining table chair 3\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table_chair_4 = {\n", + " \"name\": \"dining table chair 4\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table_chair_5 = {\n", + " \"name\": \"dining table chair 5\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Dungeon =========\n", + "\n", + "bucket = {\n", + " \"name\": \"bucket\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "torture_table = {\n", + " \"name\": \"torture table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "blood_table = {\n", + " \"name\": \"blood table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= corridor =========\n", + "\n", + "\n", + "# ========= Lab =========\n", + "\n", + "flasks_cabinet = {\n", + " \"name\": \"flasks cabinet\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "table_lab = {\n", + " \"name\": \"randowm table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Kitchen =========\n", + "\n", + "kitchen_table = {\n", + " \"name\": \"kitchen table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "kitchen_sink = {\n", + " \"name\": \"kitchen sink\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "kitchen_countertop = {\n", + " \"name\": \"kitchen countertop\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "vitroceramic = {\n", + " \"name\": \"vitroceramic\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Bait Room =========\n", + "\n", + "toys_trunk = {\n", + " \"name\": \"toys trunk\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "candy_cabinet = {\n", + " \"name\": \"candy cabinet\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "console_station = {\n", + " \"name\": \"Xbox\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Dinning Room =========\n", + "\n", + "cabinet = {\n", + " \"name\": \"cabinet\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table = {\n", + " \"name\": \"dinning_table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_1 = {\n", + " \"name\": \"dinning_table chair 1\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_2 = {\n", + " \"name\": \"dinning_table chair 2\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_3 = {\n", + " \"name\": \"dinning_table chair 3\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_4 = {\n", + " \"name\": \"dinning_table chair 4\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_5 = {\n", + " \"name\": \"dinning_table chair 5\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_6 = {\n", + " \"name\": \"dinning_table chair 6\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_7 = {\n", + " \"name\": \"dinning_table chair 7\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dinning_table_chair_8 = {\n", + " \"name\": \"dinning_table chair 8\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "# ========= Entrance =========\n", + "\n", + "bench = {\n", + " \"name\": \"bench\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ============================ Rooms ==================================\n", + "\n", + "game_room = {\n", + " \"name\": \"game_room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map1.png\",\n", + "}\n", + "\n", + "bedroom_1 = {\n", + " \"name\": \"bedroom 1\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map3.png\",\n", + "}\n", + "\n", + "bathroom = {\n", + " \"name\": \"bathroom\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map2.png\",\n", + "}\n", + "\n", + "bedroom_2 = {\n", + " \"name\": \"bedroom 2\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map4.png\",\n", + "}\n", + "\n", + "living_room = {\n", + " \"name\": \"living room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map6.png\",\n", + "}\n", + "\n", + "dungeon = {\n", + " \"name\": \"dungeon\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map5.png\",\n", + "}\n", + "\n", + "kitchen = {\n", + " \"name\": \"kitchen\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map9.png\",\n", + "}\n", + "\n", + "lab = {\n", + " \"name\": \"lab\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map8.png\",\n", + "}\n", + "\n", + "bait_room = {\n", + " \"name\": \"bait room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map11.png\",\n", + "}\n", + "\n", + "dinning_room = {\n", + " \"name\": \"dinning room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map10.png\",\n", + "}\n", + "\n", + "corridor = {\n", + " \"name\": \"corridor\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map7.png\",\n", + "}\n", + "\n", + "entrance = {\n", + " \"name\": \"entrance\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map12.png\",\n", + "}\n", + "\n", + "outside = {\n", + " \"name\": \"outside\"\n", + "}\n", + "\n", + "all_rooms = [game_room, bathroom, bedroom_1, bedroom_2, living_room, dungeon, corridor, kitchen, lab, bait_room, dinning_room, entrance, outside]\n", + "\n", + "all_doors = [door_a, door_b, door_c, door_d, door_t, door_bonus, door_e, door_f, door_g, door_h, door_i, door_j, door_k, door_l]\n", + "\n", + "# define which items/rooms are related\n", + "\n", + "object_relations = {\n", + " # ===== Rooms =====\n", + " \n", + " \"game_room\": [couch, piano, door_a, door_t, door_e, game1],\n", + " \"living room\": [dining_table, door_g, dinning_table_chair_1, dinning_table_chair_2, dinning_table_chair_3, dinning_table_chair_4, dinning_table_chair_5 ],\n", + " \"bedroom 2\": [doublebed, dresser, door_b],\n", + " \"bedroom 1\": [queenbed, door_b, door_a, door_c, door_f],\n", + " \"bathroom\": [toilet, door_e, bathtub, sink],\n", + " \"dungeor\": [door_f,torture_table, blood_table, bucket],\n", + " \"kitchen\": [door_i, door_k, kitchen_table, kitchen_countertop, vitroceramic],\n", + " \"lab\": [door_j, door_i, door_h,flasks_cabinet, table_lab],\n", + " \"dinning room\": [dining_table, door_k, dinning_table_chair_1, dinning_table_chair_2, dinning_table_chair_3, dinning_table_chair_4, dinning_table_chair_5, dinning_table_chair_6, dinning_table_chair_7, dinning_table_chair_8, cabinet],\n", + " \"bait room\": [door_m, door_j, candy_cabinet, console_station, toys_trunk],\n", + " \"entrance\": [bench, door_l, door_m],\n", + " \n", + " # ===== keys =====\n", + " \n", + " \"piano\": [key_e],\n", + " \"queenbed\": [key_b],\n", + " \"dresser\": [key_d],\n", + " \"doublebed\": [key_f],\n", + " \"toilet\": [key_a],\n", + " \"bucket\": [key_c],\n", + " \"desktop\": [key_g],\n", + " \"dining table chair 4\": [key_h],\n", + " \"flask cabinet\": [key_i],\n", + " \"vitroceramic\": [key_j],\n", + " \"candy cabinet\": [key_k],\n", + " \"cabinet\": [key_m],\n", + " \"bench\": [key_l],\n", + " \n", + " \n", + " # ===== Doors =====\n", + "\n", + " \"door a\": [game_room, bedroom_1],\n", + " \"door b\": [bedroom_1, bedroom_2],\n", + " \"door c\": [bedroom_1, living_room],\n", + " \"door d\": [living_room, outside],\n", + " \"door e\": [game_room, bathroom],\n", + " \"door t\": [game_room],\n", + " \"door_bonus\": [game_room, bedroom_1],\n", + " \"outside\": [door_d]\n", + "} \n", + "\n", + "\n", + "# define game state. Do not directly change this dict. \n", + "# Instead, when a new game starts, make a copy of this\n", + "# dict and use the copy to store gameplay state. This \n", + "# way you can replay the game multiple times.\n", + "\n", + "from PIL import Image\n", + "\n", + "\n", + "INIT_GAME_STATE = {\n", + " \"current_room\": game_room,\n", + " \"keys_collected\": [],\n", + " \"target_room\": outside\n", + "}\n", + "\n", + "def linebreak():\n", + " \"\"\"\n", + " Print a line break\n", + " \"\"\"\n", + " print(\"\\n\\n\")\n", + "\n", + "def start_game():\n", + " \"\"\"\n", + " Start the game\n", + " \"\"\"\n", + " print(\"You wake up on a couch and find yourself in a strange house with no windows which you have never been to before. You don't remember why you are here and what had happened before. You feel some unknown danger is approaching and you must get out of the house, NOW!\")\n", + " play_room(game_state[\"current_room\"])\n", + "\n", + "def play_room(room):\n", + " \"\"\"\n", + " Play a room. First check if the room being played is the target room.\n", + " If it is, the game will end with success. Otherwise, let player either \n", + " explore (list all items in this room) or examine an item found here.\n", + " \"\"\"\n", + " game_state[\"current_room\"] = room\n", + " if(game_state[\"current_room\"] == game_state[\"target_room\"]):\n", + " print(\"Congrats! You escaped the room!\")\n", + " else:\n", + " print(\"You are now in \" + room[\"name\"])\n", + " intended_action = input(\"What would you like to do? Type '1' for explore, type '0' for examine or type 2 to open the map.\").strip()\n", + " if intended_action == \"1\":\n", + " explore_room(room)\n", + " play_room(room)\n", + " elif intended_action == \"0\":\n", + " examine_item(input(\"What would you like to examine?\").strip())\n", + " elif intended_action == \"2\":\n", + " map = Image.open(room[\"map\"])\n", + " map.show()\n", + " play_room(room)\n", + " else:\n", + " print(\"Not sure what you mean. Type 'explore' or 'examine'.\")\n", + " play_room(room)\n", + " linebreak()\n", + "\n", + "def explore_room(room):\n", + " \"\"\"\n", + " Explore a room. List all items belonging to this room.\n", + " \"\"\"\n", + " items = [i[\"name\"] for i in object_relations[room[\"name\"]]]\n", + " print(\"You explore the room. This is \" + room[\"name\"] + \". You find \" + \", \".join(items))\n", + "\n", + "def get_next_room_of_door(door, current_room):\n", + " \"\"\"\n", + " From object_relations, find the two rooms connected to the given door.\n", + " Return the room that is not the current_room.\n", + " \"\"\"\n", + " connected_rooms = object_relations[door[\"name\"]]\n", + " for room in connected_rooms:\n", + " if(not current_room == room):\n", + " return room\n", + "\n", + "count = 0\n", + "\n", + "\n", + "def examine_item(item_name):\n", + " \"\"\"\n", + " Examine an item which can be a door or furniture.\n", + " First make sure the intended item belongs to the current room.\n", + " Then check if the item is a door. Tell player if key hasn't been \n", + " collected yet. Otherwise ask player if they want to go to the next\n", + " room. If the item is not a door, then check if it contains keys.\n", + " Collect the key if found and update the game state. At the end,\n", + " play either the current or the next room depending on the game state\n", + " to keep playing.\n", + " \"\"\"\n", + " current_room = game_state[\"current_room\"]\n", + " next_room = \"\"\n", + " output = None\n", + " global count\n", + " for item in object_relations[current_room[\"name\"]]:\n", + " if(item[\"name\"] == item_name):\n", + " output = \"You examine \" + item_name + \". \"\n", + " if(item[\"type\"] == \"door\"):\n", + " have_key = False\n", + " for key in game_state[\"keys_collected\"]:\n", + " if(key[\"target\"] == item):\n", + " have_key = True\n", + " if(have_key):\n", + " output += \"You unlock it with a key you have.\"\n", + " next_room = get_next_room_of_door(item, current_room)\n", + " else:\n", + " output += \"It is locked but you don't have the key.\"\n", + " elif (item[\"type\"] == \"game\"):\n", + " print(\"You fine a mini game called: \" + item[\"name\"] + \"and you need to answer it\" + item[\"question\"])\n", + " play_game = input(item[\"question\"]).strip()\n", + " if play_game != item[\"answer\"]:\n", + " print(\"try again\")\n", + " else:\n", + " print(\"You win\")\n", + " else:\n", + " if(item[\"name\"] in object_relations and len(object_relations[item[\"name\"]])>0):\n", + " item_found = object_relations[item[\"name\"]].pop()\n", + " game_state[\"keys_collected\"].append(item_found)\n", + " output += \"You find \" + item_found[\"name\"] + \".\"\n", + " else:\n", + " output += \"There isn't anything interesting about it.\"\n", + " print(output)\n", + " print(count)\n", + " break\n", + "\n", + " if(output is None):\n", + " print(\"The item you requested is not found in the current room.\")\n", + " \n", + " if(next_room and input(\"Do you want to go to the next room? Ener 'yes' or 'no'\").strip() == 'yes'):\n", + " play_room(next_room)\n", + " else:\n", + " play_room(current_room)\n", + " \n", + "game_state = INIT_GAME_STATE.copy()\n", + "\n", + "start_game()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/your-code/20171019_HalloweenCostumes_Frightgeist2.csv b/your-code/20171019_HalloweenCostumes_Frightgeist2.csv new file mode 100644 index 00000000..a7d37ec3 --- /dev/null +++ b/your-code/20171019_HalloweenCostumes_Frightgeist2.csv @@ -0,0 +1,596 @@ +Rankings for Halloween Costumes, +Based on US searches in October 2017, +Costume,Ranking +Wonder Woman,1 +Harley Quinn,2 +Clown,3 +Unicorn,4 +Rabbit,5 +Witch,6 +Mouse,7 +Pirate,8 +Zombie,9 +Dinosaur,10 +Princess,11 +Moana,12 +Ninja,13 +Superhero,14 +Mermaid,15 +IT,16 +Batman,17 +Monster,18 +Vampire,19 +Doll,20 +Belle,21 +Skeleton,22 +Joker,23 +Pumpkin,24 +Chucky,25 +Cheerleader,26 +Angel,27 +Spider-Man,28 +Minnie Mouse,29 +Star Wars,30 +Bear,31 +1980s,32 +Ghost,33 +Fairy,34 +Devil,35 +Lion,36 +Mario,37 +Little Red Riding Hood,38 +Dragon,39 +Chicken,40 +Catwoman,41 +Mickey Mouse,42 +Power Rangers,43 +Police officer,44 +Gray wolf,45 +Daenerys Targaryen,46 +PAW Patrol,47 +1990s,48 +Deer,49 +LEGO,50 +Nerd,51 +The Wizard of Oz,52 +Goddess,53 +Superman,54 +Cowboy,55 +Pig,56 +Beetlejuice,57 +"Monsters, Inc.",58 +Teenage Mutant Ninja Turtles,59 +Tinker Bell,60 +The Mad Hatter,61 +Emoji,62 +Giant panda,63 +Princess Jasmine,64 +Morticia Addams,65 +Physician,66 +The Addams Family,67 +Horse,68 +Bat,69 +Tyrannosaurus,70 +Donald Trump,71 +Dalmatian,72 +Spider,73 +Steampunk,74 +Shark,75 +Peter Pan,76 +Hippie,77 +Jason Voorhees,78 +Troll,79 +Batgirl,80 +Pj Masks,81 +Flash,82 +Monkey,83 +Minions,84 +Grease,85 +Werewolf,86 +Cruella de Vil,87 +Hocus Pocus,88 +Minecraft,89 +Princess Leia,90 +Luigi,91 +Dorothy Gale,92 +Firefighter,93 +Deadpool,94 +Mummy,95 +Lego Ninjago,96 +Toy Story,97 +Scary Clown,98 +Darth Vader,99 +Flapper,100 +Pikachu,101 +Robin,102 +Butterfly,103 +Barbie,104 +Duck,105 +Gypsy,106 +1950s,107 +Stick figure,108 +Stormtrooper,109 +Jack Skellington,110 +Hugh Hefner,111 +Groot,112 +Captain America,113 +Wednesday Addams,114 +Pocahontas,115 +Stranger Things,116 +M&M's,117 +Cattle,118 +Cow,119 +Fox,120 +Nun,121 +Freddy Krueger,122 +The Incredibles,123 +The Powerpuff Girls,124 +Hermione Granger,125 +Clueless,126 +Elsa,127 +Cleopatra,128 +Banana,129 +Assassin's Creed,130 +Thing 1,131 +Cheshire Cat,132 +Queen of Hearts,133 +Jon Snow,134 +Mal,135 +Prisoner,136 +Princess Peach,137 +Alice,138 +Astronaut,139 +Bride of Chucky,140 +SWAT,141 +Maid,142 +Peacock,143 +Taco,144 +Halo,145 +Starbucks,146 +Pebbles Flinstone,147 +Where's Waldo,148 +Hulk,149 +Tiger,150 +Calavera,151 +Sheriff Woody,152 +Ursula,153 +Black Widow,154 +Pun,155 +Owl,156 +Grim Reaper,157 +Circus,158 +Pizza,159 +School Girl,160 +Hot dog,161 +Ariel,162 +Strawberry,163 +Raccoon,164 +Elf,165 +Velma Dinkley,166 +Vikings,167 +Masquerade ball,168 +Greek Goddess,169 +The Little Mermaid,170 +The Renaissance,171 +Buzz Lightyear,172 +Elephant,173 +Cupcake,174 +Jedi,175 +Black cat,176 +Bumblebee,177 +Medusa,178 +Prince,179 +Cookie Monster,180 +Tree,181 +Ewok,182 +Sailor,183 +Ladybug,184 +Annabelle,185 +Fish,186 +Rey,187 +Coraline,188 +Yoda,189 +Mary Poppins,190 +Skunk,191 +Pink Ladies,192 +Old Lady,193 +Ringmaster,194 +Rapunzel,195 +Pilot,196 +Charlie Brown,197 +Pineapple,198 +Michael Myers,199 +Disco,200 +Top Gun,201 +Chewbacca,202 +Elmo,203 +American Horror Story,204 +Jessie,205 +Robber,206 +Robot,207 +Evie,208 +Raggedy Ann,209 +Yoshi,210 +Sheep,211 +1960s,212 +The Flintstones,213 +Lifeguard,214 +Anna,215 +Oktoberfest,216 +Middle Ages,217 +Bamm-Bamm,218 +Care Bears,219 +Michael Jackson,220 +Han Solo,221 +Peppa Pig,222 +Popeye,223 +The Walking Dead,224 +Iron Man,225 +Giraffe,226 +Despicable Me,227 +Light-emitting diode,228 +Rosie the Riveter,229 +Tin Man,230 +Crayon,231 +Sushi,232 +Piglet,233 +Jack Sparrow,234 +Ballet Dancer,235 +Leopard,236 +Link,237 +Goku,238 +Ash Ketchum,239 +Gumball machine,240 +Penguin,241 +Mike Wazowski,242 +Gamora,243 +Jester,244 +Black Panther,245 +Fortune Teller,246 +Elvis Presley,247 +Voodoo Doll,248 +Storm,249 +Zombie Cheerleader,250 +Corpse Bride,251 +Logan,252 +Biker,253 +Cheetah,254 +Eleven,255 +Oompa Loompa,256 +Sally,257 +Gorilla,258 +Uma,259 +Kim Kardashian,260 +Luke Skywalker,261 +Superwoman,262 +Star-Lord,263 +Pac-Man,264 +Bob Ross,265 +Grinch,266 +Rocky Horror,267 +Kim Possible,268 +Monster High,269 +Willy Wonka,270 +Tourist,271 +Wilma Flintstone,272 +Doc McStuffins,273 +Old Man,274 +Student,275 +Lara Croft,276 +Up,277 +Captain Hook,278 +Bonnie and Clyde,279 +Scooby-Doo,280 +Olaf,281 +Daphne Blake,282 +Belly dancer,283 +Edward Scissorhands,284 +Spice Girls,285 +Marilyn Monroe,286 +Mime artist,287 +Jellyfish,288 +Pinata,289 +Toga,290 +Flamingo,291 +Curious George,292 +Master Chief,293 +Riddler,294 +The Riddler,295 +Tigger,296 +Beyonce,297 +Katniss Everdeen,298 +Green Arrow,299 +Pulp Fiction,300 +Gnome,301 +Stitch,302 +Lumberjack,303 +Frat Boy,304 +Lobster,305 +Princess Aurora,306 +Mad scientist,307 +Slender Man,308 +Clark Kent,309 +Bride of Frankenstein,310 +Thor,311 +Risky Business,312 +Oogie Boogie,313 +Robin Hood,314 +Priest,315 +Squirrel,316 +Frida Kahlo,317 +Stay Puft Marshmallow Man,318 +Poodle skirt,319 +Rainbow Dash,320 +Star Trek,321 +Creepy Doll,322 +Tomb Raider,323 +Prince Charming,324 +Audrey Hepburn,325 +Football player,326 +Leprechaun,327 +Ghostbusters,328 +Gladiator,329 +Bowser,330 +King Koopa,331 +Mulan,332 +Boo,333 +Jigsaw,334 +Bane,335 +Lady Gaga,336 +Tiana,337 +Negan,338 +Waynes World,339 +Poison Ivy,340 +Pin-up girl,341 +Dracula,342 +Elvira,343 +Tooth fairy,344 +Optimus Prime,345 +Spider-Girl,346 +Candy corn,347 +Nightwing,348 +R2-D2,349 +Boba Fett,350 +Marty McFly,351 +Daisy Duck,352 +Batwoman,353 +Kiss,354 +Zombie Bride,355 +Morphsuits,356 +Bacon,357 +Fred Flintstone,358 +Loofah,359 +Pretty Woman,360 +Flight attendant,361 +Greaser,362 +Betty Boop,363 +Wendy Peffercorn,364 +SpongeBob SquarePants,365 +Rainbow Brite,366 +Jesus Christ,367 +Mia Wallace,368 +Olive Oyl,369 +Shaggy Rogers,370 +Hello Kitty,371 +Minecraft Steve,372 +Smurfs,373 +Green Lantern,374 +Black Swan,375 +Lion Tamer,376 +Burlesque,377 +Carmen Sandiego,378 +Venom,379 +Avatar,380 +Dead Bride,381 +Lederhosen,382 +Snow White,383 +Female Joker,384 +Pippi Longstocking,385 +Broken Doll,386 +Geisha,387 +Fairy godmother,388 +Caveman,389 +Miley Cyrus,390 +Cotton candy,391 +Wreck-It Ralph,392 +Regina George,393 +Construction Worker,394 +Roller coaster,395 +Godzilla,396 +Hipster,397 +Adventure Time,398 +Merida,399 +Lois Lane,400 +Baymax,401 +Zookeeper,402 +Nacho Libre,403 +Doctor Who,404 +Fallen angel,405 +Katy Perry,406 +Army Girl,407 +Predator,408 +Scarecrow,409 +Bellatrix Lestrange,410 +Mother Nature,411 +Hulk Hogan,412 +Diego de la Vega,413 +Nicki Minaj,414 +French maid,415 +Sub-Zero,416 +Zebra,417 +Big Bird,418 +Western saloon,419 +Marie Antoinette,420 +E.T. the Extra-Terrestrial,421 +Mariachi,422 +Shadow,423 +Ostrich,424 +Cheech And Chong,425 +Harry Potter,426 +Cowardly Lion,427 +Saloon Girl,428 +Winged monkeys,429 +X-Men,430 +Eskimo,431 +Esmerelda,432 +80s Workout,433 +Ace Ventura,434 +Two-Face,435 +Flo,436 +Pablo Escobar,437 +Catboy,438 +Chun-Li,439 +Daria,440 +Sleeping Beauty,441 +The Cat in the Hat,442 +Pop Art,443 +Deathstroke,444 +Miss Piggy,445 +Cinderella,446 +A Clockwork Orange,447 +Headless Horseman,448 +Abby Cadabby,449 +John Smith,450 +Ezio Auditore da Firenze,451 +Lilo Pelekai,452 +Alien,453 +Garden gnome,454 +Smurfette,455 +Forrest Gump,456 +Reno 911,457 +Energizer Bunny,458 +Richard Simmons,459 +Hawkeye,460 +Minecraft Creeper,461 +Angry Birds,462 +Purge,463 +James P. Sullivan,464 +Breaking Bad,465 +Kristoff,466 +Sock monkey,467 +Scarlet Witch,468 +Hobo,469 +Athlete,470 +Dexter,471 +Biker Girl,472 +Zombie Hunter,473 +Doctor Strange,474 +Cereal Killer,475 +Sailor Moon,476 +Toad,477 +Rag doll,478 +Maleficent,479 +Super Why!,480 +Purple Minion,481 +Lego Man,482 +Rick Grimes,483 +La Calavera Catrina,484 +United States Army,485 +Gingerbread man,486 +Princess Zelda,487 +Daft Punk,488 +The Hunger Games,489 +Jelly Bean,490 +Ted,491 +Indiana Jones,492 +Genie,493 +Princess Bubblegum,494 +Flashdance,495 +Gumby,496 +Spider-Woman,497 +Farmer,498 +Twister,499 +Voodoo,500 +Tron,501 +Blue Fairy,502 +Caitlyn Jenner,503 +Grumpy Cat,504 +Loki,505 +Scorpion,506 +Finn the Human,507 +Quicksilver,508 +Raven,509 +Walter White,510 +Evil Jester,511 +Super Shredder,512 +Transformer,513 +Dalek,514 +Ceiling Fan,515 +Marceline the Vampire Queen,516 +Weeping Angel,517 +Daredevil,518 +Luke Cage,519 +Lloyd Garmadon,520 +Evil Queen,521 +Jackie Moon,522 +Falcon,523 +Mugatu,524 +Minecraft Enderman,525 +Dead Presidents,526 +Kenny Powers,527 +Lalaloopsy,528 +Frankie Stein,529 +Sonic the Hedgehog,530 +Strawberry Shortcake,531 +Duck Dynasty,532 +Effie Trinket,533 +Ebola virus disease,534 +French Kiss,535 +Cavewoman,536 +Referee,537 +Sharknado,538 +TARDIS,539 +Wasp,540 +Paratrooper,541 +Wilfred,542 +Registered nurse,543 +Psy,544 +1970s,545 +Aladdin,546 +Bank Robber,547 +Baseball Player,548 +Beer Girl,549 +Boxer,550 +Captain Marvel,551 +Clawdeen Wolf,552 +Dark Angel,553 +Dora,554 +Draculaura,555 +Egyptians,556 +Flying Monkey,557 +Frankenstein,558 +Gangnam Style,559 +Gru,560 +Hamburglar,561 +Hank Pym,562 +Harambe,563 +Hit-Girl,564 +Izzy,565 +Jeffrey Weissman,566 +Jessica Rabbit,567 +Knight,568 +Kylo Ren,569 +La Chilindrina,570 +Magician,571 +Mardi Gras,572 +Mavis,573 +Mortal Kombat,574 +Owlette,575 +Pokemon,576 +Ring Leader,577 +Ron Burgundy,578 +Sandy Olsson,579 +Saw,580 +Scream,581 +Spartan army,582 +Sumo Wrestler,583 +Sun Drop,584 +Supergirl,585 +The Great Gatsby,586 +Toothless,587 +Turkey,588 +Vision,589 +Vixen,590 +Wolverine,591 +Wonder Man,592 +Wonder Man,593 \ No newline at end of file diff --git a/your-code/CompleteMap.png b/your-code/CompleteMap.png new file mode 100644 index 00000000..1d3211f4 Binary files /dev/null and b/your-code/CompleteMap.png differ diff --git a/your-code/KEYS.png b/your-code/KEYS.png new file mode 100644 index 00000000..b55467e2 Binary files /dev/null and b/your-code/KEYS.png differ diff --git a/your-code/Map1.png b/your-code/Map1.png new file mode 100644 index 00000000..72ff00de Binary files /dev/null and b/your-code/Map1.png differ diff --git a/your-code/Map10.png b/your-code/Map10.png new file mode 100644 index 00000000..7dc97cb2 Binary files /dev/null and b/your-code/Map10.png differ diff --git a/your-code/Map11.png b/your-code/Map11.png new file mode 100644 index 00000000..f769e35c Binary files /dev/null and b/your-code/Map11.png differ diff --git a/your-code/Map12.png b/your-code/Map12.png new file mode 100644 index 00000000..34631104 Binary files /dev/null and b/your-code/Map12.png differ diff --git a/your-code/Map2.png b/your-code/Map2.png new file mode 100644 index 00000000..97b5bd8c Binary files /dev/null and b/your-code/Map2.png differ diff --git a/your-code/Map3.png b/your-code/Map3.png new file mode 100644 index 00000000..1d784aac Binary files /dev/null and b/your-code/Map3.png differ diff --git a/your-code/Map4.png b/your-code/Map4.png new file mode 100644 index 00000000..56dd30d9 Binary files /dev/null and b/your-code/Map4.png differ diff --git a/your-code/Map5.png b/your-code/Map5.png new file mode 100644 index 00000000..08f1fa18 Binary files /dev/null and b/your-code/Map5.png differ diff --git a/your-code/Map6.png b/your-code/Map6.png new file mode 100644 index 00000000..9d1ecd54 Binary files /dev/null and b/your-code/Map6.png differ diff --git a/your-code/Map7.png b/your-code/Map7.png new file mode 100644 index 00000000..509c6e8d Binary files /dev/null and b/your-code/Map7.png differ diff --git a/your-code/Map8.png b/your-code/Map8.png new file mode 100644 index 00000000..47d515f2 Binary files /dev/null and b/your-code/Map8.png differ diff --git a/your-code/Map9.png b/your-code/Map9.png new file mode 100644 index 00000000..05c26b68 Binary files /dev/null and b/your-code/Map9.png differ diff --git a/your-code/dark_harp.mp3 b/your-code/dark_harp.mp3 new file mode 100644 index 00000000..ac1036cc Binary files /dev/null and b/your-code/dark_harp.mp3 differ diff --git a/escape-room-plan.jpg b/your-code/escape-room-plan.jpg similarity index 100% rename from escape-room-plan.jpg rename to your-code/escape-room-plan.jpg diff --git a/your-code/ghosts.mp3 b/your-code/ghosts.mp3 new file mode 100644 index 00000000..aa8b2cff Binary files /dev/null and b/your-code/ghosts.mp3 differ diff --git a/your-code/main.ipynb b/your-code/main.ipynb new file mode 100644 index 00000000..d997e3d4 --- /dev/null +++ b/your-code/main.ipynb @@ -0,0 +1,1448 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 129 + }, + "id": "0YdTQaHuD6HC", + "outputId": "4aa4a4c5-dbf9-4f48-e50a-4d2d358be374" + }, + "outputs": [], + "source": [ + "# define rooms and items\n", + "count = 50\n", + "from colorama import Fore, Back, Style\n", + "\n", + "from PIL import Image \n", + "# ============================ Games ==================================\n", + "game1 = {\n", + " \"name\": \"game_1\",\n", + " \"type\": \"game\",\n", + " \"question\": \" How much is 1 + 1? and it is not 7 BTW. If you dont get it is beacause you are not Spanish and you are too old or maybe I am\",\n", + " \"value\": 5,\n", + " \"btw\": \"I think you get it. It wasn´t so difficult right? '(It's a rhetorical question, you don't have to answer me. Well...you can't)'\" + '\\n'\n", + "}\n", + "\n", + "game2 = {\n", + " \"name\": \"game_2\",\n", + " \"type\": \"game\",\n", + " \"question\": \" Can God create a rock he cannot lift? I will help you: the possible answers are: 'yes', 'no' or 'maybe'. If you want to discuss it with the game answer try next time. In this instance I'm like God, what I decide is the truth.\",\n", + " \"answer\": \"maybe\",\n", + " \"value\": 5 ,\n", + " \"btw\": \"yes it is maybe, because we need to get more information. If god is powerfull it mean he can create. However if he cant not lift it he is not powerful enough\" + '\\n'\n", + "}\n", + "\n", + "game3 = {\n", + " \"name\": \"game_3\",\n", + " \"type\": \"game\",\n", + " \"question\": \"it is a pikachu, do you have a pokeball? i dont think so. Bad luck this happen only one time in life. so... I will give you the anwser this time type 'no'\",\n", + " \"answer\": \"no\",\n", + " \"value\": 5,\n", + " \"btw\": \"Sorry, a pikachu is too much for you try maybe with a magikarp\" + '\\n', \n", + "}\n", + "\n", + "game4 = {\n", + " \"name\": \"game_4\",\n", + " \"type\": \"game\",\n", + " \"question\": \"Which team is going to win?\",\n", + " \"answer\": \"spooky pumpkins\", \n", + " \"value\": 5 ,\n", + " \"btw\": \"Yes, you're right! The Spooky Pumpkins are going to win. If it doesn't happen this invisible rabbit will disappear!. so you know who to vote for\" + '\\n', \n", + "}\n", + "\n", + "game5 = {\n", + " \"name\": \"game_5\",\n", + " \"type\": \"game\",\n", + " \"question\": \"If a rooster lays an egg on a roof, which way does it fall to? Some options are: 'left', 'right', 'both' or 'none'\",\n", + " \"answer\": \"none\", \n", + " \"value\": 5,\n", + " \"btw\": \"If you said left or right you were wrong, at least in our world. If it was a snail, you would've nailed it!\" + '\\n', \n", + "}\n", + "\n", + "game6 = {\n", + " \"name\": \"game_6\",\n", + " \"type\": \"game\",\n", + " \"question\": \"Is darkness black?\",\n", + " \"answer\": \"no\", \n", + " \"value\": 5,\n", + " \"btw\": \"In science, black is the absence of light and color is a phenomenon of light. However, a black object or black images printed on white paper are made up of pigments, not light. So artists should use the darkest paint color to approximate black.\" + '\\n' \n", + "}\n", + "\n", + "bonus_door = {\n", + " \"name\": \"bonus_door\",\n", + " \"type\": \"game\",\n", + " \"question\": \"This is a bonus room, you dont need to use a Key you need to use a the code. It should be something like the number pi. Good Luck! \",\n", + " \"answer\": \"3,14\", \n", + "}\n", + "\n", + "# ============================ Doors ==================================\n", + "\n", + "\n", + "door_a = {\n", + " \"name\": \"door a\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_b = {\n", + " \"name\": \"door b\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_c = {\n", + " \"name\": \"door c\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_d = {\n", + " \"name\": \"door d\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_e = {\n", + " \"name\": \"door e\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_f = {\n", + " \"name\": \"door f\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_g = {\n", + " \"name\": \"door g\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_h = {\n", + " \"name\": \"door h\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_i = {\n", + " \"name\": \"door i\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_j = {\n", + " \"name\": \"door j\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_k = {\n", + " \"name\": \"door k\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_l = {\n", + " \"name\": \"door l\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "door_m = {\n", + " \"name\": \"door m\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "\n", + "\n", + "# ============================ Keys ==================================\n", + "\n", + "key_a = {\n", + " \"name\": \"key for door a\",\n", + " \"type\": \"key\",\n", + " \"target\": door_a,\n", + " \"value\": 8,\n", + "}\n", + "\n", + "key_b = {\n", + " \"name\": \"key for door b\",\n", + " \"type\": \"key\",\n", + " \"target\": door_b,\n", + "}\n", + "\n", + "key_c = {\n", + " \"name\": \"key for door c\",\n", + " \"type\": \"key\",\n", + " \"target\": door_c,\n", + "}\n", + "\n", + "key_d = {\n", + " \"name\": \"key for door d\",\n", + " \"type\": \"key\",\n", + " \"target\": door_d,\n", + "}\n", + "\n", + "key_e = {\n", + " \"name\": \"key for door e\",\n", + " \"type\": \"key\",\n", + " \"target\": door_e,\n", + "}\n", + "\n", + "key_f = {\n", + " \"name\": \"key for door f\",\n", + " \"type\": \"key\",\n", + " \"target\": door_f,\n", + "}\n", + "\n", + "key_g = {\n", + " \"name\": \"key for door g\",\n", + " \"type\": \"key\",\n", + " \"target\": door_g,\n", + "}\n", + "\n", + "key_h = {\n", + " \"name\": \"key for door h\",\n", + " \"type\": \"key\",\n", + " \"target\": door_h,\n", + "}\n", + "\n", + "key_i = {\n", + " \"name\": \"key for door i\",\n", + " \"type\": \"key\",\n", + " \"target\": door_i,\n", + "}\n", + "\n", + "key_j = {\n", + " \"name\": \"key for door j\",\n", + " \"type\": \"key\",\n", + " \"target\": door_j,\n", + "}\n", + "\n", + "\n", + "key_k = {\n", + " \"name\": \"key for door k\",\n", + " \"type\": \"key\",\n", + " \"target\": door_k,\n", + "}\n", + "\n", + "\n", + "key_l = {\n", + " \"name\": \"key for door l\",\n", + " \"type\": \"key\",\n", + " \"target\": door_l,\n", + "}\n", + "\n", + "key_m = {\n", + " \"name\": \"key for door m\",\n", + " \"type\": \"key\",\n", + " \"target\": door_m, \n", + "}\n", + "\n", + "# ============================ Furnitures ==================================\n", + "\n", + "# ========= Game Room =========\n", + "\n", + "piano = {\n", + " \"name\": \"piano\",\n", + " \"type\": \"furniture\",\n", + " \"value\": 7,\n", + "}\n", + "\n", + "couch = {\n", + " \"name\": \"couch\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "round_table = {\n", + " \"name\": \"round table\",\n", + " \"type\": \"furniture\"\n", + "}\n", + "# ========= Bathroom =========\n", + "\n", + "bathtub = {\n", + " \"name\": \"bathtub\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "sink = {\n", + " \"name\": \"sink\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "toilet = {\n", + " \"name\": \"toilet\",\n", + " \"type\": \"furniture\",\n", + " \"value\": 2,\n", + "}\n", + "\n", + "# ========= Bedroom 1 =========\n", + "\n", + "queenbed = {\n", + " \"name\": \"queen bed\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dressing_table = {\n", + " \"name\": \"dressing table\",\n", + " \"type\": \"furniture\", \n", + "}\n", + "\n", + "# ========= Bedroom 2 =========\n", + "\n", + "doublebed = {\n", + " \"name\": \"double bed\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dresser = {\n", + " \"name\": \"dresser\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "desktop = {\n", + " \"name\": \"desktop\",\n", + " \"type\": \"furniture\", \n", + "}\n", + "\n", + "desktop_chair = {\n", + " \"name\": \"desktop chair\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Living Room =========\n", + "\n", + "living_room_table = {\n", + " \"name\": \"living room table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "\n", + "\n", + "# ========= Dungeon =========\n", + "\n", + "bucket = {\n", + " \"name\": \"bucket\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "torture_table = {\n", + " \"name\": \"torture table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "blood_table = {\n", + " \"name\": \"blood table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= corridor =========\n", + "\n", + "\n", + "# ========= Lab =========\n", + "\n", + "flasks_cabinet = {\n", + " \"name\": \"flasks cabinet\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "table_lab = {\n", + " \"name\": \"randowm table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Kitchen =========\n", + "\n", + "kitchen_table = {\n", + " \"name\": \"kitchen table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "kitchen_sink = {\n", + " \"name\": \"kitchen sink\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "kitchen_countertop = {\n", + " \"name\": \"kitchen countertop\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "stove = {\n", + " \"name\": \"stove\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Bait Room =========\n", + "\n", + "toys_trunk = {\n", + " \"name\": \"toys trunk\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "candy_cabinet = {\n", + " \"name\": \"candy cabinet\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "console_station = {\n", + " \"name\": \"Xbox\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ========= Dining Room =========\n", + "\n", + "cabinet = {\n", + " \"name\": \"cabinet\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dining_table = {\n", + " \"name\": \"dining table\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "\n", + "# ========= Entrance =========\n", + "\n", + "bench = {\n", + " \"name\": \"bench\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# ============================ Rooms ==================================\n", + "\n", + "game_room = {\n", + " \"name\": \"the Game Room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map1.png\",\n", + "}\n", + "\n", + "bedroom_1 = {\n", + " \"name\": \"the Bedroom\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map3.png\",\n", + "}\n", + "\n", + "bathroom = {\n", + " \"name\": \"the Bathroom\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map2.png\",\n", + "}\n", + "\n", + "bedroom_2 = {\n", + " \"name\": \"the Small bedroom\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map4.png\",\n", + "}\n", + "\n", + "living_room = {\n", + " \"name\": \"the Living Room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map6.png\",\n", + "}\n", + "\n", + "dungeon = {\n", + " \"name\": \"the Dungeon\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map5.png\",\n", + "}\n", + "\n", + "kitchen = {\n", + " \"name\": \"the Kitchen\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map9.png\",\n", + "}\n", + "\n", + "lab = {\n", + " \"name\": \"the Lab\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map8.png\",\n", + "}\n", + "\n", + "bait_room = {\n", + " \"name\": \"the Bait Room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map11.png\",\n", + "}\n", + "\n", + "dining_room = {\n", + " \"name\": \"the Dining Room\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map10.png\",\n", + "}\n", + "\n", + "corridor = {\n", + " \"name\": \"the Corridor\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map7.png\",\n", + "}\n", + "\n", + "entrance = {\n", + " \"name\": \"the Entrance\",\n", + " \"type\": \"room\",\n", + " \"map\": \"Map12.png\",\n", + "}\n", + "\n", + "outside = {\n", + " \"name\": \"Outside\",\n", + " \"map\": \"CompleteMap.png\"\n", + "}\n", + "\n", + "all_rooms = [game_room, bathroom, bedroom_1, bedroom_2, living_room, dungeon, corridor, kitchen, lab, bait_room, dining_room, entrance, outside]\n", + "\n", + "all_doors = [door_a, door_b, door_c, door_d, bonus_door, door_e, door_f, door_g, door_h, door_i, door_j, door_k, door_l]\n", + "\n", + "# define which items/rooms are related\n", + "\n", + "object_relations = {\n", + " # ===== Rooms =====\n", + " \n", + " \"the Game Room\": [couch, piano, round_table, door_a, door_b, bonus_door, game1],\n", + " \"the Living Room\": [living_room_table, door_e, door_f],\n", + " \"the Small bedroom\": [doublebed, dresser, desktop, door_c, game2],\n", + " \"the Bedroom\": [queenbed, dressing_table, door_b, door_c, door_d, door_e, game3],\n", + " \"the Bathroom\": [toilet, door_a, bathtub, sink],\n", + " \"the Dungeon\": [door_d, torture_table, blood_table, bucket, game4],\n", + " \"the Kitchen\": [door_h, door_i, kitchen_table, kitchen_countertop, stove, game5],\n", + " \"the Lab\": [door_g, door_h, door_j, flasks_cabinet, table_lab, game6],\n", + " \"the Dining Room\": [dining_table, door_i, cabinet],\n", + " \"the Bait Room\": [door_k, door_j, candy_cabinet, console_station, toys_trunk],\n", + " \"the Entrance\": [bench, door_l, door_k],\n", + " \"the Corridor\": [door_f, door_g],\n", + " \n", + " # ===== keys =====\n", + " \n", + " \"piano\": [key_a],\n", + " \"queen bed\": [key_c],\n", + " \"dresser\": [key_d],\n", + " #\"doublebed\": [key_f],\n", + " \"toilet\": [key_b],\n", + " \"bucket\": [key_e],\n", + " \"desktop\": [key_g],\n", + " \"living room table\": [key_f],\n", + " \"flasks cabinet\": [key_h],\n", + " \"stove\": [key_i],\n", + " \"candy cabinet\": [key_k],\n", + " \"cabinet\": [key_j],\n", + " \"bench\": [key_l],\n", + " \n", + " \n", + " # ===== Doors =====\n", + "\n", + " \"door a\": [game_room, bathroom],\n", + " \"door b\": [bedroom_1, game_room],\n", + " \"door c\": [bedroom_1, bedroom_2],\n", + " \"door d\": [bedroom_1, dungeon],\n", + " \"door e\": [bedroom_1, living_room],\n", + " \"door f\": [living_room, corridor],\n", + " \"door g\": [lab, corridor],\n", + " \"door h\": [kitchen, lab],\n", + " \"door i\": [dining_room, kitchen],\n", + " \"door j\": [lab, bait_room],\n", + " \"door k\": [entrance, bait_room],\n", + " \"door l\": [entrance, outside],\n", + " \"bonus_door\": [game_room],\n", + " \"outside\": [door_l],\n", + "} \n", + "\n", + "\n", + "# define game state. Do not directly change this dict. \n", + "# Instead, when a new game starts, make a copy of this\n", + "# dict and use the copy to store gameplay state. This \n", + "# way you can replay the game multiple times.\n", + "\n", + "INIT_GAME_STATE = {\n", + " \"current_room\": game_room,\n", + " \"keys_collected\": [],\n", + " \"target_room\": outside\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "id": "RlvwftR0DnuK" + }, + "outputs": [], + "source": [ + "def linebreak():\n", + " \"\"\"\n", + " Print a line break\n", + " \"\"\"\n", + " print(\"\\n\\n\")\n", + "\n", + "def start_game():\n", + " \"\"\"\n", + " Start the game\n", + " \"\"\"\n", + " print(\"You wake up on a couch and find yourself in a strange house with no windows which you have never been to before. You don't remember why you are here and what had happened before. You feel some unknown danger is approaching and you must get out of the house, NOW!\" + '\\n')\n", + " print(\"You start with 50 points and the interaction with each object in each room will take points off. Sometimes. However you can get extra points if you play each room's minigame. So good luck, you will need it.\" + \"\\n\" + \"BTW if you find a problem, it's not the game's fault, it's yours for not understanding how to play muahaha.\")\n", + " play_room(game_state[\"current_room\"])\n", + "\n", + " \n", + "def start_game_because_you_die():\n", + " \"\"\"\n", + " Start the game\n", + " \"\"\"\n", + " print(Fore.RED + \"You died, start again\")\n", + " play_room(game_state[\"current_room\"])\n", + "\n", + "\n", + "def play_room(room):\n", + " \"\"\"\n", + " Play a room. First check if the room being played is the target room.\n", + " If it is, the game will end with success. Otherwise, let player either \n", + " explore (list all items in this room) or examine an item found here.\n", + " \"\"\"\n", + " game_state[\"current_room\"] = room\n", + " if(game_state[\"current_room\"] == game_state[\"target_room\"]):\n", + " print(Fore.RED + \"Congrats! You escaped the room!\")\n", + " else:\n", + " \n", + " print(Fore.BLUE + \"You are now in \" + room[\"name\"]+\", \"+ meet_monster()+\" welcomes you!\" + '\\n')\n", + " intended_action = input(\"What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\" + '\\n').strip()\n", + " if intended_action == \"0\":\n", + " explore_room(room)\n", + " play_room(room)\n", + " elif intended_action == \"1\":\n", + " examine_item(input(\"What would you like to examine?\"+'\\n').strip())\n", + " elif intended_action == \"2\":\n", + " map = Image.open(room[\"map\"])\n", + " map.show()\n", + " play_room(room)\n", + " elif intended_action == \"3\":\n", + " print(\"You have \",count,\" points\")\n", + " play_sound('pain.mp3')\n", + " play_room(room)\n", + " else:\n", + " print(Fore.RED + \"Not sure what you mean. Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points'.\"+'\\n')\n", + " play_room(room)\n", + " linebreak()\n", + "\n", + "def explore_room(room):\n", + " play_sound('dark_harp.mp3')\n", + " \"\"\"\n", + " Explore a room. List all items belonging to this room.\n", + " \"\"\"\n", + " items = [i[\"name\"] for i in object_relations[room[\"name\"]]]\n", + " print(\"You explore the room. This is \" + room[\"name\"] + \". You find \" + \", \".join(items))\n", + "\n", + "def get_next_room_of_door(door, current_room):\n", + " play_sound('ghosts.mp3')\n", + " \"\"\"\n", + " From object_relations, find the two rooms connected to the given door.\n", + " Return the room that is not the current_room.\n", + " \"\"\"\n", + " connected_rooms = object_relations[door[\"name\"]]\n", + " for room in connected_rooms:\n", + " if(not current_room == room):\n", + " return room\n", + "\n", + "\n", + "def examine_item(item_name):\n", + " \"\"\"\n", + " Examine an item which can be a door or furniture.\n", + " First make sure the intended item belongs to the current room.\n", + " Then check if the item is a door. Tell player if key hasn't been \n", + " collected yet. Otherwise ask player if they want to go to the next\n", + " room. If the item is not a door, then check if it contains keys.\n", + " Collect the key if found and update the game state. At the end,\n", + " play either the current or the next room depending on the game state\n", + " to keep playing.\n", + " \"\"\"\n", + " current_room = game_state[\"current_room\"]\n", + " next_room = \"\"\n", + " output = None\n", + " global count\n", + " for item in object_relations[current_room[\"name\"]]:\n", + " if(item[\"name\"] == item_name):\n", + " output = \"You examine \" + item_name + \". \"\n", + " if(item[\"type\"] == \"door\"):\n", + " have_key = False\n", + " for key in game_state[\"keys_collected\"]:\n", + " if(key[\"target\"] == item):\n", + " have_key = True\n", + " if(have_key):\n", + " output += \"You unlock it with a key you have.\"\n", + " next_room = get_next_room_of_door(item, current_room)\n", + " else:\n", + " output += \"It is locked but you don't have the key.\" + '\\n'\n", + " elif(item[\"type\"] == \"game\"):\n", + " print(\"You fine a mini game called: \" + item[\"name\"] + \"and you need to answer it\" + item[\"question\"])\n", + " play_game = input(item[\"question\"]).strip()\n", + " if play_game != item[\"answer\"]:\n", + " print(Fore.RED + \"Sorry, we can see you are not SMART enough to play it (yes! I want to emphasize it), our recommendation is to try to google it and try again. However, I dont want to waste my time so try to check other things. BYE!\")\n", + " else:\n", + " print(Fore.RED + \"You win\")\n", + " count = count + item[\"value\"]\n", + " if count < 0:\n", + " print(Back.RED + \"You ran out of points!\")\n", + " start_game_because_you_die ()\n", + " else:\n", + " if(item[\"name\"] in object_relations and len(object_relations[item[\"name\"]])>0):\n", + " item_found = object_relations[item[\"name\"]].pop()\n", + " game_state[\"keys_collected\"].append(item_found)\n", + " output += \"You find \" + (Fore.RED + item_found[\"name\"]) + \".\"\n", + " else:\n", + " output += \"There isn't anything interesting about it.\"\n", + " print(output + '\\n')\n", + " break\n", + "\n", + " if(output is None):\n", + " print(\"The item you requested is not found in the current room.\")\n", + " \n", + " if(next_room and input(\"Do you want to go to the next room? Ener 'yes' or 'no'\"+'\\n').strip() == 'yes'):\n", + " play_room(next_room)\n", + " else:\n", + " play_room(current_room)\n", + "\n", + "def meet_monster():\n", + " import pandas as pd\n", + " m = pd.read_csv (r'20171019_HalloweenCostumes_Frightgeist2.csv', header=2)\n", + " m1 = m.sample(1).iloc[0,0]\n", + " return m1\n", + "\n", + "def play_sound(sound):\n", + " from playsound import playsound\n", + " return playsound(sound)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "fbPsc0PCEFRP", + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You wake up on a couch and find yourself in a strange house with no windows which you have never been to before. You don't remember why you are here and what had happened before. You feel some unknown danger is approaching and you must get out of the house, NOW!\n", + "\n", + "You start with 50 points and the interaction with each object in each room will take points off. Sometimes. However you can get extra points if you play each room's minigame. So good luck, you will need it.\n", + "BTW if you find a problem, it's not the game's fault, it's yours for not understanding how to play muahaha.\n", + "\u001b[34mYou are now in the Game Room, Beyonce welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "piano\n", + "You examine piano. You find \u001b[31mkey for door a.\n", + "\n", + "\u001b[34mYou are now in the Game Room, Beetlejuice welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door a\n", + "You examine door a. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Bathroom, Diego de la Vega welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "toilet\n", + "You examine toilet. You find \u001b[31mkey for door b.\n", + "\n", + "\u001b[34mYou are now in the Bathroom, Kim Possible welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door a\n", + "You examine door a. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Game Room, Flashdance welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door b\n", + "You examine door b. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Bedroom, Vampire welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "queen bed\n", + "You examine queen bed. You find \u001b[31mkey for door c.\n", + "\n", + "\u001b[34mYou are now in the Bedroom, Jessica Rabbit welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door c\n", + "You examine door c. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Small bedroom, Banana welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "desktop\n", + "You examine desktop. You find \u001b[31mkey for door g.\n", + "\n", + "\u001b[34mYou are now in the Small bedroom, The Riddler welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "dresser\n", + "You examine dresser. You find \u001b[31mkey for door d.\n", + "\n", + "\u001b[34mYou are now in the Small bedroom, Cowboy welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door c\n", + "You examine door c. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Bedroom, Mickey Mouse welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door d\n", + "You examine door d. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Dungeon, Kim Kardashian welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "bucket\n", + "You examine bucket. You find \u001b[31mkey for door e.\n", + "\n", + "\u001b[34mYou are now in the Dungeon, Grumpy Cat welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door d\n", + "You examine door d. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Bedroom, Ursula welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door e\n", + "You examine door e. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Living Room, Princess Peach welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "living room table\n", + "You examine living room table. You find \u001b[31mkey for door f.\n", + "\n", + "\u001b[34mYou are now in the Living Room, Wreck-It Ralph welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door f\n", + "You examine door f. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Corridor, Banana welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door g\n", + "You examine door g. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Lab, Eleven welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "3\n", + "You have 50 points\n", + "\u001b[34mYou are now in the Lab, Boo welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "explore\n", + "\u001b[31mNot sure what you mean. Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points'.\n", + "\n", + "\u001b[34mYou are now in the Lab, Goddess welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "0\n", + "You explore the room. This is the Lab. You find door g, door h, door j, flasks cabinet, randowm table, game_6\n", + "\u001b[34mYou are now in the Lab, Biker welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "0\n", + "You explore the room. This is the Lab. You find door g, door h, door j, flasks cabinet, randowm table, game_6\n", + "\u001b[34mYou are now in the Lab, Referee welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "2\n", + "\u001b[34mYou are now in the Lab, Jedi welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "table\n", + "The item you requested is not found in the current room.\n", + "\u001b[34mYou are now in the Lab, Tree welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "0\n", + "You explore the room. This is the Lab. You find door g, door h, door j, flasks cabinet, randowm table, game_6\n", + "\u001b[34mYou are now in the Lab, The Little Mermaid welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "What would you like to examine?\n", + "flasks cabinet\n", + "You examine flasks cabinet. You find \u001b[31mkey for door h.\n", + "\n", + "\u001b[34mYou are now in the Lab, Jedi welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door h\n", + "You examine door h. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Kitchen, Wilma Flintstone welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "2\n", + "\u001b[34mYou are now in the Kitchen, Diego de la Vega welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "0\n", + "You explore the room. This is the Kitchen. You find door h, door i, kitchen table, kitchen countertop, stove, game_5\n", + "\u001b[34mYou are now in the Kitchen, Hipster welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "stove\n", + "\u001b[31mNot sure what you mean. Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points'.\n", + "\n", + "\u001b[34mYou are now in the Kitchen, Monsters, Inc. welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "game_5\n", + "You fine a mini game called: game_5and you need to answer itIf a rooster lays an egg on a roof, which way does it fall to? Some options are: 'left', 'right', 'both' or 'none'\n", + "If a rooster lays an egg on a roof, which way does it fall to? Some options are: 'left', 'right', 'both' or 'none'none\n", + "\u001b[31mYou win\n", + "You examine game_5. \n", + "\n", + "\u001b[34mYou are now in the Kitchen, Unicorn welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "kitchen countertop\n", + "You examine kitchen countertop. There isn't anything interesting about it.\n", + "\n", + "\u001b[34mYou are now in the Kitchen, Regina George welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "kitchen Table\n", + "The item you requested is not found in the current room.\n", + "\u001b[34mYou are now in the Kitchen, Up welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "kitchen table\n", + "\u001b[31mNot sure what you mean. Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points'.\n", + "\n", + "\u001b[34mYou are now in the Kitchen, Tinker Bell welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "kitchen table\n", + "You examine kitchen table. There isn't anything interesting about it.\n", + "\n", + "\u001b[34mYou are now in the Kitchen, Tinker Bell welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door h\n", + "You examine door h. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Lab, Tyrannosaurus welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "2\n", + "The item you requested is not found in the current room.\n", + "\u001b[34mYou are now in the Lab, Sheriff Woody welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "2\n", + "\u001b[34mYou are now in the Lab, Elephant welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "0\n", + "You explore the room. This is the Lab. You find door g, door h, door j, flasks cabinet, randowm table, game_6\n", + "\u001b[34mYou are now in the Lab, Magician welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door h\n", + "You examine door h. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Kitchen, Tooth fairy welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "stove\n", + "You examine stove. You find \u001b[31mkey for door i.\n", + "\n", + "\u001b[34mYou are now in the Kitchen, La Calavera Catrina welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door h\n", + "You examine door h. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Lab, Cheetah welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door i\n", + "The item you requested is not found in the current room.\n", + "\u001b[34mYou are now in the Lab, Hello Kitty welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "2\n", + "\u001b[34mYou are now in the Lab, Cereal Killer welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "door h\n", + "\u001b[31mNot sure what you mean. Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points'.\n", + "\n", + "\u001b[34mYou are now in the Lab, King Koopa welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door h\n", + "You examine door h. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Kitchen, Princess Peach welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door i\n", + "You examine door i. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Dining Room, Up welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "2\n", + "\u001b[34mYou are now in the Dining Room, Winged monkeys welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "0\n", + "You explore the room. This is the Dining Room. You find dining table, door i, cabinet\n", + "\u001b[34mYou are now in the Dining Room, Ring Leader welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "cabinet\n", + "You examine cabinet. You find \u001b[31mkey for door j.\n", + "\n", + "\u001b[34mYou are now in the Dining Room, Reno 911 welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door i\n", + "You examine door i. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Kitchen, Richard Simmons welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door h\n", + "You examine door h. You unlock it with a key you have.\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Lab, Robin Hood welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "1\n", + "The item you requested is not found in the current room.\n", + "\u001b[34mYou are now in the Lab, Shadow welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "1\n", + "The item you requested is not found in the current room.\n", + "\u001b[34mYou are now in the Lab, Ursula welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "door j\n", + "\u001b[31mNot sure what you mean. Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points'.\n", + "\n", + "\u001b[34mYou are now in the Lab, Pink Ladies welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door j\n", + "You examine door j. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Bait Room, Angel welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "2\n", + "\u001b[34mYou are now in the Bait Room, Poison Ivy welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "0\n", + "You explore the room. This is the Bait Room. You find door k, door j, candy cabinet, Xbox, toys trunk\n", + "\u001b[34mYou are now in the Bait Room, Candy corn welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "candy cabinet\n", + "You examine candy cabinet. You find \u001b[31mkey for door k.\n", + "\n", + "\u001b[34mYou are now in the Bait Room, Elmo welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "1\n", + "The item you requested is not found in the current room.\n", + "\u001b[34mYou are now in the Bait Room, Miss Piggy welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "door k\n", + "\u001b[31mNot sure what you mean. Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points'.\n", + "\n", + "\u001b[34mYou are now in the Bait Room, Pablo Escobar welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door k\n", + "You examine door k. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[34mYou are now in the Entrance, Anna welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "2\n", + "\u001b[34mYou are now in the Entrance, Disco welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "bench\n", + "You examine bench. You find \u001b[31mkey for door l.\n", + "\n", + "\u001b[34mYou are now in the Entrance, Marilyn Monroe welcomes you!\n", + "\n", + "What would you like to do? Type '0' to explore the room, '1' to examine an item, '2' to check the map or '3' to see you current points\n", + "1\n", + "What would you like to examine?\n", + "door l\n", + "You examine door l. You unlock it with a key you have.\n", + "\n", + "Do you want to go to the next room? Ener 'yes' or 'no'\n", + "yes\n", + "\u001b[31mCongrats! You escaped the room!\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + } + ], + "source": [ + "game_state = INIT_GAME_STATE.copy()\n", + "\n", + "start_game()" + ] + } + ], + "metadata": { + "colab": { + "collapsed_sections": [], + "name": "main.ipynb", + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.3" + } + }, + "nbformat": 4, + "nbformat_minor": 1 +} diff --git a/your-code/pain.mp3 b/your-code/pain.mp3 new file mode 100644 index 00000000..ec4c4c02 Binary files /dev/null and b/your-code/pain.mp3 differ diff --git a/your-code/sample-code.ipynb b/your-code/sample-code.ipynb index a6f8a94d..71f298f9 100644 --- a/your-code/sample-code.ipynb +++ b/your-code/sample-code.ipynb @@ -240,7 +240,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.2" + "version": "3.8.3" } }, "nbformat": 4,