Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
Hello guys i just have problem with making random system. Based on choosing 1 random player from my listbox how do i make that ? thx
^ Made by Bobithan thx. ^
Offline
Create a Random object
Random rnd = new Random();
Then use it in your list index to select a random player item
playerlist[rnd.Next(0, playerlist.Count)]
Offline
Notice on that: Don't make a random object just to use it right after.
Why? Because it will then always return the same value, which isn't very random, is it?
Preferable make the random object somewhere at the start of the method or in the constructor. Just some up front from when you use it.
Offline
Spoonfeeding ftw. ¬.¬
http://www.dotnetperls.com/random
http://stackoverflow.com/questions/2019 … em-in-list
One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.
Offline
Pages: 1
[ Started around 1732251570.1376 - Generated in 0.059 seconds, 12 queries executed - Memory usage: 1.39 MiB (Peak: 1.49 MiB) ]