Commit 961f75a
authored
fix(Nexto_EZ): buffer randomness value consistency (#335)
Updates the Nexto_EZ bot to match user expectations when the GUI slider
is unmodified.
* when initialized the `Nexto_EZ` class loads the shared memory buffer
with a value from 0-255 where 0 represents a fully random bot and 255
is fully nexto.
* when initialized the gui expects the value to be in the 0=fully-random
format and displays correctly, but does not update the value until
the slider is adjusted.
* when the slider is adjusted it writes a 0-255 value where 255 is
random and 0 is fully nexto. (Note that this is inverted from the
initialization step.)
* when deciding whether the tick should be random or not the `Nexto_EZ`
class expects the buffer to contain a 0-255 value where 255 is fully
random. (see line 50)
It seems to match expectations if the user modifies the slider before
playing. However if the slider is not changed, or when `SHOW_GUI` is set to
False the bot's behavior will be the inverse of expectation.
* update the initialization of the class and gui to set and expect the
0=fully-nexto 255=fully-random format, respectively.
* add debug logging to elevate confidence the bot is behaving as
expected. defaults to False/Off1 parent d7cc043 commit 961f75a
3 files changed
+37
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
24 | 33 | | |
25 | 34 | | |
26 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
27 | 40 | | |
28 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
29 | 50 | | |
30 | 51 | | |
| 52 | + | |
31 | 53 | | |
32 | 54 | | |
33 | 55 | | |
34 | 56 | | |
35 | 57 | | |
36 | 58 | | |
37 | 59 | | |
| 60 | + | |
38 | 61 | | |
39 | 62 | | |
40 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
0 commit comments