You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having the stack in a module is not the only state that needs access and mutation from the calculator actions, as well as roll-back upon crash.
Create a "State" class that also contains verbose/not verbose modes, toggles for clearing the stack (or not) after commands, and move the stored values into this class as well.
This would also be a good time to store a history of the most recent few actions so that they can be repeated, something akin to rpncalc d4 10 repeat_n to roll 4-sided dice 10 times.
The text was updated successfully, but these errors were encountered:
Having the stack in a module is not the only state that needs access and mutation from the calculator actions, as well as roll-back upon crash.
Create a "State" class that also contains verbose/not verbose modes, toggles for clearing the stack (or not) after commands, and move the stored values into this class as well.
This would also be a good time to store a history of the most recent few actions so that they can be repeated, something akin to
rpncalc d4 10 repeat_n
to roll 4-sided dice 10 times.The text was updated successfully, but these errors were encountered: