class

StdinDriver

Inherits InputDriver < Reference < Object

Reads actions from an IO (standard input by default). The IO is injectable so the driver can be unit-tested without touching the real STDIN.

Constructors

new(input : IO = STDIN)
Source

Instance methods

next_action(state : GameState, last_response : String | Nil) : String | Nil

Return the next action string, or nil to end the game (EOF / stop signal).

Source