How should I scramble a table?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
qaisjp
Party member
Posts: 490
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: How should I scramble a table?

Post by qaisjp »

tv_user wrote:
qaisjp wrote:

Code: Select all

tab[i], tab[r] = type(tab[r])=="table" and shuffle(tab[r]) or tab[r], type(tab[i])=="table" and shuffle(tab[i]) or tab[i]
I just love these mind-twisting assignment operations! Nice and simple solution qaisjp! ^^
danke ^^
Lua is not an acronym.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: How should I scramble a table?

Post by Nixola »

(Thanks)
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests