From a5d86f822c8454c6a5a8cf6c94b25dab60bfb0c1 Mon Sep 17 00:00:00 2001 From: BigGamerGary Date: Mon, 2 Feb 2026 22:42:08 +1000 Subject: [PATCH] Added basic wheel functionality --- src/py/slots/Slots.py | 6 ++++++ src/py/slots/Wheel.py | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/py/slots/Slots.py create mode 100644 src/py/slots/Wheel.py diff --git a/src/py/slots/Slots.py b/src/py/slots/Slots.py new file mode 100644 index 0000000..9adb1e1 --- /dev/null +++ b/src/py/slots/Slots.py @@ -0,0 +1,6 @@ +from Wheel import Wheel + +class SlotMachine(): + def __init__(self): + jackpot = 0 + wheel = Wheel() \ No newline at end of file diff --git a/src/py/slots/Wheel.py b/src/py/slots/Wheel.py new file mode 100644 index 0000000..d34fdf0 --- /dev/null +++ b/src/py/slots/Wheel.py @@ -0,0 +1,22 @@ +class Wheel(): + def __init__(self, size=3): + self.size=size + self.icons = list(range(size)) + + def roll(self, offset=1): + new_icons = list(range(self.size)) + for i, icon in enumerate(self.icons): + new_icons[(i + offset) % len(new_icons)] = icon + + self.icons = new_icons + + +def main(): + wheel = Wheel(size=10) + print(wheel.icons) + wheel.roll(offset=3) + print(wheel.icons) + + +if __name__ == "__main__": + main() \ No newline at end of file