This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
for each i from 1 to X
{
set placeA = random number from 1 to (array size)
set placeB = random number from 1 to (array size)
set tempint = myInt[placeA]
set myInt[placeA] = myInt[placeB]
set myInt[placeB] = tempint
}
This basically just swaps the values of two parts of your array around.
placeA, placeB, tempint are all integers.
X is how many times they are swapped; use a high value for a decent shuffle.
for each i from 1 to X
{
set placeA = random number from 1 to (array size)
set placeB = random number from 1 to (array size)
set tempint = myInt[placeA]
set myInt[placeA] = myInt[placeB]
set myInt[placeB] = tempint
}
This basically just swaps the values of two parts of your array around.
placeA, placeB, tempint are all integers.
X is how many times they are swapped; use a high value for a decent shuffle.