This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MR_nesquick's profile picture

[Help] Table

Started by MR_nesquick, 07 May 2014 - 08:15 PM
MR_nesquick #1
Posted 07 May 2014 - 10:15 PM
Hello :D/>
i want to change the last number in my table to become the first number is there an easy way of doing that?

table = {2,5,8}
And i want it to become
table = {8,2,5}
Lyqyd #2
Posted 07 May 2014 - 10:19 PM
Yeah, you just remove the last value and insert it at the beginning:


table.insert(myTable, 1, table.remove(myTable))