Play game
Jump560's itch.io pageHow many characters of code did you use?
539
If you're comfortable with it, paste your game code here, so we can marvel at your achievement!
from random import randint as v
def u(p,x):
gb=['1','2','3','4','5','6','7']
if p[0]==x[0]:
gb[p[0]]="&"
return gb
for i in [p,x]:
j=i[0]
k=i[1]
if j>-1 and j<7:
gb[j] = k
return gb
def j(p,x):
d=int(input('Jump 1 or 2?'))
if d==1:
p[0]+=1
x[0]-=v(0,2)
elif d==2:
p[0]+=2
x[0]-=v(1,3)
else:
p,x=j(p,x)
return p,x
def g(gb):
print(*gb,sep="|")
def r():
p=[0,'p']
x=[6,'x']
gb=['p','2','3','4','5','6','x']
while not((p[0]>6) or (x[0]<0)):
g(gb)
p,x=j(p,x)
gb=u(p,x)
if p[0]>6:
print('Win')
elif x[0]<0:
print('Lose')
r()
input()
Leave a comment
Log in with itch.io to leave a comment.
Comments
No one has posted a comment yet