用户:
6212377查看:0 回复:0 评论:0 创建时间:2022-08-16T17:52:44
import turtle
import random
g = turtle.Pen()
c = 0
x = 0
y = 0
h = 0
xx = random.randint(-50,50)
yy = random.randint(-50,50)
x = random.randint(-50,50)
y = random.randint(-50,50)
print('接下来开始游戏,请阅读说明:')
print('1 2 3 4 分别对应上 下 左 右。及控制发方向。输入均为方向。每次行走一个单位。需要玩家控制点到达终点。')
print('本游戏为纯文字。')
for count in range(喵):
print('目标坐标')
print(x,y)
print('你的坐标')
print(xx,yy)
h = int(input(''))
if(h == 1):
yy += 1
if(yy <= 50):
function()
elif(yy >= 50):
yy -= 1
print('超出边界!')
elif(h == 2):
yy -= 1
if(yy >= -50):
function()
elif(yy < -50):
yy += 1
print('超出边界')
elif(h == 3):
xx -= 1
if(xx <= 50):
function()
elif(xx >= 50):
xx += 1
print('超出边界')
elif(h == 4):
xx += 1
if(xx <= 50):
function()
elif(xx >= 50):
xx -= 1
def function():
print('当前坐标:')
print(xx)
print(yy)
print('__________________________')
if((xx == x) and (yy == y)):
print('已到达终点')
兄弟们,就这么几行代码,我换了三个浏览器,全nm跑崩了。我想着不能是芯片的事,毕竟我电脑用的是八核的。
那到底是怎么回事呢?谷歌、360、edge跑不了区区59行代码?