Sugoroku game and addition game with python

There are assignments to the same variable, etc.

Check the behavior of python and memorandum using the contents that match the text

Up to 30 alternate sugoroku games

pl_pos = 1
com_pos = 1

while True:

    input("enter-player moves")
    pl_pos = pl_pos + random.randint(1,6)
    
    if pl_pos>30:
        pl_pos = 30
        
    banmen()
    
    if pl_pos ==30:
        print("pl")
        break
        
    input("enter-com works")
    com_pos = com_pos + random.randint(1,6)
    
    if com_pos>30:
        com_pos = 30
        
    banmen()
    
    if com_pos ==30:
        print("com")
        break

Addition game

A = random.randint(1,100)
B = random.randint(1,100)

correct = A + B

ans = input("A = "+ str(A) + " B = "+str(B) +" A+What is the total of B?")
if ans == str(correct):
    print("Correct answer")
else:
    print("wrong" + str(correct) +"is")

that's all

[Introduction to game development made with Python](https://www.amazon.co.jp/Python%E3%81%A7%E3%81%A4%E3%81%8F%E3%82%8B-%E3 % 82% B2% E3% 83% BC% E3% 83% A0% E9% 96% 8B% E7% 99% BA-% E5% 85% A5% E9% 96% 80% E8% AC% 9B% E5% From BA% A7-% E5% BB% A3% E7% 80% AC-% E8% B1% AA / dp / 4800712394)

Recommended Posts

Sugoroku game and addition game with python
Programming with Python and Tkinter
Encryption and decryption with Python
Addition with Python if statement
python with pyenv and venv
Works with Python and R
Let's make a simple game with Python 3 and iPhone
Communicate with FX-5204PS with Python and PyUSB
Shining life with Python and OpenCV
Robot running with Arduino and python
Install Python 2.7.9 and Python 3.4.x with pip.
AM modulation and demodulation with python
[Python] font family and font with matplotlib
Scraping with Python, Selenium and Chromedriver
Scraping with Python and Beautiful Soup
Create an LCD (16x2) game with Raspberry Pi and Python
Hadoop introduction and MapReduce with Python
[GUI with Python] PyQt5-Drag and drop-
Life game with Python! (Conway's Game of Life)
Reading and writing NetCDF with Python
I played with PyQt5 and Python3
Reading and writing CSV with Python
Multiple integrals with Python and Sympy
Coexistence of Python2 and 3 with CircleCI (1.0)
Easy modeling with Blender and Python
FM modulation and demodulation with Python
Communicate between Elixir and Python with gRPC
Data pipeline construction with Python and Luigi
Monitor Mojo outages with Python and Skype
Let's make a shiritori game with Python
FM modulation and demodulation with Python Part 3
[Automation] Manipulate mouse and keyboard with Python
Passwordless authentication with RDS and IAM (Python)
Python installation and package management with pip
Using Python and MeCab with Azure Databricks
POST variously with Python and receive with Flask
Capturing images with Pupil, python and OpenCV
Fractal to make and play with Python
Use PIL and Pillow with Cygwin Python
Create and decrypt Caesar cipher with python
CentOS 6.4 with Python 2.7.3 with Apache with mod_wsgi and Django
Reading and writing JSON files with Python
Dealing with "years and months" in Python
I installed and used Numba with Python3.5
Linking python and JavaScript with jupyter notebook
Traffic monitoring with Kibana, ElasticSearch and Python
FM modulation and demodulation with Python Part 2
Encrypt with Ruby (Rails) and decrypt with Python
Easily download mp3 / mp4 with python and youtube-dl!
Operate home appliances with Python and IRKit
Clean python environment with pythonz and virtualenv
Easy web scraping with Python and Ruby
Importing and exporting GeoTiff images with Python
I'm using tox and Python 3.3 with Travis-CI
Happy GUI construction with electron and python
I made a roguelike game with Python
Use Python and MeCab with Azure Functions
Touch AWS with Serverless Framework and Python
RaspberryPi L Chika with Python and C #
Statistics with python
Python with Go