Skip to content

Commit

Permalink
python: update dice experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
vpayno committed May 23, 2024
1 parent 0b2d89d commit 02c4979
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/src/dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ def roll_dice(self) -> None:
print("INFO: sides:" + str(self.sides) + " roll:" + str(self.roll))

def was_shaken(self) -> bool:
"""Checks to see if the dice was shaken.
:return: true when the last gesture was "shake"
"""

if accelerometer.was_gesture("shake"):
print("INFO: shaken, not stirred")

Expand All @@ -43,6 +48,11 @@ def was_shaken(self) -> bool:
return False

def was_touched(self) -> bool:
"""Checks to see if the logo pin is being held.
:return: true if the user is currently touching the pin logo
"""

if pin_logo.is_touched():
print("INFO: touched, not shaken")

Expand Down

0 comments on commit 02c4979

Please sign in to comment.