From 061b734069daf812d53732466caba9b19f66e81b Mon Sep 17 00:00:00 2001 From: Christian Hodgden Date: Fri, 28 Jun 2024 11:04:33 -0500 Subject: reference randomizer --- scripts/face_randomizer.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/face_randomizer.py (limited to 'scripts') diff --git a/scripts/face_randomizer.py b/scripts/face_randomizer.py new file mode 100644 index 0000000..60f53e5 --- /dev/null +++ b/scripts/face_randomizer.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import random + +def dot(position, spots): + if position in spots: + return(' ') + else: + return('*') + +def printFace(val): + spots = list(range(1, 10)) + for _ in range(val): + spots.remove(random.choice(spots)) + face = '|' + for i in range(1, 10): + face += f'{dot(i, spots)}|' + if i % 3 == 0 and i != 9: + face += '\n|' + print(val, face, sep='\n') + +for i in range(0,8): + printFace(i) + + -- cgit v1.2.3