Watch 2 Star 2 Fork 0

RCPI / pi4bPythonMulanPSL-2.0

Join us
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
这里是针对树莓派4B的远程控制类python程序代码 spread retract

https://gitee.com/rcpi/pi4b

Clone or download
pk.py 436 Bytes
Copy Edit Web IDE Raw Blame History
RCPI authored 2020-03-28 03:18 . 代码游戏石头剪刀布
#!/usr/bin/python
# -*- coding:utf-8 -*-
import os
import random
doscls = os.system("cls")
while True:
player = int(input("请输入 0剪刀 1石头 2布:"))
computer = random.randint(0, 2)
if (player == 0 and computer == 2) or (player == 1 and computer == 0) or (player == 2 and computer == 1):
print("赢了")
elif player == computer:
print("平局")
else:
print("输了")

Comment ( 0 )

Sign in for post a comment

Python
1
https://gitee.com/rcpi/pi4b.git
git@gitee.com:rcpi/pi4b.git
rcpi
pi4b
pi4b
master

Help Search

205735 778617b6 1899542 205747 347fc4a1 1899542