Skip to content

Commit

Permalink
python: update rock-paper-scissors experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
vpayno committed May 18, 2024
1 parent f641cd6 commit 3d4b4df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/src/rock-paper-scissors.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ def group_browse(self) -> None:
sleep(500)

if button_b.was_pressed():
self.group = (self.group + self.group_offset) % self.group_size
self.group = (max(self.group, 0) + self.group_offset) % self.group_size
print("INFO: current group [" + str(self.group) + "]")
display.scroll(self.group)

if button_a.was_pressed():
self.group = (self.group - self.group_offset) % self.group_size
self.group = (max(self.group, 0) - self.group_offset) % self.group_size
print("INFO: current group [" + str(self.group) + "]")
display.scroll(self.group)

Expand Down Expand Up @@ -281,14 +281,14 @@ def rune_browse(self) -> None:
sleep(500)

if button_b.was_pressed():
self.rune_index = (self.rune_index + 1) % self.runes_size
self.rune_index = (max(self.rune_index, 0) + self.rune_offset) % self.runes_size
self.rune_name = self.runes[self.rune_index]
print("INFO: current rune [" + self.rune_name + "]")
display.show(self.runes[self.rune_index])
sleep(500)

if button_a.was_pressed():
self.rune_index = (self.rune_index - 1) % self.runes_size
self.rune_index = (max(self.rune_index, 0) - self.rune_offset) % self.runes_size
self.rune_name = self.runes[self.rune_index]
print("INFO: current rune [" + self.rune_name + "]")
display.show(self.rune_name)
Expand Down

0 comments on commit 3d4b4df

Please sign in to comment.