Sha256: 73dfdef7d8d259f1535162013ef1c72244dae6b1be57314765cc66026fdd3c3d

Contents?: true

Size: 524 Bytes

Versions: 1

Compression:

Stored size: 524 Bytes

Contents

class EnjoyMarkov
  class << self
    def start!(supinf, speed)
      @@x = 0
      loop do
        @@x += [-1, 1].sample # TODO: use prefer randmGen
        break if supinf == @@x.abs
        puts "#{wall}#{space * supinf}#{axis}#{space * supinf}#{wall}".tap { |s| s[@@x + supinf + 1] = point }
        sleep speed
      end
      puts 'Ops... ;('
    end

    private
      def axis;  "|"            end
      def wall;  "|"            end
      def point; "\e[31m*\e[0m" end
      def space; "\s"           end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enjoy_markov-0.1.0 lib/enjoy_markov.rb