From 18db309cb387be23b9f923c750483246141d4b80 Mon Sep 17 00:00:00 2001 From: carlaferiche <71378875+carlaferiche@users.noreply.github.com> Date: Thu, 22 Oct 2020 17:06:20 +0200 Subject: [PATCH 1/4] Adding jupyter --- your-project/Hangman.ipynb | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 your-project/Hangman.ipynb diff --git a/your-project/Hangman.ipynb b/your-project/Hangman.ipynb new file mode 100644 index 0000000..718d03d --- /dev/null +++ b/your-project/Hangman.ipynb @@ -0,0 +1,73 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Let's try to solve the hangman game\n", + "_ _ _ _ _ " + ] + } + ], + "source": [ + "print(\"Let's try to solve the hangman game\")\n", + "hiddenword = \"house\"\n", + "usuword = \"\"\n", + "usuletter = \"\"\n", + "lifes = 11\n", + "while lives >0:\n", + " wrong = 0\n", + " for letter in hiddenword:\n", + " if letter in usuword:\n", + " print(letter, end = \"\")\n", + " else:\n", + " print(\"_ \", end = \"\")\n", + " wrong += 1\n", + " if wrong == 0:\n", + " print(\"Congratulations! You win! :)\")\n", + " break\n", + " usuletter = (input(\"\\nPlease, enter a letter: \"))\n", + " '''\n", + " while type(usuletter) != str:\n", + " try:\n", + " usuletter = str(input(\"\\nPlease, enter a letter: \"))\n", + " except: \n", + " print(\"That's not a valid letter. Please try again...\") '''\n", + " if usuletter in usuword:\n", + " print(\"Ya has repetido la letra\")\n", + " elif usuletter in hiddenword:\n", + " print(\"Correct, the letter is included in the word\")\n", + " usuword += usuletter\n", + " elif usuletter not in hiddenword:\n", + " lifes = lives - 1\n", + " print(\"Oh no! The\", usuletter, \"is not included in the word\" )\n", + " print(\"You have \", lifes, \" lifes.\")\n", + " usuword += usuletter\n", + " if lifes == 0:\n", + " print(\"Game over\")\n", + " print(\"You lose!\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From a92eeb7e50e6b08ac141be1bd2b66c862816e218 Mon Sep 17 00:00:00 2001 From: carlaferiche <71378875+carlaferiche@users.noreply.github.com> Date: Thu, 22 Oct 2020 17:10:38 +0200 Subject: [PATCH 2/4] Update readme file --- your-project/README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/your-project/README.md b/your-project/README.md index 2a8493d..4d1a0a2 100644 --- a/your-project/README.md +++ b/your-project/README.md @@ -1,9 +1,9 @@ Ironhack Logo -# Title of Your Project -*[Your Name]* +# Hangman +*[Carla Feriche* -*[Your Cohort, Campus & Date]* +*[Group4, Ironhack BCN data - 21/10/202]* ## Content - [Project Description](#project-description) @@ -13,22 +13,23 @@ - [Links](#links) ## Project Description -Write a short description of your project. Write 1-2 sentences about the game you chose to build and why. +I decided to choose the Hangman game as it seems to me to have a clear clonological order so as to code. This game consists on finding the missing letters in order to guess a word. ## Rules -Briefly describe the rules of the game. +It will appear some blank spaces representing the missing letters you need to find. The machine will tell you to write a letter in order to guess the word. If you choose the letter that is in the word, that letter, which is in the word, will be revealed. +If you guess a letter wrong you will loose a life,. You start the game with 11 lifes. ## Workflow -Outline the workflow you used in your project. What are the steps you went through? +In order to do my project, I decided to follow some steps. First of all, I decided to create a trello project so as to planificate my ideas. There, I wrote all the steps I had to do. Before coding, I clone the repository and I create the gitignore file. Then, I decided to plan in a white paper how were going to be the code project. After that, I realized I had to revise some theoretical material in order to do the project. Being all that done, I started coding. ## Organization -How did you organize your work? Did you use any tools like a kanban board? +I used the trello web to organize my project. -What does your repository look like? Explain your folder and file structure. +I create the file Hangman game in my folder which I cloned from github. ## Links Include links to your repository, slides and kanban board. Feel free to include any other links associated with your project. -[Repository](https://github.com/) -[Slides](https://slides.com/) -[Trello](https://trello.com/en) +[Repository](https://github.com/carlaferiche/Project-Week-1-Build-Your-Own-Game) +[Slides](https://slides.com/carlaferiche/deck) +[Trello](https://trello.com/b/S3AoG8LT/project-1) From 22d5855ba0d751f9f1655735333439ed950c1a4d Mon Sep 17 00:00:00 2001 From: carlaferiche <71378875+carlaferiche@users.noreply.github.com> Date: Thu, 22 Oct 2020 22:36:44 +0200 Subject: [PATCH 3/4] Uploading new file --- your-project/Hangman final.ipynb | 119 +++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 your-project/Hangman final.ipynb diff --git a/your-project/Hangman final.ipynb b/your-project/Hangman final.ipynb new file mode 100644 index 0000000..70fd6f2 --- /dev/null +++ b/your-project/Hangman final.ipynb @@ -0,0 +1,119 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Let's try to solve the hangman game\n", + "_ _ _ _ _ \n", + "Please, enter a letter: j\n", + "Oh no! The j is not included in the word\n", + "You have 10 lifes.\n", + "_ _ _ _ _ \n", + "Please, enter a letter: h\n", + "Correct, the letter is included in the word\n", + "h_ _ _ _ \n", + "Please, enter a letter: j\n", + "You have already used this letter\n", + "h_ _ _ _ \n", + "Please, enter a letter: q\n", + "Oh no! The q is not included in the word\n", + "You have 9 lifes.\n", + "h_ _ _ _ \n", + "Please, enter a letter: w\n", + "Oh no! The w is not included in the word\n", + "You have 8 lifes.\n", + "h_ _ _ _ \n", + "Please, enter a letter: s\n", + "Correct, the letter is included in the word\n", + "h_ _ s_ \n", + "Please, enter a letter: e\n", + "Correct, the letter is included in the word\n", + "h_ _ se\n", + "Please, enter a letter: f\n", + "Oh no! The f is not included in the word\n", + "You have 7 lifes.\n", + "h_ _ se\n", + "Please, enter a letter: o\n", + "Correct, the letter is included in the word\n", + "ho_ se\n", + "Please, enter a letter: u\n", + "Correct, the letter is included in the word\n", + "houseCongratulations! You win! :)\n" + ] + } + ], + "source": [ + "print(\"Let's try to solve the hangman game\")\n", + "hiddenword = \"house\"\n", + "usuword = \"\"\n", + "usuletter = \"\"\n", + "lifes = 11\n", + "while lifes >0:\n", + " wrong = 0\n", + " for letter in hiddenword:\n", + " if letter in usuword:\n", + " print(letter, end = \"\")\n", + " else:\n", + " print(\"_ \", end = \"\")\n", + " wrong += 1\n", + " if wrong == 0:\n", + " print(\"\\nCongratulations! You win! :)\")\n", + " break\n", + " usuletter = (input(\"\\nPlease, enter a letter: \"))\n", + " '''\n", + " while type(usuletter) != str:\n", + " try:\n", + " usuletter = str(input(\"\\nPlease, enter a letter: \"))\n", + " except: \n", + " print(\"That's not a valid letter. Please try again...\") '''\n", + " if usuletter in usuword:\n", + " print(\"You have already used this letter\")\n", + " elif usuletter in hiddenword:\n", + " print(\"Correct, the letter is included in the word\")\n", + " usuword += usuletter\n", + " elif usuletter not in hiddenword:\n", + " lifes = lifes - 1\n", + " print(\"Oh no! The\", usuletter, \"is not included in the word\" )\n", + " print(\"You have \", lifes, \" lifes.\")\n", + " usuword += usuletter\n", + " if lifes == 0:\n", + " print(\"Game over\")\n", + " print(\"You lose!\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "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.5" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From 8f5d6cdde9290a16ca29aac6aaa78ae47172df2a Mon Sep 17 00:00:00 2001 From: carlaferiche <71378875+carlaferiche@users.noreply.github.com> Date: Thu, 22 Oct 2020 22:37:14 +0200 Subject: [PATCH 4/4] Deleting jupyter --- your-project/Hangman.ipynb | 73 -------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 your-project/Hangman.ipynb diff --git a/your-project/Hangman.ipynb b/your-project/Hangman.ipynb deleted file mode 100644 index 718d03d..0000000 --- a/your-project/Hangman.ipynb +++ /dev/null @@ -1,73 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Let's try to solve the hangman game\n", - "_ _ _ _ _ " - ] - } - ], - "source": [ - "print(\"Let's try to solve the hangman game\")\n", - "hiddenword = \"house\"\n", - "usuword = \"\"\n", - "usuletter = \"\"\n", - "lifes = 11\n", - "while lives >0:\n", - " wrong = 0\n", - " for letter in hiddenword:\n", - " if letter in usuword:\n", - " print(letter, end = \"\")\n", - " else:\n", - " print(\"_ \", end = \"\")\n", - " wrong += 1\n", - " if wrong == 0:\n", - " print(\"Congratulations! You win! :)\")\n", - " break\n", - " usuletter = (input(\"\\nPlease, enter a letter: \"))\n", - " '''\n", - " while type(usuletter) != str:\n", - " try:\n", - " usuletter = str(input(\"\\nPlease, enter a letter: \"))\n", - " except: \n", - " print(\"That's not a valid letter. Please try again...\") '''\n", - " if usuletter in usuword:\n", - " print(\"Ya has repetido la letra\")\n", - " elif usuletter in hiddenword:\n", - " print(\"Correct, the letter is included in the word\")\n", - " usuword += usuletter\n", - " elif usuletter not in hiddenword:\n", - " lifes = lives - 1\n", - " print(\"Oh no! The\", usuletter, \"is not included in the word\" )\n", - " print(\"You have \", lifes, \" lifes.\")\n", - " usuword += usuletter\n", - " if lifes == 0:\n", - " print(\"Game over\")\n", - " print(\"You lose!\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -}