Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-11-2008, 01:31 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
I thought we were not allowed to post non-GScript scripts in the Code Library.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #2  
Old 10-11-2008, 03:25 PM
Programmer Programmer is offline
Coder
Programmer's Avatar
Join Date: Jan 2008
Location: -78.464422, 106.837328
Posts: 449
Programmer has a spectacular aura aboutProgrammer has a spectacular aura about
Send a message via AIM to Programmer Send a message via MSN to Programmer Send a message via Yahoo to Programmer
I converted it to GScript so that it can be tested by Graal developers.

PHP Code:
dataSet = {16425820100541000523};

echo(
dataSet);
selectionSort();
echo(
dataSet);

function 
selectionSort()
{
    for (
0dataSet.size() - 1a++)
    {
        for (
1dataSet.size(); b++)
        {
            if (
dataSet[b] < dataSet[a])
            {
                
result dataSet[b];
                
dataSet[b] = dataSet[a];
                
dataSet[a] = result;
            }
        }
    }

Very nice, Gambet.

Quote:
Originally Posted by xXziroXx View Post
I thought we were not allowed to post non-GScript scripts in the Code Library.
I did the same thing about 2 years ago when I posted the Java code for an analog clock. Skyld let it stay for the reason that the formula might help some people, and this is a similar case.
__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
Reply With Quote
  #3  
Old 10-11-2008, 05:48 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by xXziroXx View Post
I thought we were not allowed to post non-GScript scripts in the Code Library.

My apologizes if you can't, but I haven't played Graal in quite some time so I wouldn't have a method of testing the code since GScript is fabricated and has no standalone compiler. It's not so much that I wouldn't be able to do it in GScript myself, but I'd rather release something that I was certain was error proof rather than just writing code in some text file and assuming everything in it will compile and run.


From an educational standpoint, the importance is learning the Selection Sort algorithm so that you can apply it to any programming language.


Quote:
Originally Posted by Programmer View Post
I converted it to GScript so that it can be tested by Graal developers.

Thank you.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.