Skip to content

Commit

Permalink
1段目から一つずつ重ねる
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu09 committed Dec 9, 2023
1 parent 29ebefe commit 26b1778
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions programs/tree.rb
Expand Up @@ -9,24 +9,7 @@ def setup
def draw
noLoop
noStroke

x = 0
y = 0

for xIndex in 0..width
y = 0

color = xIndex.even? ? "green" : "red"
fill(color)

for yIndex in 0..height
if yIndex.even?
triangle(x, y + $ySlide, x + $xSlide / 2, y, x + $xSlide, y + $ySlide)
else
triangle(x, y, x + $xSlide, y, x + $xSlide / 2, y + $ySlide)
end
y += $ySlide
end
x += $xSlide
end
fill("green")
triangle($xSlide * 4.5, $ySlide * 0, $xSlide * 4, $ySlide * 1, $xSlide * 5, $ySlide * 1)
end

0 comments on commit 26b1778

Please sign in to comment.