HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

JASS Challenge Part 2

01-01-2004, 02:14 PM#1
AIAndy
This challenge will deal with sorting and searching and efficient data access in general.
You are pretty free in what you actually implement as long as it fits to that theme. So it could be an algorithm that sorts an array of pairs of a key and data and then allows a search (note that it should be complete, so if you implement a sorting algorithm, also implement a searching algorithm fitting to that).
But on the other hand you could also implement an efficient priority queue.
If you are not sure if a certain algorithm fits the theme, just ask.

As these algorithms should not have to be copied for each separate array they are used on, base them on the heap. Info about how to use the heap can be found at the end of this thread.

I have prepared a template map that contains the reference heap. Of course you can also use a different heap implementation (Peppars for example) from the last JASS Challenge.

Rating and the way to submit are the same as in the last JASS Challenge.
Deadline is January, 15th.
I put all points above 400 I have until then into the pot.
01-09-2004, 04:53 PM#2
KaTTaNa
The link to the Template map is dead.
01-09-2004, 09:03 PM#3
AIAndy
Hmm, strange, it works for me.
01-09-2004, 10:19 PM#4
KaTTaNa
Yeah, strange emote_confused But now it works for me too :ggani: Seems it was just a temporary error.
01-14-2004, 02:04 PM#5
Vexorian
I wish I could see this before today. Tomorrow is the deadline.
01-14-2004, 02:56 PM#6
AIAndy
Well, since up to now no one participated I will increase the deadline if I get participants then.
Who will participate if I increase the deadline?
What were the reasons no one participated up to now? Was it too hard to understand? No time? Not seen it ?
01-14-2004, 07:09 PM#7
Peppar
I will participate if the deadline is increased. I began writing a sorting function (which i "ripped" as I am quite inexperienced with sorting algorithms) but I found that I didn't have enough spare time to finish it before the deadline.
01-15-2004, 07:53 PM#8
AIAndy
How long would you need then ?
01-18-2004, 12:42 AM#9
Peppar
I would suggest postponing it for a week, due thursday or friday week 4 to allow for more people to partake in this challenge, or pherhaps we should let the challenge rest until there is sufficient interest...
01-18-2004, 04:02 PM#10
Vidstige
Unfortunately I don't have time for the challenge right now. :(
01-24-2004, 03:14 AM#11
NagelBagel
I just noticed a bug in the template map.

Code:
function HeapGet takes integer pointer returns integer
  if pointer < JASS_MAX_ARRAY_SIZE then
    return udg_heap[pointer]
  else
    return udg_heap2[pointer]
  endif
endfunction

function HeapSet takes integer pointer, integer value returns nothing
  if pointer < JASS_MAX_ARRAY_SIZE then
    set udg_heap[pointer] = value
  else
    set udg_heap2[pointer] = value
  endif
endfunction

The index given to udg_heap2 will always be past the max. It should be:

Code:
return udg_heap2[pointer-JASS_MAX_ARRAY_SIZE]

set udg_heap2[pointer-JASS_MAX_ARRAY_SIZE] = value
01-24-2004, 08:31 AM#12
COOLer
I think ill give this a try using game cache. and make a fuction that will sort its data.
01-24-2004, 09:42 AM#13
AIAndy
Now with the new usage of the gamecache it can be used for this too of course.

Well, I guess there is sufficient interest then to continue the challenge.

@NagelBagel: No, that is not a bug. The indexes of JASS arrays can be larger than the max array size as long as the range of indexes used in one array is not larger than the max array size.
01-24-2004, 11:05 AM#14
COOLer
tada heres a Array class!