Sha256: fd32839e620ee8169237f80b3871a95be85d701578780e8ea955d6605e3bac49

Contents?: true

Size: 1.83 KB

Versions: 3

Compression:

Stored size: 1.83 KB

Contents

# frozen_string_literal: true

module Codebreaker
  module Messages
    class << self
      def logo
        puts " ]]]]    ]]]]   ]]]]]   ]]]]] \n" \
             "]]  ]]  ]]  ]]  ]]  ]]  ]]    \n" \
             "]]      ]]  ]]  ]]  ]]  ]]]]  \n" \
             "]]  ]]  ]]  ]]  ]]  ]]  ]]    \n" \
             " ]]]]    ]]]]   ]]]]]   ]]]]] \n" \
             "\n" \
             "]]]]]   ]]]]]   ]]]]]    ]]]]   ]]  ]]  ]]]]]   ]]]]]  \n" \
             "]]  ]]  ]]  ]]  ]]      ]]  ]]  ]] ]]   ]]      ]]  ]] \n" \
             "]]]]]   ]]]]]   ]]]]    ]]]]]]  ]]]]    ]]]]    ]]]]]  \n" \
             "]]  ]]  ]]  ]]  ]]      ]]  ]]  ]] ]]   ]]      ]]  ]] \n" \
             "]]]]]   ]]  ]]  ]]]]]   ]]  ]]  ]]  ]]  ]]]]]   ]]  ]] \n" \
             "\n"
      end

      def welcome
        puts 'Welcome to the Codebreaker game! Please choose one of the next options:'
      end

      def run
        puts "\n" \
             "1 - play        \n" \
             "2 - high scores \n" \
             "0 - exit        \n" \
             "\n"
      end

      def play
        puts "Let's go! \n" \
             "\n" \
             "1 - hint  \n" \
             "0 - end   \n" \
             "\n"
      end

      def win(answer)
        puts 'Congratulations! You are the winner!', "It was #{answer}.", "\n"
      end

      def lose(answer)
        puts 'Sorry, you lose(((', "It was #{answer}.", "\n"
      end

      def tries_left(tries_left)
        puts "#{tries_left} tries left.", "\n"
      end

      def hint(hint, hints_left, tries_left)
        if hint
          puts "Hint #{hint}.", "#{hints_left} hints_left."
          tries_left(tries_left)
        else
          puts 'No hints left.', "\n"
        end
      end

      def bye
        puts 'Good luck!'
      end

      def wrong_option
        puts 'Wrong option!'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ep-codebreaker-0.4.0 lib/ep-codebreaker/messages.rb
ep-codebreaker-0.3.2 lib/ep-codebreaker/messages.rb
ep-codebreaker-0.3.1 lib/ep-codebreaker/messages.rb