Skip to content

Instantly share code, notes, and snippets.

@weswigham
Created July 2, 2013 23:45
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 weswigham/5914267 to your computer and use it in GitHub Desktop.
Save weswigham/5914267 to your computer and use it in GitHub Desktop.
Example usage of matrix.lua
local Matrix = require("matrix")
print(tostring(Matrix(3)))
local mat = Matrix(3)
mat[1][1] = 1
mat[1][2] = 2
mat[1][3] = 3
mat[2][1] = 4
mat[2][2] = 5
mat[2][3] = 6
mat[3][1] = 7
mat[3][2] = 8
mat[3][3] = 9
print(tostring(mat))
mat:RotateRight()
print(tostring(mat), mat.rotation)
mat:RotateRight()
print(tostring(mat), mat.rotation)
mat:RotateRight()
print(tostring(mat), mat.rotation)
mat:RotateRight()
print(tostring(mat), mat.rotation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment