class AsciiParadise::StaticPacman

Constants

PACMAN_WIDTH
#

PACMAN_WIDTH

#

Public Class Methods

new( run_already = true ) click to toggle source
#

initialize

#
# File lib/ascii_paradise/static_ascii/static_pacman.rb, line 17
def initialize(
    run_already = true
  )
  run if run_already
end

Public Instance Methods

atan2(a, b) click to toggle source
#

atan2

#
# File lib/ascii_paradise/static_ascii/static_pacman.rb, line 33
def atan2(a, b)
  Math.atan2(a,b)
end
return_proper_width() click to toggle source
#

return_proper_width

#
# File lib/ascii_paradise/static_ascii/static_pacman.rb, line 26
def return_proper_width
  (-PACMAN_WIDTH .. PACMAN_WIDTH)
end
run() click to toggle source
#

run

#
# File lib/ascii_paradise/static_ascii/static_pacman.rb, line 40
def run
  (-10 .. 10).each { |y|
    _ = ''.dup
    return_proper_width.each {|x| 
      _ << ( x ** 2 + y ** 2 < 11 ** 2 && atan2(y,x) < Math::PI * 0.8 && atan2(y,x) >- Math::PI * 0.8 && x ** 2+(y+6) ** 2>1 ? '@':' ') * 2
    }
    puts _
  }
end