Hi,
I wrote some code outside of storyboard. Works without a hitch.
Now I want to copy it into storyboard. If I leave the following code in there:
math.randomseed(os.time())
local function table.shuffle(t)
– line 146
assert(t, “table.shuffle() expected a table, got nil”)
local iterations = #t
local j
for i = iterations, 2, -1 do
j = math.random(i)
t[i], t[j] = t[j], t[i]
end
end
table.shuffle(questions)
It crashes. If I leave it out it works.
it says it is missing a ‘(’ on line 146
:146: ‘(’ expected near ‘.’
Have no idea why. without storyboard it shuffles the tables nicely.
I just dumped all the code in the create scene event part to see what would happen. Would split it up if it worked there.
[import]uid: 100901 topic_id: 20817 reply_id: 320817[/import]