Skip to content

Instantly share code, notes, and snippets.

View netsprout's full-sized avatar
🌻
Working on automating my food computer...

Aaron Fry netsprout

🌻
Working on automating my food computer...
View GitHub Profile
@netsprout
netsprout / tic_tac_toe.rb
Last active May 18, 2024 22:29
Tic Tac Toe Command Line Game... who needs an iPhone when you can fire up a terminal window :)
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 = []
@netsprout
netsprout / logger.rb
Created September 22, 2012 06:10
Single Instance of a class (ex.Logger)
class Logger
def initialize
@log = File.open("logfile.txt", "a")
end
@@instance = Logger.new
def self.instance
return @@instance
end