Created
December 16, 2013 21:19
-
-
Save faassen/7994609 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const WIDTH = 640 | |
const HEIGHT = 400 | |
type | |
TField = tuple [ | |
a: float, | |
b: float, | |
c: float, | |
d: float, | |
e: float] | |
TRow = array[0..WIDTH - 1, TField] | |
TGrid = array[0..HEIGHT -1, TRow] | |
TWorld = tuple [grid: TGrid] | |
PWorld = ref TWorld | |
iterator mitems[IDX, T](x: var array[IDX, T]): var T = | |
for i in low(x)..high(x): | |
yield x[i] | |
proc display(world: var TWorld) = | |
for row in mitems(world.grid): | |
for field in mitems(row): | |
echo("field") | |
var w: TWorld | |
w.display() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment