Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

original vesoljc

critticall

This topic is 5589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Guest Anonymous Poster
We sure are on this way.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I mean me.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
We need to create games that will fit postsingularity era.

Share this post


Link to post
Share on other sites
That algorithm needed a little help, I had to figure out the initialization values for i & j (and l clearly doesn''y matter).


template<class RI>
void jitter_sort(RI begin, RI end)
{
int n = (int)(end-begin); --n;

int o=0, p=1, k=1, i=0, j=1, l;
while(k>=i)
{
k=-1;
while(n>k)
{
k++; l=(&*begin)[k];
if(j>l)
{
(&*begin)[i]=l; i++; (&*begin)[k]=j;
}
if(l>j)
{
i=k; j=(&*begin)[k];
}
}
j=0; n=i-p;
}
}

Share this post


Link to post
Share on other sites
Sort from the site critticall.com for several unique records, works only for numbers greater or equal to zero. What shouldn''t be a problem since an addition and a subtraction to all members of the array, is not hard to perform.

Generally, all variables used in c-critticall language are by default int type set to 0. So, variable j should be set to zero if we want to sort numbers of values from 0 to n.

0+ nevone

Share this post


Link to post
Share on other sites
Hope so.

Critticall is a program that helps you to improve engines for that kind of games.


o+nevone

Share this post


Link to post
Share on other sites
quote:
Original post by nevone
Sort from the site critticall.com for several unique records, works only for numbers greater or equal to zero. What shouldn''t be a problem since an addition and a subtraction to all members of the array, is not hard to perform.

Generally, all variables used in c-critticall language are by default int type set to 0. So, variable j should be set to zero if we want to sort numbers of values from 0 to n.

0+ nevone


IIRC, it creates an infinite loop if j is initialized to 0.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!