Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class
COUNTER
feature
count: INTEGER
is_dark: BOOLEAN
update_ui
do
io.put_string ("Counter: " + count.out + '\n')
io.put_string ("Theme: " + (if is_dark then "Dark" else "Light") + '\n')
end
increment
do
count := count + 1
update_ui
end
decrement
do
count := count - 1
update_ui
end
reset
do
count := 0
update_ui
end
toggle_theme
do
is_dark := not is_dark
update_ui
end
end
! Simulate actions
local
c: COUNTER
do
create c
c.update_ui
c.increment
c.increment
c.toggle_theme
c.decrement
c.reset
endCoding works best on desktop or with an external keyboard.