Skip to content

Instantly share code, notes, and snippets.

@elsonidoq
Created September 14, 2020 18:01
Show Gist options
  • Save elsonidoq/314de311893099711f7d38b1cb290b59 to your computer and use it in GitHub Desktop.
Save elsonidoq/314de311893099711f7d38b1cb290b59 to your computer and use it in GitHub Desktop.
Random tateti
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Funciones para manipular el tablero"
]
},
{
"cell_type": "code",
"execution_count": 95,
"metadata": {},
"outputs": [],
"source": [
"from random import choice\n",
"\n",
"def random_move(board, who):\n",
" i, j = choice(get_available(board))\n",
" board[i][j] = who\n",
" \n",
"def _get_diags(board):\n",
" return [board[0][0], board[1][1], board[2][2]], [board[0][2], board[1][1], board[2][0]]\n",
"\n",
"def player_won(board, who):\n",
" target_row = [who] * 3\n",
" return (\n",
" any(row==target_row for row in board) or # filas \n",
" any(list(row)==target_row for row in zip(*board)) or # columnas\n",
" any(row==target_row for row in _get_diags(board)) # diagonales\n",
" )\n",
"\n",
"empty = '-'\n",
"def empty_board():\n",
" return [[empty] * 3 for _ in range(3)]\n",
"\n",
"def get_available(board):\n",
" return [(i, j) for i in range(3) for j in range(3) if board[i][j] is empty]\n",
"\n",
"def is_finished(board):\n",
" return not any(e is empty for row in board for e in row)\n",
"\n",
"def print_board(board):\n",
" [print(row) for row in board]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Funcion principal para simular una jugada random"
]
},
{
"cell_type": "code",
"execution_count": 134,
"metadata": {},
"outputs": [],
"source": [
"from itertools import cycle\n",
"\n",
"def play():\n",
" board = empty_board()\n",
" player_iter = cycle('XO')\n",
" winner = None\n",
" moves = {'X': 0, 'O': 0}\n",
" while not is_finished(board):\n",
" who = next(player_iter)\n",
" moves[who] += 1\n",
" random_move(board, who)\n",
" if player_won(board, who): \n",
" winner = who\n",
" break\n",
" return board, winner, moves.get(winner)\n"
]
},
{
"cell_type": "code",
"execution_count": 139,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"X 5\n",
"['O', 'O', 'X']\n",
"['X', 'X', 'X']\n",
"['O', 'O', 'X']\n"
]
}
],
"source": [
"board, winner, moves = play()\n",
"\n",
"print(winner, moves)\n",
"print_board(board)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Experimentos"
]
},
{
"cell_type": "code",
"execution_count": 148,
"metadata": {},
"outputs": [],
"source": [
"def winner_experiment(n=1000):\n",
" ends = {'X': 0, 'O': 0, None: 0}\n",
" for _ in range(n):\n",
" _, winner, moves = play()\n",
" ends[winner] += 1\n",
" return {k: v/n for k, v in ends.items()}\n",
"\n",
"def n_X_moves_experiment(n=1000):\n",
" l = []\n",
" for _ in range(n):\n",
" _, winner, moves = play()\n",
" if winner != 'X': continue\n",
" l.append(moves)\n",
" return {'moves': sum(l) / len(l)}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Number of moves for X to win"
]
},
{
"cell_type": "code",
"execution_count": 146,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x11bc9fb50>"
]
},
"execution_count": 146,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAASpElEQVR4nO3df4xd5X3n8fcndhAB7KaFdCoxIZM2VWPEQhqNQlOsMAb+CDWCVO1qYTG76dqyLDXEaTdizVolK0VWUynKkj+CLAs3bQVrsqXObgWFUAVfVcQBYceIhEzKokADTbMmlCgxmw04fPePe+lOxne4947nh+fh/ZKuOPc8z3PO90qXzxw/9/xIVSFJateblrsASdLiMuglqXEGvSQ1zqCXpMYZ9JLUuNXLXUA/55xzTk1MTC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Z+7+TLliQNa6Sgr6oO0Okt756x/nvA+BxjHgMm512hJOmkeGWsJDXOoJekxhn0ktS4nIpX7CV5HviH5a5D6uMc4PvLXYTUxzuq6m39Gk7JoJdOVUkOVZUnF2hFcepGkhpn0EtS4wx6aTR7lrsAaVTO0UtS4zyil6TGGfSS1DiDXpIaZ9BLUuMMer2hJJlI8q0ktyf5RpI7k1yR5CtJ/leS9yX5hST/I8njSR5OcmGSNyV5JslbZ2zrqSRjSd6W5K+SPNp7XdJrvzTJY73XkSSjPopTWhDzvh+9tIK9C/jXdJ9R/Cjwb4H1wNXAfwaeBY5U1YeSXAb8RVW9J8n/BH6b7jOQLwaeqar/neS/Af+1qh5Kch7wJWAd8HHg96vqK0nOAv7vEn9OCTDo9cb0dFV9HSDJE8CXq6qSfB2YAN4B/A5AVT2Y5OwkPwd8AbgF+Dzdp619obe9K4Dzk7y2/bW9o/evAJ9Jciewv6qeW5JPJ83i1I3eiH4yY/nVGe9fpXvwkxNGQAFfBd6V5G3Ah4D9vbY3Ae+vqvf0XudW1Y+q6lPAFuAtwMNJ3r0In0UayKCXTvR3wPUASaaA71fVD6t7deEXgc8A01X1Qq//A8BHXhuc5D29//5KVX29qv6E7qM2DXotC6dupBP9F7rz8I8D/wf49zPavkB3Xv/DM9Z9FPhcr/9qun8otgEfS7IB+CnwTeC+Ra9c6sNbIEhS45y6kaTGGfSS1DiDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcf8PIazZVPECrJYAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import pandas as pd\n",
"\n",
"pd.DataFrame([n_X_moves_experiment() for _ in range(100)]).boxplot()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Prob of winning"
]
},
{
"cell_type": "code",
"execution_count": 149,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x11be4ac40>"
]
},
"execution_count": 149,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAQh0lEQVR4nO3df6zddX3H8edrLSQoyH5UrwsgJbMGAcHMK2ji9IKDgJowp8uoRuNW17AEnCYamjXREdNY4szUiHbNiuKytTGbYoMVWKRnzqBJwSmzELSiQoeLUxf0MhSK7/1xD+54ue05t+fcnns+9/lITnq+3+/nfM/75NO+zqef74+TqkKSNPl+bdwFSJJGw0CXpEYY6JLUCANdkhphoEtSI1aP643XrFlTa9euHdfbL7lHHnmEpz/96eMuQ0fJ/ptcrffdXXfd9cOqeuZC28YW6GvXruXOO+8c19svuU6nw8zMzLjL0FGy/yZX632X5HuH2+aUiyQ1wkCXpEYY6JLUCANdkhphoEtSIwx0SWqEgS5JjTDQJakRY7uwaNIlGXof3ote0ig5Qj9KVXXEx+nX3Ny3jSSNkoEuSY0YKNCTXJrkviQHkmw6TJuZJF9Lsj/Jv462TElSP33n0JOsAq4HLgYOAvuS7K6qe3ra/DrwUeDSqnogybOWqmBJ0sIGGaGfDxyoqvur6jFgF3D5vDZvAD5dVQ8AVNUPRlumJKmfQc5yOQV4sGf5IHDBvDbPA45L0gFOAj5UVZ+cv6MkG4GNAFNTU3Q6naMoeXK0/vlaNjs7a/9NqJXcd4ME+kLn580/RWM18CLglcAJwJeTfKWqvvkrL6raDmwHmJ6eruV6z+Lzrr2Nhx99fOj9vOWWR4Z6/cknHMfX33PJ0HVo8Vq/p3bLVnLfDRLoB4HTepZPBR5aoM0Pq+oR4JEkXwTOA77JBHr40cf57tZXD7WPUfylWrvpc0O9XtLKMsgc+j5gXZIzkhwPXAHsntfms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x1LRep1PfDGJCfPW/8R4JNVdS7wD8CHe7b9NnODqtfQ/V9zkkuAdcD5wAuBFyV5+RLXfswY6EvjMuD7wDnjLkQDCwv/Vu7h1usY6n65fhJ427xNLwX+sfv875kL8CfdVFW/qKp7gKnuuku6j38HvgqcyVzAN2GgH7jQ4JK8ELgYeAnwpSS7qur7Yy5L/e0HXte7IskzmPs93W+PpSLN90HmQvjjR2jT++X7857n6fnzfVX1tyOubVlwhD5C3QNrH2NuquUB4P3AX4+3Kg3oC8DTkrwZIMkq5o5/fKKq/neslQmAqvox8ClgQ8/qO5j7nWOANwJf6rObW5k7LnIiQJJTkjxr1LWOi4E+Wn8GPFBV/9Jd/ihwZpJXjLEmDaDmLpl+LfBHSb4FfBP4GfCXYy1M832AudvjPultwJ8kuRt4E/AXR3pxVd3G3BTNl5P8B/BPwElLVOsx56X/ktQIR+iS1AgDXZIaYaBLUiMMdElqhIEuSY0w0CWpEQa6JDXi/wCLRkYaCzwLZQAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"pd.DataFrame([winner_experiment() for _ in range(100)]).boxplot()"
]
}
],
"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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment