Skip to content

Commit

Permalink
逆三角形を描いて隙間を埋めていく
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu09 committed Dec 10, 2023
1 parent 39c7174 commit b1e6e9f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions programs/tree.rb
Expand Up @@ -28,4 +28,22 @@ def draw
xIndex -= 0.5
yIndex += 1
end

fill("mediumseagreen")

# 逆三角形を描いていく
xIndex = $split / 2 - 0.5
yIndex = 1

for yIndex in 1..$split
xAdjust = 0

for xCount in 0...yIndex
triangle($xSlide * (xIndex + xAdjust), $ySlide * yIndex, $xSlide * (xIndex + xAdjust ++ 0.5), $ySlide * (yIndex + 1), $xSlide *(xIndex + xAdjust + 1), $ySlide * yIndex)
xAdjust += 1
end

xIndex -= 0.5
yIndex += 1
end
end

0 comments on commit b1e6e9f

Please sign in to comment.