Greyscale bars/Display: Difference between revisions
Content added Content deleted
Line 492: | Line 492: | ||
=={{header|EasyLang}}== |
=={{header|EasyLang}}== |
||
[https://easylang.online/ |
[https://easylang.online/run/?code=n%3D8%0Afor%20row%20range%204%0Asz%3D100/n%0Afor%20i%20range%20n%0Ac%3Di/%28n%20-%201%29%0Aif%20row%20mod%202%3D1%0Ac%3D1%20-%20c%0A.%0Acolor_red%20c%0Acolor_green%20c%0Acolor_blue%20c%0Amove%20sz%2Ai%20row%2A25%0Arect%20sz%2B1%2025%0A.%0An%3Dn%2A2%0A. Run it] |
||
<lang> |
<lang>n = 8 |
||
n = 8 |
|||
for row range 4 |
for row range 4 |
||
sz |
sz = 100 / n |
||
for i range n |
for i range n |
||
c |
c = i / (n - 1) |
||
if row mod 2 = 1 |
if row mod 2 = 1 |
||
c |
c = 1 - c |
||
. |
. |
||
color_red c |
color_red c |
||
color_green c |
color_green c |
||
color_blue c |
color_blue c |
||
move sz |
move sz * i row * 25 |
||
rect sz |
rect sz + 1 25 |
||
. |
. |
||
n = n * 2 |
n = n * 2 |