Created
July 15, 2017 18:24
-
-
Save lf-/b41e64d9f62826fa8d62714cd565c6be to your computer and use it in GitHub Desktop.
A little randomizer script for Settlers of Catan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import random | |
board = ['wheat', 'wood', 'sheep'] * 4 + ['rock', 'brick'] * 3 + ['desert'] | |
random.shuffle(board) | |
slices = [ | |
board[0:3], | |
board[3:7], | |
board[7:12], | |
board[12:16], | |
board[16:19], | |
] | |
formatted_slices = [' '.join(s) for s in slices] | |
longest_slice = max(len(s) for s in formatted_slices) | |
for formatted_slice in formatted_slices: | |
print(formatted_slice.center(longest_slice)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment