Calculated the ease of stopping the house of the board game "Bunkers" with Python

I played the board game "Bunkers" at the end of the year and was interested in the fact that there was a house that was clearly easy to stop, so I decided to simulate it and calculate the ease of stopping. The environment was Pythonista on the iPhone.

Execution result

For those who want to know only the result, the execution result is shown first. The horizontal axis is the number of times the simulation stopped. 89A0A821-CE31-4BA4-8075-0ADDE64B2D21.jpeg

Simulation policy

Perform a simulation, count the number of times you have stopped at home, and repeat it a sufficiently large number to compare the converged values.

Board mounting

There are 40 squares on the board, and after the 40th, it returns to the 1st. Therefore, the total number of movements is counted, and the cell is determined by the remainder calculation.

Mass not implemented

For squares that do not affect the ease of stopping (how to move), do not implement any particular details and treat them as squares where nothing happens (actually, money is taken or received).

How to judge that it has stopped

It is determined that the square has stopped at the end of one turn. Because every time I stay at home, the turn ends there. Also, the purpose of this simulation is to calculate and compare the ease of stopping a house.

How to evaluate the mass

Evaluate the mass by creating a function to move the cell and moving through it.

Evaluation function of mass


def stepEval(steps, count, card):
	if (count + steps) % len(BOARD) == 18:
		if steps == 7:
			return steps
	if steps == 0:
		return 0
	else:
		count += steps
		next_steps = BOARD[where_board(count)].getMove(card, where_board(count))
		return steps + stepEval(next_steps, count, card)

Source code

GitHub: https://github.com/huwns/bankers/blob/main/analyze_bankers.py

Recommended Posts

Calculated the ease of stopping the house of the board game "Bunkers" with Python
About the ease of Python
Save the result of the life game as a gif with python
Check the existence of the file with python
Prepare the execution environment of Python3 with Docker
2016 The University of Tokyo Mathematics Solved with Python
[Note] Export the html of the site with python.
Calculate the total number of combinations with python
Check the date of the flag duty with Python
Convert the character code of the file with Python3
[Python] Determine the type of iris with SVM
The story of stopping the production service with the hostname command
Destroy the intermediate expression of the sweep method with Python
the zen of Python
Calculate the regression coefficient of simple regression analysis with python
Summary of the basic flow of machine learning with Python
Get the operation status of JR West with Python
Extract the band information of raster data with python
I wrote a doctest in "I tried to simulate the probability of a bingo game with Python"
I tried to find the entropy of the image with python
Try scraping the data of COVID-19 in Tokyo with Python
The story of implementing the popular Facebook Messenger Bot with python
Unify the environment of the Python development team starting with Poetry
Visualize the results of decision trees performed with Python scikit-learn
Calculate the square root of 2 in millions of digits with python
I wrote the basic grammar of Python with Jupyter Lab
Run the intellisense of your own python library with VScode.
Check the scope of local variables with the Python locals function.
Let's touch the API of Netatmo Weather Station with Python. #Python #Netatmo
The story of rubyist struggling with python :: Dict data with pycall
Try to automate the operation of network devices with Python
Rewrite the record addition node of SPSS Modeler with Python.
[Python] The first step to making a game with Pyxel
Estimate the attitude of AR markers with Python + OpenCV + drone
I tried a stochastic simulation of a bingo game with Python
Play with the password mechanism of GitHub Webhook and Python
Get the source of the page to load infinitely with python.
Call the API with python3.
About the features of Python
The Power of Pandas: Python
Life game with Python [I made it] (on the terminal & Tkinter)
I compared the speed of Hash with Topaz, Ruby and Python
I tried scraping the ranking of Qiita Advent Calendar with Python
March 14th is Pi Day. The story of calculating pi with python
Color extraction with Python + OpenCV solved the mystery of the green background
[python, ruby] fetch the contents of a web page with selenium-webdriver
I want to output the beginning of the next month with Python
Output the contents of ~ .xlsx in the folder to HTML with Python
The story of making a standard driver for db with python.
I tried to fix "I tried stochastic simulation of bingo game with Python"
[Talking about the drawing structure of plotly] Dynamic visualization with plotly [python]
Visualize the frequency of word occurrences in sentences with Word Cloud. [Python]
Let's summarize the degree of coupling between modules with Python code
Rewrite the sampling node of SPSS Modeler with Python (2): Layered sampling, cluster sampling
The idea of feeding the config file with a python file instead of yaml
Tips: [Python] Calculate the average value of the specified area with bedgraph
Practical edition of automating the testing of Flutter apps with Appium (Python)
From the introduction of JUMAN ++ to morphological analysis of Japanese with Python
I tried to improve the efficiency of daily work with Python
The story of making a module that skips mail with python
Create a compatibility judgment program with the random module of python.