Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions your-project/Hangman final.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
23 changes: 12 additions & 11 deletions your-project/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<img src="https://bit.ly/2VnXWr2" alt="Ironhack Logo" width="100"/>

# 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)
Expand All @@ -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)