# Drawing code stolen from here: # http://www.rubyquiz.com/quiz104.html $:.unshift File.expand_path(File.dirname(__FILE__) + "/../../lib") $:.unshift File.expand_path(File.dirname(__FILE__) + "/../../ext") require 'ray' class Ray::Turtle def byzantium(r, n) return if n < 1 forward r right 135 4.times do pen_down forward 2 * r * sin(PI / 4) pen_up byzantium(r / 2, n - 1) right 90 end left 135 backward r end end Ray::Game.new("Turtle") do register do add_hook :quit, method(:exit!) end scene :byzantium do render do |win| win.fill(Ray::Color.black).turtle do pen_up center byzantium(100, 4) end end end push_scene :byzantium end