RosettaCodeData/Task/Generic-swap/Lua/generic-swap-1.lua

3 lines
139 B
Lua

x, y = y, x -- swap the values inside x and y
t[1], t[2] = t[2], t[1] -- swap the first and second values inside table t