PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from random import sample
from string import ascii_lowercase
# R is the number of letters in the game
R = 15
# sets and prints the initial state of the game
# %26 included to avoid Errors for R>26, but letters would repeat
game = [ascii_lowercase[l%26] for l in range(R)]
print("[" + "][".join(game) + "] \n" )
# shuffles and removes one random letter, then prints, R-1 times
for r in range(R-1, 0, -1):
game = sample(game, len(range(r)))
print( "[" + "][".join(game) + "]" )
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run