Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def print_rechteck(x, y, breite)
- start = Time.now
- y.times do |ay|
- arr = Array.new(x, " ")
- if ay < breite or ay >= y - breite
- puts "#" * x
- else
- ((1..breite).to_a + ((x - breite + 1)..x).to_a).each {|i| arr[i-1] = "#"}
- puts arr.join
- end
- end
- puts Time.now - start
- end
- print_rechteck(120,1000,2)
Add Comment
Please, Sign In to add comment