From b1e6e9f15eb84d729812d27cc9abb9ed2ffeed8b Mon Sep 17 00:00:00 2001 From: nobu09 <11857481+nobu09@users.noreply.github.com> Date: Sun, 10 Dec 2023 22:06:23 +0900 Subject: [PATCH] =?UTF-8?q?=E9=80=86=E4=B8=89=E8=A7=92=E5=BD=A2=E3=82=92?= =?UTF-8?q?=E6=8F=8F=E3=81=84=E3=81=A6=E9=9A=99=E9=96=93=E3=82=92=E5=9F=8B?= =?UTF-8?q?=E3=82=81=E3=81=A6=E3=81=84=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- programs/tree.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/programs/tree.rb b/programs/tree.rb index 0a9770f..190ebe7 100644 --- a/programs/tree.rb +++ b/programs/tree.rb @@ -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