Implementing Fisher-Yates shuffling algorithm

1
  • 11 favourites

Index

Stats

4,803 visits, 11,336 views

Translations

This tutorial hasn't been translated.

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

At this point our array is still empty. I preferred to give some consecutive numbers to array. But you can also give some random numbers.

Add a sub event to "on start of layout" event. Add a for loop.

We used values "0" to "total - 1", because starting number for array index is 0 and last index number of array is "array size(also equal to our total variable)-1". Add an action for array (set at X)

loopindex function gives us in the current index number of running loop. I don't want to use 0 as a value, so simply i added 1 to value

Now we have a array with full of values. We can print them on our first text object. Add another action (append text) for text object. "At" function gives us the values in array. (ArrayName.At(IndexNo))

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!