[RESOLVED] Running games in Terminal (Tic Tac Toe)

edit this was resolved! forgot to actually call my game (lol) at the end of the game.rb file like so:

sally = HumanPlayer.new("sally")
bot = ComputerPlayer.new("bot")
game = Game.new(sally, bot)
game.play

will leave this up in case anyone else has a similar issue


Hi, I briefly asked this question in chat but thought I’d re-post here due to connectivity issues.

I was able to get all the specs for Tic Tac Toe to pass even though the game has a few bugs. For example, when the computer plays a turn, it doesn’t check whether or not the selected position is empty, which causes the computer to “lose” a turn if it selects a position that is already occupied.

Also, I’d like to improve playability by adding prompts such as (“Game over! #{winning_player} won.”, etc.).

What is the best way to actually run the program in Terminal to do ongoing testing? I was able to identify the above issues by copying and pasting all the code into a single repl.it, but that isn’t the ideal testing environment. I’ve tried ruby game.rb and irb -r ./game.rb while in the same directory with no luck.

Thanks in advance for the help!