Skip to content

Instantly share code, notes, and snippets.

@jbwincek
Last active November 24, 2015 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbwincek/1e0176c5fe3d100d7be0 to your computer and use it in GitHub Desktop.
Save jbwincek/1e0176c5fe3d100d7be0 to your computer and use it in GitHub Desktop.
A simple script that generates valid Boggle™ dice configurations.
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