How do I allow user to select grid position in terminal (Ruby)?

123 views Asked by At

I'm trying to code a game where the user can choose a position to play, e.g. (2, 3). Instead of typing 2, 3 I'd like them to be able to use their arrow keys to select the position from a grid and press Enter once they've moved to the correct position. How can I do this in Ruby?

1

There are 1 answers

0
Eupatoria On

...are you trying to do Tic Tac Toe? Might be easier to just assign a position in the grid and have a user select it with one number instead of moving up and down the grid with arrows.