Fisher--Yates algorithm

is the Fisher–Yates Shuffle. The modern method of this algorithm is to choose an entry from the table at random and swap it with the entry at the end of the table.

My question is first what is “swap it with the entry at the end of table”? AND…

If If I wanted to create a database of the shuffle…say…instead of 52 cards,because 52 cards in a deck, say…
1000 cards. AND…Could you also call the cards something else, like 1000, “words”.so you have a thousand words. AND…

…You already
have a word…

AS A RESULT…the word from the shuffle would make another word combined with your word, AND…show the two words to you.

Is that possible to be applied to this algorithm?
and is the Shuffling Table Data (Deck of playing cards), template, similar to it? [import]uid: 88495 topic_id: 34867 reply_id: 334867[/import]

That’s basically what this method does. It randomly picks an item from the table and swaps it with the last entry.

There are dozens of ways to shuffle an array. Visit this forum post:

http://developer.coronalabs.com/forum/2011/03/23/shuffling-table-values

I personally use #3 that Danny posted. Now how this works with a database can be a bit more tricky since these are using tables of data. But what I do for my Trivia game that has thousands of questions and I want a few with no duplicates, is I build a table which holds the question’s ID Numbers, then shuffle that and use the first 20 values in the shuffled table then fetch those 20 items from the database.
[import]uid: 199310 topic_id: 34867 reply_id: 138607[/import]

For selecting a random row from an SQLLite DB you can use this query:

SELECT * FROM table ORDER BY RANDOM() LIMIT 1;

Where ‘1’ is the number of returned rows, change it to get more rows. [import]uid: 80469 topic_id: 34867 reply_id: 138617[/import]

That’s basically what this method does. It randomly picks an item from the table and swaps it with the last entry.

There are dozens of ways to shuffle an array. Visit this forum post:

http://developer.coronalabs.com/forum/2011/03/23/shuffling-table-values

I personally use #3 that Danny posted. Now how this works with a database can be a bit more tricky since these are using tables of data. But what I do for my Trivia game that has thousands of questions and I want a few with no duplicates, is I build a table which holds the question’s ID Numbers, then shuffle that and use the first 20 values in the shuffled table then fetch those 20 items from the database.
[import]uid: 199310 topic_id: 34867 reply_id: 138607[/import]

For selecting a random row from an SQLLite DB you can use this query:

SELECT * FROM table ORDER BY RANDOM() LIMIT 1;

Where ‘1’ is the number of returned rows, change it to get more rows. [import]uid: 80469 topic_id: 34867 reply_id: 138617[/import]