Random Word Generator

Hello community,

Hi everyone, how do I do this word generator? In my game I need random words, its like puzzle or something that makes the game challenging and one of those words is the correct one. How do we do this random word generation?

Regards, Ronel [import]uid: 141531 topic_id: 26443 reply_id: 326443[/import]

This should help you: http://developer.anscamobile.com/forum/2012/05/07/generating-different-random-values [import]uid: 84637 topic_id: 26443 reply_id: 107302[/import]

I’m sorry but I can’t access your link. Why can’t I access this? Is there other links?
Thanks for the reply [import]uid: 141531 topic_id: 26443 reply_id: 107438[/import]

Really ? Odd you should be able to.

Anyway… Here is some code to get you started.

The quote from the thread in question: "Is it possible to generate multiple random numbers, but so that no number occurs more that once. "

[code]
math.randomseed(os.time())

local alphabet = {
{letter = “a”, picked = false},
{letter = “b”, picked = false},
{letter = “c”, picked = false},
{letter = “d”, picked = false},
{letter = “e”, picked = false},
{letter = “f”, picked = false},
{letter = “g”, picked = false},
{letter = “h”, picked = false},
}

local rand = math.random(1, #alphabet)
local amountPicked = 0

–Loop over until we have picked at least 3 letters
repeat
rand = math.random(1, #alphabet)
if alphabet[rand].picked == false then
print(alphabet[rand].letter)
amountPicked = amountPicked + 1
alphabet[rand].picked = true
end
until
amountPicked == 3
[/code] [import]uid: 84637 topic_id: 26443 reply_id: 107535[/import]