this is my code. but some reason i cant get it to print what i want it to print. such as, a, b, c, d, e, f, i am just experimenting with
i hit the button, but all it is flashing. what am i missing.
i just want it to print out a random saying and not repeat it self afterwords till all saying has been printed out.
local widget = require(“widget”)
-----function to handle
local function handleButtonEvent( event )
local phase = event.phase
if “ended” == phase then
print ( “you pressed it” )
end
– body
end
----creating thebutton
local myButton = widget.newButton
{
left = -20,
top = 200,
width = 350,
height = 150,
label = “random”,
onEvent = handleButtonEvent,
}
local thingsToSay = { “a”, “b”, “c”, “d”, “e”, “F” }
local index = math.random(1, #thingsToSay)
local myThingToSay = thingsToSay[index]
table.remove(thingsToSay, idx)