Implementing Fisher-Yates shuffling algorithm

  • 10 favourites

Index

Stats

2,569 visits, 6,733 views

Translations

This tutorial hasn't been translated.

Tools

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!