mirror of
https://codeberg.org/cblanken/boggler.git
synced 2026-07-26 03:29:26 -04:00
Randomize order of dice on the board
This commit is contained in:
+2
-1
@@ -1,5 +1,5 @@
|
|||||||
from sys import argv
|
from sys import argv
|
||||||
from random import randint
|
from random import randint, shuffle
|
||||||
from math import sqrt
|
from math import sqrt
|
||||||
|
|
||||||
def readDiceFile(path):
|
def readDiceFile(path):
|
||||||
@@ -31,6 +31,7 @@ if __name__ == '__main__':
|
|||||||
print('Usage: python3 board_randomizer DICE_FILE')
|
print('Usage: python3 board_randomizer DICE_FILE')
|
||||||
else:
|
else:
|
||||||
dice = readDiceFile(argv[1])
|
dice = readDiceFile(argv[1])
|
||||||
|
shuffle(dice)
|
||||||
rolls = rollDice(dice)
|
rolls = rollDice(dice)
|
||||||
|
|
||||||
# Format dice rolls for boards file
|
# Format dice rolls for boards file
|
||||||
|
|||||||
Reference in New Issue
Block a user