Template:E 2D utilities: Difference between revisions
no edit summary
(extract from [[Spiral#E] to template) |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1:
<noinclude>Some [[Category:E]] library code for the [[Spiral]] and [[Zig Zag]] tasks. Perhaps ought to be put into generally available E data structure/math libraries.
{{template}}<
def makeVector2(x, y) {
return def vector {
Line 18:
for y in 0..!rows {
for x in 0..!cols {
out.print(<import:java.lang.makeString>.format("%3d", [flex2DArray[y, x]]))
}
out.println()
}
}
Line 26:
to put(r, c, v) { storage[r * cols + c] := v }
}
}</
|