diff --git a/Turtle/Turtle.lua b/Turtle/Turtle.lua index c9dd2ce..da9ffdc 100644 --- a/Turtle/Turtle.lua +++ b/Turtle/Turtle.lua @@ -74,3 +74,11 @@ function Turtle:copyPositionTable(position) end return positionClone end + +function Turtle:reverseArray(a) + local a2 = {} + assert(type(a) == "table", "argument must be an array") + for i = 1, #a do + a2[#a -i + 1] = a[i] + end +end \ No newline at end of file