From a3f2ccddced8b847eee2f19af87d89465bb2f547 Mon Sep 17 00:00:00 2001 From: Sarah Vonderberg Date: Wed, 24 Mar 2021 21:45:06 +0100 Subject: [PATCH 1/7] day1 --- your-project/.DS_Store | Bin 0 -> 6148 bytes your-project/.gitignore | 0 your-project/.gitignore.rtf | 28 ++++++ your-project/.gitignore.txt | 0 .../.ipynb_checkpoints/words-checkpoint.ipynb | 6 ++ your-project/README.md | 14 +-- your-project/words.ipynb | 87 ++++++++++++++++++ your-project/words.py | 19 ++++ 8 files changed, 147 insertions(+), 7 deletions(-) create mode 100644 your-project/.DS_Store create mode 100644 your-project/.gitignore create mode 100644 your-project/.gitignore.rtf create mode 100644 your-project/.gitignore.txt create mode 100644 your-project/.ipynb_checkpoints/words-checkpoint.ipynb create mode 100644 your-project/words.ipynb create mode 100644 your-project/words.py diff --git a/your-project/.DS_Store b/your-project/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..be2d240b7e9770391227717a2294609c6acd971e GIT binary patch literal 6148 zcmeHKJxjzu5PhRpM6S6`%Pp-0YnyoFiYsjN4@gWS+!;|s?DBW~mHOsGF=t8Dmu)$#tKj z!I$;-H|?fx*{jr?QIFqDXaRFPqsId}JaWIcxW^0b(5^S5tk<2aYLvyCal9Pv#Oq8c z$v`rY3?u`|z)v&4J6oliJ7${F7Cj)vu6slq!I5^tT!Ny7e;*4$++WKJDoDx_E z4vy@hh^G=gRieZYPp7{`Tpc(#dO9SE4~dySiWjljIexKlNbQ(yGLQ_68PM97ve5f~ z#b0K!$hVMel7VF4zcL`R=Bin8cX79V+o#^Og?dd@(YQek3hmJ&fFF8}99gIL7quBz X2M&%piux^`m=6IXB%5U57Z`X4u*Ebk literal 0 HcmV?d00001 diff --git a/your-project/.gitignore b/your-project/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/your-project/.gitignore.rtf b/your-project/.gitignore.rtf new file mode 100644 index 0000000..fa66984 --- /dev/null +++ b/your-project/.gitignore.rtf @@ -0,0 +1,28 @@ +{\rtf1\ansi\ansicpg1252\cocoartf2513 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue0;} +{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;} +\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\deftab720 +\pard\pardeftab720\partightenfactor0 + +\f0\fs24 \cf2 \expnd0\expndtw0\kerning0 +\outl0\strokewidth0 \strokec2 # Created by https://www.toptal.com/developers/gitignore/api/jupyternotebooks\ +# Edit at https://www.toptal.com/developers/gitignore?templates=jupyternotebooks\ +\ +### JupyterNotebooks ###\ +# gitignore template for Jupyter Notebooks\ +# website: http://jupyter.org/\ +\ +.ipynb_checkpoints\ +*/.ipynb_checkpoints/*\ +\ +# IPython\ +profile_default/\ +ipython_config.py\ +\ +# Remove previous ipynb_checkpoints\ +# git rm -r .ipynb_checkpoints/\ +\ +# End of https://www.toptal.com/developers/gitignore/api/jupyternotebooks\ +} \ No newline at end of file diff --git a/your-project/.gitignore.txt b/your-project/.gitignore.txt new file mode 100644 index 0000000..e69de29 diff --git a/your-project/.ipynb_checkpoints/words-checkpoint.ipynb b/your-project/.ipynb_checkpoints/words-checkpoint.ipynb new file mode 100644 index 0000000..7fec515 --- /dev/null +++ b/your-project/.ipynb_checkpoints/words-checkpoint.ipynb @@ -0,0 +1,6 @@ +{ + "cells": [], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/your-project/README.md b/your-project/README.md index 2a8493d..f3bdda9 100644 --- a/your-project/README.md +++ b/your-project/README.md @@ -1,9 +1,9 @@ Ironhack Logo -# Title of Your Project -*[Your Name]* +# German ultrahard Hangman +*Sarah Vonderberg* -*[Your Cohort, Campus & Date]* +*[DAFT, Remote Campus & MAR21]* ## Content - [Project Description](#project-description) @@ -13,7 +13,7 @@ - [Links](#links) ## Project Description -Write a short description of your project. Write 1-2 sentences about the game you chose to build and why. +This is a classic hangman game with a German twist. All words that you have to guess are in German and extremely hard. ## Rules Briefly describe the rules of the game. @@ -29,6 +29,6 @@ What does your repository look like? Explain your folder and file structure. ## 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/Salevo/Project-Week-1-Build-Your-Own-Game) +[Slides](https://slides.com/) g drive +[Trello](https://trello.com/b/HFYxcpUn/project-1-german-hangman) diff --git a/your-project/words.ipynb b/your-project/words.ipynb new file mode 100644 index 0000000..28c4d00 --- /dev/null +++ b/your-project/words.ipynb @@ -0,0 +1,87 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "word_list = [\n", + " 'Heizoelrueckstoßabdaempfung',\n", + " 'Donaudampfschifffahrtskapitaensgeselltschaftsmuetzenhalterung',\n", + " 'Lokomotivdampfkesseldruckventilverschlussklappe',\n", + " 'Kirschkernweitspuckwettbewerb',\n", + " 'Weihnachtsmannschokoladeneinpackpapier',\n", + " 'Atmosphaere',\n", + " 'Destinationslebenszyklusmodell',\n", + " 'Desoxyribonukleinsaeure',\n", + " 'Papierschnipselchen',\n", + " 'Arbeitsunfaehigkeitsbescheinigung',\n", + " 'Hundehaftpflichtversicherung']" + ] + } + ], + "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" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/your-project/words.py b/your-project/words.py new file mode 100644 index 0000000..33085a2 --- /dev/null +++ b/your-project/words.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[ ]: + + +word_list = [ + 'Heizoelrueckstoßabdaempfung', + 'Donaudampfschifffahrtskapitaensgeselltschaftsmuetzenhalterung', + 'Lokomotivdampfkesseldruckventilverschlussklappe', + 'Kirschkernweitspuckwettbewerb', + 'Weihnachtsmannschokoladeneinpackpapier', + 'Atmosphaere', + 'Destinationslebenszyklusmodell', + 'Desoxyribonukleinsaeure', + 'Papierschnipselchen', + 'Arbeitsunfaehigkeitsbescheinigung', + 'Hundehaftpflichtversicherung'] + From c3427fac8a8e651fa7bb81ca8784391f0ce63423 Mon Sep 17 00:00:00 2001 From: Sarah Vonderberg Date: Wed, 24 Mar 2021 21:54:23 +0100 Subject: [PATCH 2/7] gitignore file added --- your-project/.DS_Store | Bin 6148 -> 6148 bytes your-project/.gitignore | 47 ++++++++++++++++++++++++++++++++++++ your-project/.gitignore.rtf | 28 --------------------- your-project/.gitignore.txt | 0 4 files changed, 47 insertions(+), 28 deletions(-) delete mode 100644 your-project/.gitignore.rtf delete mode 100644 your-project/.gitignore.txt diff --git a/your-project/.DS_Store b/your-project/.DS_Store index be2d240b7e9770391227717a2294609c6acd971e..5ca177246176db20b626a3ac169b4113a5831e71 100644 GIT binary patch delta 209 zcmZoMXfc=|#>B)qu~2NHo}wr#0|Nsi1A_nqLncEyLmopuLlHyj=8cTY8S6n(d<=R( z;Y@}SWNDyS2}1=#iDyoJa#Buy5>OpbKZ7+8&-f1pKo$do5KvtvLjgl2(AXq~c!p$# z42D!7nGF=n2g>9DO({k*Vo7p+|Ie-oZI_f*~WPTA#4xoF12q+yO HvV|D{fbB8_ delta 82 zcmZoMXfc=|#>B`mu~2NHo}wr-0|Nsi1A_nqgD-ey_^{GE9+zlbFVP!C8G)8+t?EzAJW)e$ZL diff --git a/your-project/.gitignore b/your-project/.gitignore index e69de29..e679a69 100644 --- a/your-project/.gitignore +++ b/your-project/.gitignore @@ -0,0 +1,47 @@ +# Created by https://www.toptal.com/developers/gitignore/api/jupyternotebooks,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=jupyternotebooks,macos + +### JupyterNotebooks ### +# gitignore template for Jupyter Notebooks +# website: http://jupyter.org/ + +.ipynb_checkpoints +*/.ipynb_checkpoints/* + +# IPython +profile_default/ +ipython_config.py + +# Remove previous ipynb_checkpoints +# git rm -r .ipynb_checkpoints/ + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# End of https://www.toptal.com/developers/gitignore/api/jupyternotebooks,macos \ No newline at end of file diff --git a/your-project/.gitignore.rtf b/your-project/.gitignore.rtf deleted file mode 100644 index fa66984..0000000 --- a/your-project/.gitignore.rtf +++ /dev/null @@ -1,28 +0,0 @@ -{\rtf1\ansi\ansicpg1252\cocoartf2513 -\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fmodern\fcharset0 Courier;} -{\colortbl;\red255\green255\blue255;\red0\green0\blue0;} -{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;} -\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 -\deftab720 -\pard\pardeftab720\partightenfactor0 - -\f0\fs24 \cf2 \expnd0\expndtw0\kerning0 -\outl0\strokewidth0 \strokec2 # Created by https://www.toptal.com/developers/gitignore/api/jupyternotebooks\ -# Edit at https://www.toptal.com/developers/gitignore?templates=jupyternotebooks\ -\ -### JupyterNotebooks ###\ -# gitignore template for Jupyter Notebooks\ -# website: http://jupyter.org/\ -\ -.ipynb_checkpoints\ -*/.ipynb_checkpoints/*\ -\ -# IPython\ -profile_default/\ -ipython_config.py\ -\ -# Remove previous ipynb_checkpoints\ -# git rm -r .ipynb_checkpoints/\ -\ -# End of https://www.toptal.com/developers/gitignore/api/jupyternotebooks\ -} \ No newline at end of file diff --git a/your-project/.gitignore.txt b/your-project/.gitignore.txt deleted file mode 100644 index e69de29..0000000 From cc642ace155fdbbdd79bfe6959195f9f3a8f3e39 Mon Sep 17 00:00:00 2001 From: Sarah Vonderberg Date: Wed, 24 Mar 2021 23:22:51 +0100 Subject: [PATCH 3/7] Pseudocode added --- your-project/Hangman Game.ipynb | 118 ++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 your-project/Hangman Game.ipynb diff --git a/your-project/Hangman Game.ipynb b/your-project/Hangman Game.ipynb new file mode 100644 index 0000000..f73e14f --- /dev/null +++ b/your-project/Hangman Game.ipynb @@ -0,0 +1,118 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# The German Hangman Game\n", + "Here you will find my awesome code for the ultrahard German Hangman Game." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# START GAME\n", + "# user input \"name\" > all characters can be accepted\n", + "# print \"Hi \"name\", are you ready to get owned by German Hangman?\"\n", + "# wait 3 seconds, start game\n", + "\n", + "# CHOOSE RANDOM WORD\n", + "# write function to get a random word from words.py\n", + "# convert all words from words.py to upper case \n", + "# store word in variable \"word\"\n", + "\n", + "# GAMEPLAY FUNCTION\n", + "# set 10 tries (user can guess as much as he wants, but fail only 10 times)\n", + "# display the length of \"word\" to the user with _ _ _ underscores\n", + "# Hidden letters are shown as underscores, guessed letters will be unmasked\n", + "# prompt the user to guess a letter or word (>> how can I make it that the user input can be more than a letter? or is it the default or max len(word)?)\n", + " # user input convert to uppercase always\n", + "# while loop until word is guessed or user runs out of tries\n", + " # for loop to replace each _ of the secret word\n", + " # letter is in secret word > show letter in secret word, ask for user input again, show remaining tries, print \"Nice try!\"\n", + " # letter is not in secret word > -1 try and ask for user input again, show remaining tries, print \"This letter is not in the word, try again!\"\n", + "# if user runs out of tries (10) and looses:\n", + " # secret word is displayed, print \"\"name\" you loose, guess you got owned by German hangman\", start play again function\n", + "# if user wins or guesses the word right\n", + " # word is displayed, print \"\"name\" you win, you are ready to move to Berlin now!\", start play again function\n", + " \n", + "# PLAY AGAIN FUNCTION\n", + "# print \"Are you ready to play again?\"\n", + "# enter \"Y\" to start \"N\" if you feel too scared\n", + " # \n", + " # make sure that only Y and N is possible (not weird other input > error message \" wow you are already failing here\"\n", + " # gameplay function starts again\n", + "\n", + "# possible problems with user input > error messages:\n", + " # not a letter\n", + " # same letter twice (show the user which letters he already used?)" + ] + } + ], + "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" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From 7912bf001c70739d38eafdb6caa50b5ede4ff4c1 Mon Sep 17 00:00:00 2001 From: Sarah Vonderberg Date: Thu, 25 Mar 2021 11:27:52 +0100 Subject: [PATCH 4/7] cleaned cached files --- your-project/.DS_Store | Bin 6148 -> 0 bytes your-project/words.ipynb | 87 --------------------------------------- your-project/words.py | 19 --------- 3 files changed, 106 deletions(-) delete mode 100644 your-project/.DS_Store delete mode 100644 your-project/words.ipynb delete mode 100644 your-project/words.py diff --git a/your-project/.DS_Store b/your-project/.DS_Store deleted file mode 100644 index 5ca177246176db20b626a3ac169b4113a5831e71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-sW-5Pe%Kq!grh(PNID3ZA{hk{&#G(I22B5e?QxY(>50XZRQVmHK99srk^W zNST4zw>z1)o4gH~EC4rqE{=f-fQT+Q7_s@ml;c;d&lXjlEvk%p@{*j;-#@*v2ketu;t_A$_Y7CaamT&SanD%A zD@)F@>df)cnPY?t%yEho=fo)QQ6WF<$&zR$$d!zr&JsnyjeB;yt(X-9aax zLo-vr6fgz0QUTU%v1qJlttns%m;xIGMmwAK_b1=%;qOhjed@$I>At U0c%A@X!axEWw6E+_)`VG0L%1M)c^nh diff --git a/your-project/words.ipynb b/your-project/words.ipynb deleted file mode 100644 index 28c4d00..0000000 --- a/your-project/words.ipynb +++ /dev/null @@ -1,87 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "word_list = [\n", - " 'Heizoelrueckstoßabdaempfung',\n", - " 'Donaudampfschifffahrtskapitaensgeselltschaftsmuetzenhalterung',\n", - " 'Lokomotivdampfkesseldruckventilverschlussklappe',\n", - " 'Kirschkernweitspuckwettbewerb',\n", - " 'Weihnachtsmannschokoladeneinpackpapier',\n", - " 'Atmosphaere',\n", - " 'Destinationslebenszyklusmodell',\n", - " 'Desoxyribonukleinsaeure',\n", - " 'Papierschnipselchen',\n", - " 'Arbeitsunfaehigkeitsbescheinigung',\n", - " 'Hundehaftpflichtversicherung']" - ] - } - ], - "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" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/your-project/words.py b/your-project/words.py deleted file mode 100644 index 33085a2..0000000 --- a/your-project/words.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python -# coding: utf-8 - -# In[ ]: - - -word_list = [ - 'Heizoelrueckstoßabdaempfung', - 'Donaudampfschifffahrtskapitaensgeselltschaftsmuetzenhalterung', - 'Lokomotivdampfkesseldruckventilverschlussklappe', - 'Kirschkernweitspuckwettbewerb', - 'Weihnachtsmannschokoladeneinpackpapier', - 'Atmosphaere', - 'Destinationslebenszyklusmodell', - 'Desoxyribonukleinsaeure', - 'Papierschnipselchen', - 'Arbeitsunfaehigkeitsbescheinigung', - 'Hundehaftpflichtversicherung'] - From 86a9ca0ef65dae56d2bb54df95c0343d8fe556e3 Mon Sep 17 00:00:00 2001 From: Sarah Vonderberg Date: Thu, 25 Mar 2021 11:34:14 +0100 Subject: [PATCH 5/7] removed checkpoints --- your-project/.ipynb_checkpoints/words-checkpoint.ipynb | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 your-project/.ipynb_checkpoints/words-checkpoint.ipynb diff --git a/your-project/.ipynb_checkpoints/words-checkpoint.ipynb b/your-project/.ipynb_checkpoints/words-checkpoint.ipynb deleted file mode 100644 index 7fec515..0000000 --- a/your-project/.ipynb_checkpoints/words-checkpoint.ipynb +++ /dev/null @@ -1,6 +0,0 @@ -{ - "cells": [], - "metadata": {}, - "nbformat": 4, - "nbformat_minor": 4 -} From 3c759a3c74ec8e95c98c3d6c7e15a37790901f04 Mon Sep 17 00:00:00 2001 From: Sarah Vonderberg Date: Thu, 25 Mar 2021 17:42:30 +0100 Subject: [PATCH 6/7] code, readme updated --- your-project/Hangman Game.ipynb | 118 ----------- your-project/Hangman.ipynb | 361 ++++++++++++++++++++++++++++++++ your-project/Hangman.py | 180 ++++++++++++++++ your-project/README.md | 11 +- 4 files changed, 548 insertions(+), 122 deletions(-) delete mode 100644 your-project/Hangman Game.ipynb create mode 100644 your-project/Hangman.ipynb create mode 100644 your-project/Hangman.py diff --git a/your-project/Hangman Game.ipynb b/your-project/Hangman Game.ipynb deleted file mode 100644 index f73e14f..0000000 --- a/your-project/Hangman Game.ipynb +++ /dev/null @@ -1,118 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# The German Hangman Game\n", - "Here you will find my awesome code for the ultrahard German Hangman Game." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# START GAME\n", - "# user input \"name\" > all characters can be accepted\n", - "# print \"Hi \"name\", are you ready to get owned by German Hangman?\"\n", - "# wait 3 seconds, start game\n", - "\n", - "# CHOOSE RANDOM WORD\n", - "# write function to get a random word from words.py\n", - "# convert all words from words.py to upper case \n", - "# store word in variable \"word\"\n", - "\n", - "# GAMEPLAY FUNCTION\n", - "# set 10 tries (user can guess as much as he wants, but fail only 10 times)\n", - "# display the length of \"word\" to the user with _ _ _ underscores\n", - "# Hidden letters are shown as underscores, guessed letters will be unmasked\n", - "# prompt the user to guess a letter or word (>> how can I make it that the user input can be more than a letter? or is it the default or max len(word)?)\n", - " # user input convert to uppercase always\n", - "# while loop until word is guessed or user runs out of tries\n", - " # for loop to replace each _ of the secret word\n", - " # letter is in secret word > show letter in secret word, ask for user input again, show remaining tries, print \"Nice try!\"\n", - " # letter is not in secret word > -1 try and ask for user input again, show remaining tries, print \"This letter is not in the word, try again!\"\n", - "# if user runs out of tries (10) and looses:\n", - " # secret word is displayed, print \"\"name\" you loose, guess you got owned by German hangman\", start play again function\n", - "# if user wins or guesses the word right\n", - " # word is displayed, print \"\"name\" you win, you are ready to move to Berlin now!\", start play again function\n", - " \n", - "# PLAY AGAIN FUNCTION\n", - "# print \"Are you ready to play again?\"\n", - "# enter \"Y\" to start \"N\" if you feel too scared\n", - " # \n", - " # make sure that only Y and N is possible (not weird other input > error message \" wow you are already failing here\"\n", - " # gameplay function starts again\n", - "\n", - "# possible problems with user input > error messages:\n", - " # not a letter\n", - " # same letter twice (show the user which letters he already used?)" - ] - } - ], - "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" - }, - "toc": { - "base_numbering": 1, - "nav_menu": {}, - "number_sections": true, - "sideBar": true, - "skip_h1_title": false, - "title_cell": "Table of Contents", - "title_sidebar": "Contents", - "toc_cell": false, - "toc_position": {}, - "toc_section_display": true, - "toc_window_display": false - }, - "varInspector": { - "cols": { - "lenName": 16, - "lenType": 16, - "lenVar": 40 - }, - "kernels_config": { - "python": { - "delete_cmd_postfix": "", - "delete_cmd_prefix": "del ", - "library": "var_list.py", - "varRefreshCmd": "print(var_dic_list())" - }, - "r": { - "delete_cmd_postfix": ") ", - "delete_cmd_prefix": "rm(", - "library": "var_list.r", - "varRefreshCmd": "cat(var_dic_list()) " - } - }, - "types_to_exclude": [ - "module", - "function", - "builtin_function_or_method", - "instance", - "_Feature" - ], - "window_display": false - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/your-project/Hangman.ipynb b/your-project/Hangman.ipynb new file mode 100644 index 0000000..37c17d6 --- /dev/null +++ b/your-project/Hangman.ipynb @@ -0,0 +1,361 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# The German Hangman Game\n", + "Here you will find my awesome code for the ultrahard German Hangman Game." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# START GAME\n", + "# user input \"name\" > all characters can be accepted\n", + "# print \"Hi \"name\", are you ready to get owned by German Hangman?\"\n", + "# wait 2 seconds, start game\n", + "\n", + "# CHOOSE RANDOM WORD\n", + "# get a random word from word_list\n", + "# convert all words from word_list to upper case \n", + "# store word in variable \"word\"\n", + "\n", + "# GAMEPLAY FUNCTION\n", + "# set 10 tries (user can guess as much as he wants, but fail only 10 times)\n", + "# display the length of \"word\" to the user with _ _ _ underscores\n", + "# Hidden letters are shown as underscores, guessed letters will be unmasked\n", + "# prompt the user to guess a letter or word \n", + " # user input convert to uppercase always\n", + "# while loop until word is guessed or user runs out of tries\n", + " # letter is in secret word > show letter in secret word, ask for user input again, show remaining tries, print \"Nice try!\"\n", + " # letter is not in secret word > -1 try and ask for user input again, show remaining tries, print \"This letter is not in the word, try again!\"\n", + "# if user runs out of tries (10) and looses:\n", + " # secret word is displayed, print \"\"name\" you loose, guess you got owned by German hangman\", start play again function\n", + "# if user wins or guesses the word right\n", + " # word is displayed, print \"\"name\" you win, you are ready to move to Berlin now!\", start play again function\n", + " \n", + "# PLAY AGAIN FUNCTION\n", + "# print \"Are you ready to play again?\"\n", + "# print \"enter \"Y\" to start \"N\" \n", + " # make sure that only Y and N is possible (not weird other input > error message \" wow you are already failing here\"\n", + " # gameplay function starts again\n", + "\n", + "# possible problems with user input > error messages:\n", + " # not a letter\n", + " # same letter twice (show the user which letters he already used?)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "word_list = [\n", + " 'Heizoelrueckstoßabdaempfung',\n", + " 'Donaudampfschifffahrtskapitaensgeselltschaftsmuetzenhalterung',\n", + " 'Lokomotivdampfkesseldruckventilverschlussklappe',\n", + " 'Kirschkernweitspuckwettbewerb',\n", + " 'Weihnachtsmannschokoladeneinpackpapier',\n", + " 'Atmosphaere',\n", + " 'Destinationslebenszyklusmodell',\n", + " 'Desoxyribonukleinsaeure',\n", + " 'Papierschnipselchen',\n", + " 'Arbeitsunfaehigkeitsbescheinigung',\n", + " 'Hundehaftpflichtversicherung']" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "import random" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "import time" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "What is your name? Sarah\n", + "Hello, Sarah are you ready to get owned by German Hangman?\n", + "Start guessing...\n", + "\n", + "\n" + ] + } + ], + "source": [ + "#Start of the game\n", + "\n", + "name = input(\"What is your name? \")\n", + "\n", + "print (\"Hello, \" + name, \"are you ready to get owned by German Hangman?\")\n", + "\n", + "time.sleep(2)\n", + "\n", + "print (\"Start guessing...\")\n", + "print(\"\\n\")\n", + "time.sleep(1)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "#Functions\n", + "\n", + "def get_word():\n", + " word = random.choice(word_list)\n", + " return word.upper()\n", + "\n", + "def play (word):\n", + " word_completion = (\"_\" * len(word))\n", + " guessed = False\n", + " guessed_letters = []\n", + " guessed_words = []\n", + " tries = 5\n", + "\n", + " print(word_completion)\n", + " print(\"\\n\")\n", + "\n", + " while guessed == False and tries > 0: #guessed letter\n", + " guess = input(\"Please guess a letter or word: \").upper()\n", + " if len(guess) == 1 and guess.isalpha():\n", + " if guess in guessed_letters:\n", + " print(\"You already guessed the letter\", guess)\n", + " elif guess not in word:\n", + " print(guess, \"is not in the word.\")\n", + " print(\"\\n\")\n", + " tries -= 1\n", + " guessed_letters.append(guess)\n", + " else:\n", + " print(\"Good job,\", guess, \"is in the word!\")\n", + " print(\"\\n\")\n", + " guessed_letters.append(guess)\n", + " word_as_list = list(word_completion)\n", + " indices = [i for i, letter in enumerate(word) if letter == guess]\n", + " for index in indices:\n", + " word_as_list[index] = guess\n", + " word_completion = \"\".join(word_as_list)\n", + " if \"_\" not in word_completion:\n", + " guessed = True\n", + " elif len(guess) == len(word) and guess.isalpha(): #guessed word\n", + " if guess in guessed_words:\n", + " print(\"You already guessed the word\", guess)\n", + " print(\"\\n\")\n", + " elif guess != word:\n", + " print(guess, \"is not the word.\")\n", + " print(\"\\n\")\n", + " tries -= 1\n", + " guessed_words.append(guess)\n", + " else:\n", + " guessed = True\n", + " word_completion = word\n", + " else:\n", + " print(\"Not a valid guess.\")\n", + " print(\"\\n\")\n", + " print(word_completion)\n", + " print(\"\\n\")\n", + " if guessed:\n", + " print(\"You win, you are ready to move to Berlin now!\")\n", + " print(\"\\n\")\n", + " else:\n", + " print(\"Sorry, you ran out of tries. The word was \" + word + \". Maybe next time!\")\n", + " print(\"\\n\")\n", + "\n", + "\n", + "def play_again():\n", + " again = input(\"Ready to play Again? Input (Y/N) \").upper()\n", + " print(\"\\n\")\n", + " if again == \"Y\":\n", + " play(word = get_word())\n", + " play_again()\n", + " elif again == \"N\":\n", + " print(\"Ciao Kakao!\")\n", + " else:\n", + " print(\"Y or N, no other input please...\")\n", + " print(\"\\n\")\n", + " play_again()" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "_____________________________\n", + "\n", + "\n", + "Please guess a letter or word: ü\n", + "Ü is not in the word.\n", + "\n", + "\n", + "_____________________________\n", + "\n", + "\n", + "Please guess a letter or word: ä\n", + "Ä is not in the word.\n", + "\n", + "\n", + "_____________________________\n", + "\n", + "\n", + "Sorry, you ran out of tries. The word was KIRSCHKERNWEITSPUCKWETTBEWERB. Maybe next time!\n", + "\n", + "\n", + "Ready to play Again? Input (Y/N) y\n", + "\n", + "\n", + "____________________________\n", + "\n", + "\n", + "Please guess a letter or word: ü\n", + "Ü is not in the word.\n", + "\n", + "\n", + "____________________________\n", + "\n", + "\n", + "Please guess a letter or word: ä\n", + "Ä is not in the word.\n", + "\n", + "\n", + "____________________________\n", + "\n", + "\n", + "Sorry, you ran out of tries. The word was HUNDEHAFTPFLICHTVERSICHERUNG. Maybe next time!\n", + "\n", + "\n", + "Ready to play Again? Input (Y/N) y\n", + "\n", + "\n", + "______________________________\n", + "\n", + "\n", + "Please guess a letter or word: ü\n", + "Ü is not in the word.\n", + "\n", + "\n", + "______________________________\n", + "\n", + "\n", + "Please guess a letter or word: q\n", + "Q is not in the word.\n", + "\n", + "\n", + "______________________________\n", + "\n", + "\n", + "Sorry, you ran out of tries. The word was DESTINATIONSLEBENSZYKLUSMODELL. Maybe next time!\n", + "\n", + "\n", + "Ready to play Again? Input (Y/N) n\n", + "\n", + "\n", + "Ciao Kakao!\n" + ] + } + ], + "source": [ + "play(word = get_word())\n", + "play_again()" + ] + }, + { + "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" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/your-project/Hangman.py b/your-project/Hangman.py new file mode 100644 index 0000000..cecf62f --- /dev/null +++ b/your-project/Hangman.py @@ -0,0 +1,180 @@ +#!/usr/bin/env python +# coding: utf-8 + +# # The German Hangman Game +# Here you will find my awesome code for the ultrahard German Hangman Game. + +# In[1]: + + +# START GAME +# user input "name" > all characters can be accepted +# print "Hi "name", are you ready to get owned by German Hangman?" +# wait 2 seconds, start game + +# CHOOSE RANDOM WORD +# get a random word from word_list +# convert all words from word_list to upper case +# store word in variable "word" + +# GAMEPLAY FUNCTION +# set 10 tries (user can guess as much as he wants, but fail only 10 times) +# display the length of "word" to the user with _ _ _ underscores +# Hidden letters are shown as underscores, guessed letters will be unmasked +# prompt the user to guess a letter or word + # user input convert to uppercase always +# while loop until word is guessed or user runs out of tries + # letter is in secret word > show letter in secret word, ask for user input again, show remaining tries, print "Nice try!" + # letter is not in secret word > -1 try and ask for user input again, show remaining tries, print "This letter is not in the word, try again!" +# if user runs out of tries (10) and looses: + # secret word is displayed, print ""name" you loose, guess you got owned by German hangman", start play again function +# if user wins or guesses the word right + # word is displayed, print ""name" you win, you are ready to move to Berlin now!", start play again function + +# PLAY AGAIN FUNCTION +# print "Are you ready to play again?" +# print "enter "Y" to start "N" + # make sure that only Y and N is possible (not weird other input > error message " wow you are already failing here" + # gameplay function starts again + +# possible problems with user input > error messages: + # not a letter + # same letter twice (show the user which letters he already used?) + + +# In[2]: + + +word_list = [ + 'Heizoelrueckstoßabdaempfung', + 'Donaudampfschifffahrtskapitaensgeselltschaftsmuetzenhalterung', + 'Lokomotivdampfkesseldruckventilverschlussklappe', + 'Kirschkernweitspuckwettbewerb', + 'Weihnachtsmannschokoladeneinpackpapier', + 'Atmosphaere', + 'Destinationslebenszyklusmodell', + 'Desoxyribonukleinsaeure', + 'Papierschnipselchen', + 'Arbeitsunfaehigkeitsbescheinigung', + 'Hundehaftpflichtversicherung'] + + +# In[3]: + + +import random + + +# In[4]: + + +import time + + +# In[5]: + + +#Start of the game + +name = input("What is your name? ") + +print ("Hello, " + name, "are you ready to get owned by German Hangman?") + +time.sleep(2) + +print ("Start guessing...") +print("\n") +time.sleep(1) + + +# In[21]: + + +#Functions + +def get_word(): + word = random.choice(word_list) + return word.upper() + +def play (word): + word_completion = ("_" * len(word)) + guessed = False + guessed_letters = [] + guessed_words = [] + tries = 5 + + print(word_completion) + print("\n") + + while guessed == False and tries > 0: #guessed letter + guess = input("Please guess a letter or word: ").upper() + if len(guess) == 1 and guess.isalpha(): + if guess in guessed_letters: + print("You already guessed the letter", guess) + elif guess not in word: + print(guess, "is not in the word.") + print("\n") + tries -= 1 + guessed_letters.append(guess) + else: + print("Good job,", guess, "is in the word!") + print("\n") + guessed_letters.append(guess) + word_as_list = list(word_completion) + indices = [i for i, letter in enumerate(word) if letter == guess] + for index in indices: + word_as_list[index] = guess + word_completion = "".join(word_as_list) + if "_" not in word_completion: + guessed = True + elif len(guess) == len(word) and guess.isalpha(): #guessed word + if guess in guessed_words: + print("You already guessed the word", guess) + print("\n") + elif guess != word: + print(guess, "is not the word.") + print("\n") + tries -= 1 + guessed_words.append(guess) + else: + guessed = True + word_completion = word + else: + print("Not a valid guess.") + print("\n") + print(word_completion) + print("\n") + if guessed: + print("You win, you are ready to move to Berlin now!") + print("\n") + else: + print("Sorry, you ran out of tries. The word was " + word + ". Maybe next time!") + print("\n") + + +def play_again(): + again = input("Ready to play Again? Input (Y/N) ").upper() + print("\n") + if again == "Y": + play(word = get_word()) + play_again() + elif again == "N": + print("Ciao Kakao!") + else: + print("Y or N, no other input please...") + print("\n") + play_again() + + +# In[20]: + + +play(word = get_word()) +play_again() + + +# In[ ]: + + + + diff --git a/your-project/README.md b/your-project/README.md index f3bdda9..c6cad63 100644 --- a/your-project/README.md +++ b/your-project/README.md @@ -16,19 +16,22 @@ This is a classic hangman game with a German twist. All words that you have to guess are in German and extremely hard. ## Rules -Briefly describe the rules of the game. +You have to guess the letter or the complete word in order to win. +As long as your guess is right you can keep on guessing. However you only have 5 wrong guesses before you loose the game. Don't worry, you can play again! ## Workflow Outline the workflow you used in your project. What are the steps you went through? ## Organization -How did you organize your work? Did you use any tools like a kanban board? +I organised my project with trello into tasks which are either in progress, almost done , done or in review. I also assigned deadlines to some tasks in order to be reminded. -What does your repository look like? Explain your folder and file structure. +I tried to keep it as clean and lean as possible, so it contains a gitignore, a readme, my code in a jupyter notebook, as well as my code in .py file so people can run it on their terminal. ## 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/Salevo/Project-Week-1-Build-Your-Own-Game) -[Slides](https://slides.com/) g drive + +[Slides](https://slides.com/) + [Trello](https://trello.com/b/HFYxcpUn/project-1-german-hangman) From 57a7a3f731bbdc7f9e275b3ea5805d791ce13869 Mon Sep 17 00:00:00 2001 From: Sarah Vonderberg Date: Fri, 26 Mar 2021 13:08:11 +0100 Subject: [PATCH 7/7] final push --- your-project/Hangman.ipynb | 3 ++- your-project/README.md | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/your-project/Hangman.ipynb b/your-project/Hangman.ipynb index 37c17d6..c3aa02e 100644 --- a/your-project/Hangman.ipynb +++ b/your-project/Hangman.ipynb @@ -56,7 +56,7 @@ "outputs": [], "source": [ "word_list = [\n", - " 'Heizoelrueckstoßabdaempfung',\n", + " 'Heizoelrueckstossabdaempfung',\n", " 'Donaudampfschifffahrtskapitaensgeselltschaftsmuetzenhalterung',\n", " 'Lokomotivdampfkesseldruckventilverschlussklappe',\n", " 'Kirschkernweitspuckwettbewerb',\n", @@ -145,6 +145,7 @@ " if len(guess) == 1 and guess.isalpha():\n", " if guess in guessed_letters:\n", " print(\"You already guessed the letter\", guess)\n", + " print(\"\\n\")\n", " elif guess not in word:\n", " print(guess, \"is not in the word.\")\n", " print(\"\\n\")\n", diff --git a/your-project/README.md b/your-project/README.md index c6cad63..5d13d1c 100644 --- a/your-project/README.md +++ b/your-project/README.md @@ -20,7 +20,15 @@ You have to guess the letter or the complete word in order to win. As long as your guess is right you can keep on guessing. However you only have 5 wrong guesses before you loose the game. Don't worry, you can play again! ## Workflow -Outline the workflow you used in your project. What are the steps you went through? +First I researched the game and played it a couple of times to outlines the rules and exceptions. +Then I started to organize my trello board, to see which tasks I need to finish (and by when) in order to have all things needed for the project. +After that I wrote my pseudocode to figure out what type of functions I will be needing for my game. I added the functions to my trello board to not loose oversight. +I started to build my git repo by forking the TA's repo, adding a gitignore and making sure it looks nice and clean. +After all the organizing I started to code. +During the coding I tested many of my gaming options to not miss any case. +After the raw version of the code was finished, I started testing for bugs, exceptions and to "prettyfie" the game adding breaks and timing. +After finalizing everything I made my presentation and added the updated readme file. + ## Organization I organised my project with trello into tasks which are either in progress, almost done , done or in review. I also assigned deadlines to some tasks in order to be reminded. @@ -32,6 +40,6 @@ Include links to your repository, slides and kanban board. Feel free to include [Repository](https://github.com/Salevo/Project-Week-1-Build-Your-Own-Game) -[Slides](https://slides.com/) +[Slides](https://drive.google.com/file/d/17tHtBMUqGDMOZoJVluFwWxX4IPsRyH6o/view?usp=sharing) [Trello](https://trello.com/b/HFYxcpUn/project-1-german-hangman)