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 / Sorting multiple arrays with AGK2 array.sort()

Author
Message
jlahtinen
15
Years of Service
User Offline
Joined: 26th Oct 2009
Location: Finland
Posted: 29th Sep 2016 14:50
Is it possible, what is the right syntax for that?
damothegreat
User Banned
Posted: 9th Oct 2016 15:37
Hope this helps


max=15

myArray as integer[15]

for i=1 to max
myArray[i]=random(1,100)

next

do
print ("Before = ")
for i=1 to max
print (myArray[i])
next
print ("press space to sort")
if GetRawKeyPressed(32)=1 // Space
exit
endif



sync()

loop


do

myArray.sort()
print ("after = ")
for i=1 to max
print (myArray[i])
next

print ("Press enter to exit")
if GetRawKeyPressed(13)=1 // Enter
exit
endif

sync()
loop




Thanks
Damo

Login to post a reply

Server time is: 2024-11-24 11:23:17
Your offset time is: 2024-11-24 11:23:17