Skip to content

more user friendly i/o #4

@raspberryaether

Description

@raspberryaether

Currently input is somewhat inconvenient as input is rather unconstrained and may cause undefined behavior. Output is also unnecessarily verbose and cryptic.

We should change this. Currently after a newline is used to lock in a roll, a new prompt shows the number of rolls remaining. There is no way to revise prior rolls. We should instead use the following state-based model:

  • Rearrange output to a grid structure, with N columns where N is the number of rolls per word.
  • When N cells are confirmed, the corresponding word is printed at the end of the line and the cursor moves to the first cell on the next line.
  • In any cell:
    • Numeric input is only accepted if it would result in a valid roll. Otherwise, an alert bell is emitted.
  • In an empty cell:
    • [Backspace] or [-] moves the cursor to the end of the previous cell or emits an alarm bell if this is not possible.
    • [Enter] or [.] emits an alarm bell.
  • In a non-empty cell:
    • [Backspace] or [-] removes the most recently entered digit and puts the cursor in its place.
    • [Enter] or [.] locks in the roll and moves the cursor to the next cell.

Acceptance criteria:

  • Input and output follows the new scheme detailed above.
  • Behavior is tested both with a terminal emulator and a Windows command prompt.

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions