Last active
November 24, 2015 02:48
-
-
Save jbwincek/1e0176c5fe3d100d7be0 to your computer and use it in GitHub Desktop.
A simple script that generates valid Boggle™ dice configurations.
This file contains 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
import random | |
import textwrap | |
# Actual Boggle dice | |
dice = ['aspffk', | |
'tesois', | |
'ehgewn', | |
'atwtoo', | |
'uensie', | |
'itmuoc', | |
'neagae', | |
'rixedl', | |
'saopch', | |
'uhnqim', | |
'eldvyr', | |
'trtyel', | |
'hvetwr', | |
'hlznrn', | |
'ttsdiy', | |
'abjoob', | |
] | |
random.shuffle(dice) | |
output = '' | |
for die in dice: | |
output += random.choice(die) | |
print(textwrap.fill(output,4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment