Skip to content

Instantly share code, notes, and snippets.

Created March 15, 2014 21:46
Show Gist options
  • Save anonymous/9574381 to your computer and use it in GitHub Desktop.
Save anonymous/9574381 to your computer and use it in GitHub Desktop.
import streams
type
TGridRow = array[1..6000, uint8]
TGridSquare = array[1..6000, TGridRow]
proc test(a:uint16, gs:TGridSquare):seq[uint16] =
echo($a)
result = @[]
result.add(a)
result.add(12)
return
var fs = newFileStream("e135s35",fmRead)
let numRow = readInt16(fs)
let numCol = readInt16(fs)
echo($numRow)
echo($numCol)
gs : TGridSquare
# I will be loading the array after processing the file
# but just want to test the parameter passing syntax
let ans:seq[uint16] = test(69,gs)
echo(ans.len)
echo(ans[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment