Skip to content

Commit

Permalink
真ん中だけ緑で描画する
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu09 committed Dec 4, 2023
1 parent 7a8547d commit a25c2ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion programs/tree.rb
Expand Up @@ -11,10 +11,14 @@ def draw
noStroke

x = 0
y = 0

for xIndex in 0..width
y = 0
fill("green")

color = (xIndex == 4) ? "green" : "white"
fill(color)

for yIndex in 0..height
if yIndex.even?
triangle(x, y + $ySlide, x + $xSlide / 2, y, x + $xSlide, y + $ySlide)
Expand Down

0 comments on commit a25c2ab

Please sign in to comment.