은 지금 감사가 도움을, 단 2뱀과 사다리 주사위 문제 (파이썬)
그래서 나는 뱀과 사다리 게임을 만들었습니다 그리고 난 주사위에 문제가있어 내 선수에 대한 모든 것을 들여 쓰기에 필요한 고정 :
while player1roll != "YES":
player1roll=input("player1 ready to roll??\n").upper
player1roll=random.choice(dice)
print("you rolled a:", player1roll)
이 후에는 "player1 ready to roll ??" 여기
내 재생기 코드의 전체입니다 :while selection != "PVP" or "AI":
selection=input("player vs player(PVP) or with AI (AI)??\n").upper()
if selection == "PVP":
while player1pos or player2pos <100:
**while player1roll != "YES":
player1roll=input("player1 ready to roll??\n").upper
player1roll=random.choice(dice)
print("you rolled a:", player1roll)**
player1pos+=player1roll
if board[player1pos] >0: #if the number is bigger than 0 its a ladder
print("you found a ladder")
player1pos+= board[player1pos] #find the position its supposed to be at on the board
print("player1 is at position:",player1pos)
print("")
elif board[player1pos] <0: #if the number is negative then its a snake
print("you found a snake")
player1pos+=board[player1pos]
print("player 1 is at position:",player1pos)
print("")
else: #if its just a 0 they stay at that position
print("player1 is at position:",player1pos)
print("")
if 100<=player1pos: #if the player position is 100 or more they win
print("player1 win")
quit()
당신은 내가 시도하고 가능 :
는 나는 그것을 while 루프하지 수 있도록했는데 잊었 if 문 내가 문제를 해결할뿐만 아니라 나는 그것이 나던 – groot
음을 업로드 할 때 때문에 그게 전부 내가 그것을 변경하기 전에 내가 그것을 가지고 무엇을 if 문으로 돌아 가기 – rahlf23
을 가정 수있는 그것을 – groot