slayer219
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 3445 |
|
|
| 03 Jun 2012 01:30 PM |
Hello,
I know you guys here in C&G are always looking for new technology for your groups. I am willing to make anything you ask for simple financial compensation. I am not cheap, my scripts range from 200-20,000 R$, but I am a Master Scripter and can complete any task you assign me in a timely fashion.
If you are interested in having anything made for you please feel free to send me a PM, I will get back to you as soon as I can.
-Slayer219 |
|
|
| Report Abuse |
|
slayer219
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 3445 |
|
|
| 03 Jun 2012 04:30 PM |
"can I see your work"
This is my script which adds matrix support to Lua, it is a 300 line metatable-filled masterpiece. This proves that any challenge you give me can be completed.
matrix1Rows = { { 3; 4; 5 }; { 6; 7; 8 }; { 9; 10; 11 } } matrix1Columns = { { 3; 6; 9 }; { 4; 7; 10 }; { 5; 8; 11 } } matrix2Rows = { { 23; 24; 25 }; { 26; 27; 28 }; { 29; 30; 31 } } matrix2Columns = { { 23; 26; 29 }; { 24; 27; 30 }; { 25; 28; 31 } } SoE = { xValues = { 2; 4; 5 }; yValues = { 7; 5; 11 }; zValues = { 6; 4; 3 }; equal = { 430; 780; 142 } } print("--------------------------------------------------") print("Slayer219's 3x3 Lua Matrix Support Loaded") print("--------------------------------------------------") matrixDimensions = tostring(#matrix1Rows).."x"..tostring(#matrix1Columns) matrix2Dimensions = tostring(#matrix2Rows).."x"..tostring(#matrix2Columns) print("matrix1 dimensions: "..matrixDimensions) print("matrix2 dimensions: "..matrix2Dimensions) print("--------------------------------------------------") addMatrices = { __add = function(t1, t2) local newMatrix = { } for key, index in ipairs(t1) do newMatrix[key] = index end for key, index in ipairs(t2) do newMatrix[key] = newMatrix[key] + index end return newMatrix end } subMatrices = { __sub = function(t1, t2) local new = { } for key, index in ipairs(t1) do new[key] = index end for key, index in ipairs(t2) do new[key] = new[key] - index end return new end } inverse = { __pow = function(t) local i = { } for key, index in ipairs(t) do i[key] = index ^ -1 end return i end } function showMatrices(r1, r2, r3, rb1, rb2, rb3) print("Matrix1:") print("[ "..table.concat(r1, " ").." ]") print("[ "..table.concat(r2, " ").." ]") print("[ "..table.concat(r3, " ").." ]") print("Matrix2: ") print("[ "..table.concat(rb1, " ").." ]") print("[ "..table.concat(rb2, " ").." ]") print("[ "..table.concat(rb3, " ").." ]") print("--------------------------------------------------") end function add(r1, r2, r3, rb1, rb2, rb3) if matrixDimensions == matrix2Dimensions then local row1a = setmetatable(r1, addMatrices) local row1b = setmetatable(rb1, addMatrices) local row2a = setmetatable(r2, addMatrices) local row2b = setmetatable(rb2, addMatrices) local row3a = setmetatable(r3, addMatrices) local row3b = setmetatable(rb3, addMatrices) print("Adding Matrices: ") print("--------------------------------------------------") print("Answer Is: ") print("[ "..table.concat(r1 + rb1, " ").." ]") print("[ "..table.concat(r2 + rb2, " ").." ]") print("[ "..table.concat(r3 + rb3, " ").." ]") print("--------------------------------------------------") else print("Invalid dimensions.") end end function subtract(r1, r2, r3, rb1, rb2, rb3) if matrixDimensions == matrix2Dimensions then local row1a = setmetatable(r1, subMatrices) local row1b = setmetatable(rb1, subMatrices) local row2a = setmetatable(r2, subMatrices) local row2b = setmetatable(rb2, subMatrices) local row3a = setmetatable(r3, subMatrices) local row3b = setmetatable(rb3, subMatrices) print("Subtracting Matrices: ") print("--------------------------------------------------") print("Answer Is: ") print("[ "..table.concat(r1 - rb1, " ").." ]") print("[ "..table.concat(r2 - rb2, " ").." ]") print("[ "..table.concat(r3 - rb3, " ").." ]") print("--------------------------------------------------") else print("Invalid Dimensions.") end end function invert(r1, r2, r3) local row1 = setmetatable(r1, inverse) local row2 = setmetatable(r2, inverse) local row3 = setmetatable(r3, inverse) print("Finding the inverse of the Matrix: ") print("--------------------------------------------------") print("Answer Is: ") print("[ "..table.concat(r1^-1, " ").." ]") print("[ "..table.concat(r2^-1, " ").." ]") print("[ "..table.concat(r3^-1, " ").." ]") print("--------------------------------------------------") end function constantMultiply(constant, row1, row2, row3) print("Multiplying Matrix by constant "..constant..":") print("--------------------------------------------------") print(tostring(constant).."[ "..table.concat(row1, " ").." ]") print("[ "..table.concat(row2, " ").." ]") print("[ "..table.concat(row3, " ").." ]") print("=") local m = { { }; { }; { } } for i, v in ipairs(row1) do m[1][i] = v m[1][i] = m[1][i] * constant end for i, k in ipairs(row2) do m[2][i] = k m[2][i] = m[2][i] * constant end for i, j in ipairs(row3) do m[3][i] = j m[3][i] = m[3][i] * constant end print("[ "..table.concat(m[1], " ").." ]") print("[ "..table.concat(m[2], " ").." ]") print("[ "..table.concat(m[3], " ").." ]") print("--------------------------------------------------") end function matrixMultiplication(rowa, rowb, rowc, columna, columnb, columnc) print("Multiplying matrix1 by matrix2: ") print("--------------------------------------------------") if #columna == #rowc then local newMatrix = { { }; { }; { } } newMatrix[1][1] = (rowa[1] * columna[1]) + (rowa[2] * columna[2]) + (rowa[3] * columna[3]) newMatrix[1][2] = (rowa[1] * columnb[1]) + (rowa[2] * columnb[2]) + (rowa[3] * columnb[3]) newMatrix[1][3] = (rowa[1] * columnc[1]) + (rowa[2] * columnc[2]) + (rowa[3] * columnc[3]) newMatrix[2][1] = (rowb[1] * columna[1]) + (rowb[2] * columna[2]) + (rowb[3] * columna[3]) newMatrix[2][2] = (rowb[1] * columnb[1]) + (rowb[2] * columnb[2]) + (rowb[3] * columnb[3]) newMatrix[2][3] = (rowb[1] * columnc[1]) + (rowb[2] * columnc[2]) + (rowb[3] * columnc[3]) newMatrix[3][1] = (rowc[1] * columna[1]) + (rowc[2] * columna[2]) + (rowc[3] * columna[3]) newMatrix[3][2] = (rowc[1] * columnb[1]) + (rowc[2] * columnb[2]) + (rowc[3] * columnb[3]) newMatrix[3][3] = (rowc[1] * columnc[1]) + (rowc[2] * columnc[2]) + (rowc[3] * columnc[3]) print("Answer Is: ") print("[ "..table.concat(newMatrix[1], " ").." ]") print("[ "..table.concat(newMatrix[2], " ").." ]") print("[ "..table.concat(newMatrix[3], " ").." ]") print("--------------------------------------------------") else print("Error: Invalid Dimensions.") end end function getDeterminant(r1, r2, r3) local det = (r1[1] * r2[2] * r3[3]) + (r1[2] * r2[3] * r3[1]) + (r1[3] * r2[1] * r3[2]) - (r1[2] * r2[1] * r3[3]) - (r1[1] * r2[3] * r3[2]) - (r1[3] * r2[2] * r3[1]) print("The determinant of the Matrix:") print("--------------------------------------------------") print("[ "..table.concat(r1, " ").." ]") print("[ "..table.concat(r2, " ").." ]") print("[ "..table.concat(r3, " ").." ]") print("Is: "..tostring(det)) print("--------------------------------------------------") end function solve(xVars, yVars, zVars, solns) local D = (xVars[1] * yVars[2] * zVars[3]) + (yVars[1] * zVars[2] * xVars[3]) + (zVars[1] * xVars[2] * yVars[3]) - (yVars[1] * xVars[2] * zVars[3]) - (xVars[1] * zVars[2] * yVars[3]) - (zVars[1] * yVars[2] * xVars[3]) local Dx = (solns[1] * yVars[2] * zVars[3]) + (yVars[1] * zVars[2] * solns[3]) + (zVars[1] * solns[2] * yVars[3]) - (yVars[1] * solns[2] * zVars[3]) - (solns[1] * zVars[2] * yVars[3]) - (zVars[1] * yVars[2] * solns[3]) local Dy = (xVars[1] * solns[2] * zVars[3]) + (solns[1] * zVars[2] * xVars[3]) + (zVars[1] * xVars[2] * solns[3]) - (solns[1] * xVars[2] * zVars[3]) - (xVars[1] * zVars[2] * solns[3]) - (zVars[1] * solns[2] * xVars[3]) local Dz = (xVars[1] * yVars[2] * solns[3]) + (yVars[1] * solns[2] * xVars[3]) + (solns[1] * xVars[2] * yVars[3]) - (yVars[1] * xVars[2] * solns[3]) - (xVars[1] * solns[2] * yVars[3]) - (solns[1] * yVars[2] * xVars[3]) local x = Dx/D local y = Dy/D local z = Dz/D print("Systems of Linear Equations: ") print("--------------------------------------------------") print(tostring(xVars[1]).."x + "..tostring(yVars[1]).."y + "..tostring(zVars[1]).."z = "..tostring(solns[1])) print(tostring(xVars[2]).."x + "..tostring(yVars[2]).."y + "..tostring(zVars[2]).."z = "..tostring(solns[2])) print(tostring(xVars[3]).."x + "..tostring(yVars[3]).."y + "..tostring(zVars[3]).."z = "..tostring(solns[3])) print("Determinant: "..tostring(D)) print("Determinant (x): "..tostring(Dx)) print("Determinant (y): "..tostring(Dy)) print("Determinant (z): "..tostring(Dz)) print("x = "..x) print("y = "..y) print("z = "..z) print("--------------------------------------------------") end showMatrices(matrix1Rows[1], matrix1Rows[2], matrix1Rows[3], matrix2Rows[1], matrix2Rows[2], matrix2Rows[3]) add(matrix1Rows[1], matrix1Rows[2], matrix1Rows[3], matrix2Rows[1], matrix2Rows[2], matrix2Rows[3]) subtract(matrix1Rows[1], matrix1Rows[2], matrix1Rows[3], matrix2Rows[1], matrix2Rows[2], matrix2Rows[3]) invert(matrix1Rows[1], matrix1Rows[2], matrix1Rows[3]) constantMultiply(-3, matrix1Rows[1], matrix1Rows[2], matrix1Rows[3]) matrixMultiplication(matrix1Rows[1], matrix1Rows[2], matrix1Rows[3], matrix2Columns[1], matrix2Columns[2], matrix2Columns[3]) getDeterminant(matrix1Rows[1], matrix1Rows[2], matrix1Rows[3]) solve(SoE.xValues, SoE.yValues, SoE.zValues, SoE.equal) |
|
|
| Report Abuse |
|
slayer219
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 3445 |
|
|
| 03 Jun 2012 04:33 PM |
"didnt you help with that lua learners site."
Yes. I am currently the Site Manager and recognized as a master scripter in that organization. The tutorials to get people started on that website were written by me. |
|
|
| Report Abuse |
|