repl.it
@peachyog/

Snakes and Ladders

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
square = 1
win = False

while True:
  roll = int(input())
  if roll == 0:
    break
  if square + roll <= 100:
    square += roll
  elif square + roll > 100:
    square = square
  if square == 9:
    square = 34
  elif square == 40:
    square = 64
  elif square == 54:
    square = 19
  elif square == 67:
    square = 86
  elif square == 90:
    square = 48
  elif square == 99:
    square = 77
  if square == 100:
    win = True
    break
  print("You are now on square",square)
if win == True:
  print("You Win!")
else:
  print("You Quit")

Fetching token
?