{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Penney's Game \n", "----------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Environment Check" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Checking that the notebook is running on Google Colab or not." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import sys\n", "try:\n", " import google.colab\n", " !{sys.executable} -m pip -q -q install penney\n", "except:\n", " pass" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Game" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from penney.functions import menu_handler" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " __ __ _____ _ _ _ _ \n", "| \\/ || ____|| \\ | || | | | _ \n", "| |\\/| || _| | \\| || | | | (_) \n", "| | | || |___ | |\\ || |_| | _ \n", "|_| |_||_____||_| \\_| \\___/ (_) \n", " \n", "\n", "- Play with computer [1]\n", "- Play with other players [any other key]\n", "Please select : 1\n", "###########\n", "- Fast simulation [1]\n", "- Step by step [any other key]\n", "Please select : 1\n", "###########\n", "Please enter number of rounds : 3\n", "Please enter sequence length : 3\n", "Please enter player-1 name : Sepand\n", "Computer sequence : TTH\n", "[Sepand] Please enter your sequence : HHT\n", "###########\n", "Wining Probability : \n", "Sepand 50.000%\n", "Computer 50.000%\n", "###########\n", "Scores Table : \n", "Sepand 2 HHT\n", "Computer 1 TTH\n", "Winner : Sepand\n" ] } ], "source": [ "menu_handler()" ] } ], "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.5.2" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": false, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Penney", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }