Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Shuffle Array

Author
Message
zxretrosoft
AGK Developer
9
Years of Service
User Offline
Joined: 10th Dec 2014
Location: Prague, Czech Republic
Posted: 20th Mar 2017 07:28
Hello everyone!
Please, is in AGK2 any way to do Randomize Array?
Thank you in advance
I am sorry for poor English
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Mar 2017 10:45
You could do something like this:


"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Mar 2017 11:21
Nice, I wasn't aware of the swap function. I have always done it manually.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
zxretrosoft
AGK Developer
9
Years of Service
User Offline
Joined: 10th Dec 2014
Location: Prague, Czech Republic
Posted: 20th Mar 2017 11:32
Yes, thank you very much, it works!!

Perhaps it would have been faster if there were functions like in PureBasic, but that also goes. Thanks a lot!
http://www.purebasic.com/documentation/sort/randomizearray.html
I am sorry for poor English
PSY
Developer
8
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 20th Mar 2017 18:09
Hey zxretrosoft,

you might want to check out this thread:

https://forum.thegamecreators.com/thread/218607


Cheers,
PSY
PSY LABS Games
Coders don't die, they just gosub without return
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 20th Mar 2017 21:45
i like phalex's method because it is so much like a real shuffle

Login to post a reply

Server time is: 2024-11-22 09:05:13
Your offset time is: 2024-11-22 09:05:13