Files
kiss-vscode/projects/asciilib2/src/asciilib/Grid.kiss

8 lines
286 B
Plaintext

(defnew [_width _height :T defaultValue]
[:Int width _width
:Int height _height
:Array<Array<T>> rows (for _ (range height) (for _ (range width) defaultValue))])
(method getCell [x y] (nth (nth rows y) x))
(method setCell [x y value] (setNth (nth rows y) x value))