lib/reversi/game.rb
def run(mode = {})
      show_board if mode[:progress]
      loop do
        break if game_over?
        @status = @board.status
        @player_b.move(@board)
        check_move(:black)
        show_board if mode[:progress]

        @status = @board.status
        @player_w.move(@board)
        check_move(:white)
        show_board if mode[:progress]
      end
      puts @board.to_s if mode[:progress] || mode[:vs_human]
    rescue Interrupt
      exit 1
    end
# Execute a game and run until the end of the game.
#
# @option mode [Boolean] :progress Display the progress of the game.
# @option mode [Boolean] :vs_human 
Execute a game and run until the end of the game.
Execute a game and run until the end of the game .
def run(mode = {})
      show_board if mode[:progress]
      loop do
        break if game_over?
        @status = @board.status
        @player_b.move(@board)
        check_move(:black)
        show_board if mode[:progress]
        @status = @board.status
        @player_w.move(@board)
        check_move(:white)
        show_board if mode[:progress]
      end
      puts @board.to_s if mode[:progress] || mode[:vs_human]
    rescue Interrupt
      exit 1
    end
def run ( mode = { } ) show_board if mode [ :progress ] loop do break if game_over? @status = @board . status @player_b . move ( @board ) check_move ( :black ) show_board if mode [ :progress ] @status = @board . status @player_w . move ( @board ) check_move ( :white ) show_board if mode [ :progress ] end puts @board . to_s if mode [ :progress ] || mode [ :vs_human ] rescue Interrupt exit 1 end
Execute a game and run until the end of the game.
Execute a game and run until the end of the game .
mode
None