This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Game | |
| attr_accessor :turns, :current_player, :moves | |
| def initialize | |
| @players = [Player.new('X'), Player.new('O')] | |
| @current_player = @players.first | |
| @board = Board.new | |
| @player_index = 0 | |
| @turns = 0 | |
| @moves = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Logger | |
| def initialize | |
| @log = File.open("logfile.txt", "a") | |
| end | |
| @@instance = Logger.new | |
| def self.instance | |
| return @@instance | |
| end |
NewerOlder