File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88"""
99
1010import time
11- import board
1211from random import randint
12+ import board
1313from adafruit_clue import clue
1414from adafruit_debouncer import Debouncer
1515import displayio
1616from adafruit_bitmap_font import bitmap_font
17- import terminalio
1817from adafruit_display_text import label
1918
2019
2625SELECTING = 0
2726ROLL_RESULT = 1
2827
29- number_of_dice = 0 # 0-relative, gets adjusted to 1-relative before display/use
28+ # 0-relative, gets adjusted to 1-relative before display/use
29+ number_of_dice = 0
3030side_selection = 0
3131
3232button_a = Debouncer (lambda : clue .button_a )
5757
5858def roll (count , sides ):
5959 for i in range (15 ):
60- roll = sum ([randint (1 , sides ) for d in range (count + 1 )])
61- roll_label .text = str (roll )
60+ roll_value = sum ([randint (1 , sides ) for d in range (count + 1 )])
61+ roll_label .text = str (roll_value )
6262 roll_label .x = 120 - (roll_label .bounding_box [2 ] // 2 )
6363 duration = (i * 0.05 ) / 2
6464 clue .play_tone (2000 , duration )
You can’t perform that action at this time.
0 commit comments