Skip to content

Instantly share code, notes, and snippets.

@faassen
Created December 16, 2013 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faassen/7994456 to your computer and use it in GitHub Desktop.
Save faassen/7994456 to your computer and use it in GitHub Desktop.
const WIDTH = 640
const HEIGHT = 327
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: 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