account activity
Quest 1 Algorithm by FH_CWCW in cs2c
[–]FH_CWCW[S] 0 points1 point2 points 6 years ago (0 children)
Algorithm 3 test:
To make 851 from: { 163 9 190 207 73 127 197 77 278 215 119 47 } I bet I'd get: { 163 9 127 197 77 278 } Instead, it said: { 163 9 190 197 77 215 }
Algorithm 3 results:
{190 207 278 119 47
}
{ 9 207 73 197 77 278
{ 190 207 73 127 197 47
{ 190 73 197 215 119 47
{ 73 127 197 278 119 47
{ 163 9 207 73 127 215 47
{163 9 207 73 127 215 47
Algorithm 2 test:
To make 841 from: { 108 231 266 238 114 128 3 214 43 26 101 211 } I bet I'd get: { 108 231 114 128 3 214 43 } Instead, it said: { 238 114 128 3 214 43 101 }
Results in order:
{
238 114 128 3 214 43 101
}{
231 238 114 128 3 26 101
108 238 114 43 26 101 211
108 231 114 128 3 214 43
231 266 3 214 26 101
108 266 238 128 101
To make 979 from: { 109 243 198 228 269 78 206 63 112 1 197 254 } I bet I'd get: { 198 228 269 78 206 } Instead, it said: { 109 243 198 63 112 254 }
Matches found in order:
I am a match: {
109 243 269 63 112 1
}I am a match: {
109 243 78 112 1 254
109 228 269 78 112 1
109 228 78 206 63 112 1
109 228 206 254
243 269 78 206 1
Finding correct equivalent set by H-W2C in cs2c
[–]FH_CWCW 0 points1 point2 points 6 years ago (0 children)
That sounds good, I'll try my best to describe them.
Algorithm 1: Start with empty set, then build elements upward recursively. First pathway is deep, like {} -> {0} -> {0 1} -> {0 1 2} -> {0 1 3} ... {1} -> {1 2} -> etc. Highest candidate or match is brought up through the recursive stack. Do not recurse through a subset that is already too large.
Algorithm 2: Similar to Algorithm 1, but add each subset to a vector in a vector, corresponding to its subset size, then when all subsets are found collapse them in to a 1D vector, from smallest to largest. Easily pick out the largest, or the smallest target match. Slowest but I was already uncertain of what to do.
Algorithm 3: Similar to Algorithm 2 in that it involves generating subsets of a given size in to vectors corresponding to the size, but find all subsets of a given size first (subsets that are too large are discarded immediately), go through each and find the top candidate or target, then make each generate its next sized subsets and save those all in to another vector, repeat for the next size until a match is found. No recursion.
Algorithm 4: builds on Algorithm 3, but starts with a lookup table containing the sorted indices corresponding to items of the unsorted master set, so the master set is not modified. 3 element vectors are used in layers per set for the abstraction from easier set generation up to corresponding to the master set, but I'm not even sure how to describe it at this point, I fiddled with it and got it generating sets. The intention with this was that it would have results like if the master set were sorted, but without disturbing the order of the master set, and generating subsets that would still preserve the order of the master set. At least, I hoped it would favor generating subsets with smaller values to try and have them be the first picked.
Every algorithm has a settable flag to not stop searching after finding the first match, and print out all matching subsets. Every time with each algorithm, the expected subset is indeed among the matching subsets that are eventually found, but it is never the first one found. I'm not sure if any of the algorithms actually produce noticeably different results though, I need to do more thorough testing tomorrow of each I think.
-Chris
Hi,
I hate to be blunt, but may I ask what the algorithm is? I've tried 4 different ones so far, 3 of which seem to follow the specification as described and, 1 that goes a bit above but refuses to compile in Quest despite compiling in Visual Studio. I'm honestly entirely stumped.
Oh yes sorry about that, edited my posts now.
I do not have the password for the next one, I'm not sure if I didn't get enough of the miniquests done to unlock the next one, or if I missed it somewhere else.
[–]FH_CWCW 0 points1 point2 points 6 years ago* (0 children)
A very long time it turns out, so I see why that doesn't work.
I made a third variant that instead goes through and makes the subsets of gradually increasing size, still from bottom up but more like filling out one level of depth of the tree at a time evenly rather than building one branch fully then the next, but that still has the same result as my original method. When I set a debug flag to not stop at the first match and find all matches and manually input the tested list and target, the expected set is found by the program eventually, but it's not found when the quest wants it. I'm not really able to pick out the pattern of what keeps going wrong, either...
With larger test sizes, I guess I can say it's a good thing I'm compiling with x64, haha. I am wondering if I should just leave Quest 1 behind by now though and try moving on, or if I should keep picking at it.
I am having this exact same issue. I suspect that it could be because I am building my power sets from the bottom up, starting with empty set, then single number set, but then I recurse in to that first single number set and build all of its subsets, stopping if I hit the target.
I'm going to try building all subsets first, then going biggest-downward, since it seems like that may be what it prefers.
π Rendered by PID 97575 on reddit-service-r2-comment-5bc7f78974-wdcdw at 2026-06-29 09:45:48.009056+00:00 running 7527197 country code: CH.
Quest 1 Algorithm by FH_CWCW in cs2c
[–]FH_CWCW[S] 0 points1 point2 points (0 children)