Implementing Fisher-Yates shuffling algorithm

3

Index

Stats

8,200 visits, 17,675 views

Tools

Translations

This tutorial hasn't been translated.

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.

Published on 14 Feb, 2013. Last updated 19 Feb, 2019

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))

  • 2 Comments

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