repl.it
@katiewinton/

Where's the 8?

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
import random
rowsAndColumns = 30
oddOneOut = random.randint(1, rowsAndColumns*rowsAndColumns)
def game():
  counter = 0
  for r in range(rowsAndColumns):
    row = ""
    for c in range(rowsAndColumns):
      counter += 1
      if counter == oddOneOut:
        row += ' 8'
      else:
        row += ' 0'
    print(row)

game()
?