diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore.txt b/.gitignore.txt new file mode 100644 index 0000000..76b9408 --- /dev/null +++ b/.gitignore.txt @@ -0,0 +1,48 @@ + +# 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/.DS_Store b/your-project/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/your-project/.DS_Store differ diff --git "a/your-project/.ipynb_checkpoints/Code Game \"Guess the number\"-checkpoint.ipynb" "b/your-project/.ipynb_checkpoints/Code Game \"Guess the number\"-checkpoint.ipynb" new file mode 100644 index 0000000..4e5ed1e --- /dev/null +++ "b/your-project/.ipynb_checkpoints/Code Game \"Guess the number\"-checkpoint.ipynb" @@ -0,0 +1,154 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pseudocode\n", + "- Define random number with function\n", + "import random -> random.randint(1,20) -> safe random nr in variable\n", + "\n", + "- explain player rules: player needs to guess a integer nr, from a random generated range between 1 - 20. limit 5 guesses.\n", + "text with rules + input option for player. \n", + "input needs to be integer -> write it for player and in input\n", + "\n", + "- new player input for guessing up to 5 times. -> while loop with limit of 5\n", + "(- if wrong --> too high or too low)\n", + "- After 5 wrong ones --> stop\n", + "- if guessed --> great, player won!!! --> Stop" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "def guess_the_game():\n", + "\n", + " import random\n", + " x = random.randint(0, 20)\n", + " # print(x)\n", + "\n", + " count = 0\n", + " guess_lim = 5\n", + " guesses_left = 5\n", + "\n", + " print(\"Hi, you will have 5 guesses. Please choose a number between 0 and 20\\n\")\n", + "\n", + "\n", + " while count < guess_lim:\n", + " try:\n", + " guess = int(input(\"Can you guess the Secret Number?! Please type your guess as an integer: \"))\n", + " \n", + " if guess > 20 or guess < 0 :\n", + " print(\"Sorry, the number you guesses is without the requested range\\n\")\n", + " count = count + 1 \n", + " guesses_left = guesses_left - 1\n", + " print(\"You have\", (guesses_left), \"left\\n\")\n", + " \n", + " elif guess == x:\n", + " print(\"Woohooo!!! You won!! That's the correct number\\n\")\n", + " break\n", + " \n", + " elif guess > x:\n", + " print(\"Sorry, the number you guessed to too high\\n\")\n", + " count = count + 1 \n", + " guesses_left = guesses_left - 1\n", + " print(\"You have\", (guesses_left), \"left\\n\")\n", + " \n", + " else:\n", + " print(\"Sorry, the number you guessed is too low\\n\")\n", + " count = count + 1 \n", + " guesses_left = guesses_left - 1\n", + " print(\"You have\", (guesses_left), \"left\\n\")\n", + " \n", + " except ValueError:\n", + " print(\"Please enter an integer\")\n", + "\n", + " else:\n", + " print(\"Sorry, you lost, you reached 5 guesses... Thank's for playing\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "guess_the_game()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "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" + }, + "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/Code Game \"Guess the number\".ipynb" "b/your-project/Code Game \"Guess the number\".ipynb" new file mode 100644 index 0000000..4e5ed1e --- /dev/null +++ "b/your-project/Code Game \"Guess the number\".ipynb" @@ -0,0 +1,154 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pseudocode\n", + "- Define random number with function\n", + "import random -> random.randint(1,20) -> safe random nr in variable\n", + "\n", + "- explain player rules: player needs to guess a integer nr, from a random generated range between 1 - 20. limit 5 guesses.\n", + "text with rules + input option for player. \n", + "input needs to be integer -> write it for player and in input\n", + "\n", + "- new player input for guessing up to 5 times. -> while loop with limit of 5\n", + "(- if wrong --> too high or too low)\n", + "- After 5 wrong ones --> stop\n", + "- if guessed --> great, player won!!! --> Stop" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "def guess_the_game():\n", + "\n", + " import random\n", + " x = random.randint(0, 20)\n", + " # print(x)\n", + "\n", + " count = 0\n", + " guess_lim = 5\n", + " guesses_left = 5\n", + "\n", + " print(\"Hi, you will have 5 guesses. Please choose a number between 0 and 20\\n\")\n", + "\n", + "\n", + " while count < guess_lim:\n", + " try:\n", + " guess = int(input(\"Can you guess the Secret Number?! Please type your guess as an integer: \"))\n", + " \n", + " if guess > 20 or guess < 0 :\n", + " print(\"Sorry, the number you guesses is without the requested range\\n\")\n", + " count = count + 1 \n", + " guesses_left = guesses_left - 1\n", + " print(\"You have\", (guesses_left), \"left\\n\")\n", + " \n", + " elif guess == x:\n", + " print(\"Woohooo!!! You won!! That's the correct number\\n\")\n", + " break\n", + " \n", + " elif guess > x:\n", + " print(\"Sorry, the number you guessed to too high\\n\")\n", + " count = count + 1 \n", + " guesses_left = guesses_left - 1\n", + " print(\"You have\", (guesses_left), \"left\\n\")\n", + " \n", + " else:\n", + " print(\"Sorry, the number you guessed is too low\\n\")\n", + " count = count + 1 \n", + " guesses_left = guesses_left - 1\n", + " print(\"You have\", (guesses_left), \"left\\n\")\n", + " \n", + " except ValueError:\n", + " print(\"Please enter an integer\")\n", + "\n", + " else:\n", + " print(\"Sorry, you lost, you reached 5 guesses... Thank's for playing\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "guess_the_game()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "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" + }, + "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/README.md b/your-project/README.md index 2a8493d..855d675 100644 --- a/your-project/README.md +++ b/your-project/README.md @@ -1,9 +1,9 @@ Ironhack Logo -# Title of Your Project -*[Your Name]* +# Title of Your Project - Guess the Number Game +Nathalie Hubl -*[Your Cohort, Campus & Date]* +DAFT MAR2021, Remote/Berlin & 24.03.2021 ## Content - [Project Description](#project-description) @@ -13,22 +13,22 @@ - [Links](#links) ## Project Description -Write a short description of your project. Write 1-2 sentences about the game you chose to build and why. +In this game the player will have to guess a randomly selected number within the range 1 - 20. I think is a game that everyone can play, since it extremly simple to play. ## Rules -Briefly describe the rules of the game. +The player will have input 5 guesses in the game. ## Workflow -Outline the workflow you used in your project. What are the steps you went through? +First I took the time to think what is important in this project, which information do I need to give the player and how to code the program. After having an general idea, I started with a plan and a pseudocode, which I later converted into a code. Test runs to see if the game works. ## Organization -How did you organize your work? Did you use any tools like a kanban board? +I used Trello to outline the deadlines, using the template provided. -What does your repository look like? Explain your folder and file structure. +My code is in the folder "your-project" ## 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) +[Slides](https://drive.google.com/file/d/1kW-C1MAjjMBjpsPM3S6orFS4446FlqD1/view?usp=sharing) +[Trello](https://trello.com/b/R1ERGr5x/plan-for-guess-the-number-game)