This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:poly [2016/01/01 22:41] 127.0.0.1 external edit |
en:poly [2020/02/28 10:46] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Poly (Statement) ===== | ===== Poly (Statement) ===== | ||
==== Format ==== | ==== Format ==== | ||
- | **poly** | + | **poly** |
- | **poly** ( // | + | **poly** ( [[arrays|variable[]]] |
- | **poly** { x1, y1, x2, y2, x3, y3 ... } | + | **poly** |
+ | **poly** [[Lists|{ {x1, y1}, {x2, y2}, {x3, y3} ... }]] | ||
==== Description ==== | ==== Description ==== | ||
- | Draws a polygon. | + | Draws a polygon. |
+ | |||
+ | One dimensional arrays and lists must have at least six values and an even number | ||
==== Example ==== | ==== Example ==== | ||
< | < | ||
# using an array | # using an array | ||
- | color blue | + | clg blue |
- | rect 0,0,300,300 | + | |
color green | color green | ||
- | dim tri(1) | + | dim tri = {100, 100, 200, 200, 100, 200} |
- | tri = {100, 100, 200, 200, 100, 200} | + | poly tri[] |
- | poly tri | + | |
</ | </ | ||
< | < | ||
- | # using an anonymous array | + | # using a list |
- | color blue | + | clg blue |
- | rect 0,0,300,300 | + | |
color green | color green | ||
- | poly {100, 100, 200, 200, 100, 200} | + | poly {{100, 100}, {200, 200}, {100, 200}} |
</ | </ | ||
Both programs use the poly statement to draw the following: | Both programs use the poly statement to draw the following: | ||
Line 33: | Line 33: | ||
==== History ==== | ==== History ==== | ||
|0.9.4|number of points in the array argument was removed from the poly statement| | |0.9.4|number of points in the array argument was removed from the poly statement| | ||
+ | |1.99.99.55|two dimensional list support was added| | ||
+ | |1.99.99.72|added required [] to passing variable array| |