Sha256: 2ab7aaed41eeae2ceced5dbd03056b1b8087fc7990ffe930de00f579d31bb30b

Contents?: true

Size: 943 Bytes

Versions: 3

Compression:

Stored size: 943 Bytes

Contents

#module Cardgame
=begin
  def challenge_participants(result)
      if result[:winner] == @gameplay.player
        challenge_player(result)
      else
        challenge_ai(result)
      end
    end

    def challenge_ai(result)
      if test_ai
        puts "Ai was correct."
      else
        puts "Ai was wrong. #{@gameplay.player.name} became the winner!"
        result[:winner] = @gameplay.player
      end
    end

    def challenge_player(result)
      if test_player
        puts "Correct! Yay!"
      else
        puts "Oooh. I'm sorry. The correct answer was 'TODO'. #{@gameplay.ai.name} became the winner."
        result[:winner] = @gameplay.ai
      end
    end


    def test_player
      question = @questions.sample
      puts question.pose
      answer = gets
      question.is_correct?(answer.chomp)
    end

    def test_ai(difficulty)
      difficulty ||= 0.4
      @ai.difficulty_check?(rand, difficulty)
    end

end
=end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
warcards-0.0.7 lib/warcards/cardgame.rb
warcards-0.0.6 lib/warcards/cardgame.rb
warcards-0.0.5 lib/warcards/cardgame.rb