diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..cbf3219 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a34fd4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,156 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/jupyternotebooks,python +# Edit at https://www.toptal.com/developers/gitignore?templates=jupyternotebooks,python + +### 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/ + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +pytestdebug.log + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ +doc/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook + +# IPython + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +pythonenv* + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# profiling data +.prof + +# End of https://www.toptal.com/developers/gitignore/api/jupyternotebooks,python \ No newline at end of file diff --git a/your-project/.DS_Store b/your-project/.DS_Store new file mode 100644 index 0000000..4c5568b Binary files /dev/null and b/your-project/.DS_Store differ diff --git a/your-project/Guess The Number.ipynb b/your-project/Guess The Number.ipynb new file mode 100644 index 0000000..a913c03 --- /dev/null +++ b/your-project/Guess The Number.ipynb @@ -0,0 +1,262 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import ipywidgets as widgets" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import random" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello Ironhacker! What is your name?\n", + "filipe\n" + ] + } + ], + "source": [ + "print(\"Hello Ironhacker! What is your name?\")\n", + "name = input()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "first_round = widgets.IntSlider(\n", + " min=0,\n", + " max=10,\n", + " step=1,\n", + " description='Round 1:',\n", + " disabled=False,\n", + " continuous_update=False,\n", + " orientation='horizontal',\n", + " readout=True,\n", + " readout_format='d' \n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c0ab5c23df564da183d5f9b191f7fcb3", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "IntSlider(value=0, continuous_update=False, description='Round 1:', max=10)" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "first_round" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "int(first_round.value)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "number = random.randint(1, 10)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ironhacker filipe, your number is below, try again!\n" + ] + } + ], + "source": [ + "for i in range(1): \n", + " \n", + " if first_round.value > number:\n", + " print(\"Ironhacker \" + name + \", your number is higher, try again!\")\n", + " continue\n", + " \n", + " elif first_round.value < number:\n", + " print(\"Ironhacker \" + name + \", your number is below, try again!\")\n", + " continue\n", + "\n", + " else:\n", + " print(\"Ironhacker \" + name + \", you win!!!!\")\n", + " break\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "second_round = widgets.Dropdown(\n", + " options=['1', '2', '3','4', '5', '6','7', '8', '9', '10'],\n", + " description='Round 2:',\n", + " disabled=False,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "d2a6aa0fa4b745a3b987f66ccf05b064", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Dropdown(description='Round 2:', index=9, options=('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'), value='…" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "second_round" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'7'" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "second_round.value" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ironhacker filipe, your number is higher, the number was 1, you lost.\n" + ] + } + ], + "source": [ + "for i in range(1): \n", + " \n", + " if int(second_round.value) > number:\n", + " print(\"Ironhacker \" + name + \", your number is higher, the number was \" + str(number) + \", you lost.\")\n", + " continue\n", + " \n", + " elif int(second_round.value) < number:\n", + " print(\"Ironhacker \" + name + \", your number is below, the number was \" + str(number) + \", you lost.\")\n", + " continue\n", + "\n", + " else:\n", + " print(\"Ironhacker \" + name + \", you win!!!!\")\n" + ] + }, + { + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/your-project/README.md b/your-project/README.md index 2a8493d..27fbbc8 100644 --- a/your-project/README.md +++ b/your-project/README.md @@ -1,9 +1,9 @@ Ironhack Logo -# Title of Your Project -*[Your Name]* +# Try your luck +*[María González]* -*[Your Cohort, Campus & Date]* +*[Barcelona & 23/10/2020]* ## Content - [Project Description](#project-description) @@ -13,22 +13,21 @@ - [Links](#links) ## Project Description -Write a short description of your project. Write 1-2 sentences about the game you chose to build and why. +Ironhacker will have two opportunities out of ten options to win the game. ## Rules -Briefly describe the rules of the game. +Ironhacker may guess a number between 1 and 10, during the first round it will inform if the number is higher or lower. ## Workflow -Outline the workflow you used in your project. What are the steps you went through? +At the time of using widgets the Ironhacker may select the number option and use the for conditional in order to give the result of the guess. ## Organization -How did you organize your work? Did you use any tools like a kanban board? +First at all think about the project, in order to have clear the game that you want to code. Then think how you can introduce the widgets to your game. Finally, start coding from the easy part until the code gives you the right answer and then start increasing the difficulty. -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/merygongon/Project-Week-1-Build-Your-Own-Game) +[Slides](https://docs.google.com/presentation/d/1quTrhqB8eR5jZW86XBUeE1pTyHuwqpgrxi9args5bkI/edit?usp=sharing) +[Trello](https://trello.com/b/Z3mcWRBP/guess-the-number)