[Community Puzzle] CGFunge Prime



Send your feedback or ask for help here!

Created by @eulerscheZahl,validated by @dbdr,@dwarfie and @pac-nam.
If you have any issues, feel free to ping them.


Hi @eulerscheZahl, @dbdr, @dwarfie, @pac-nam,

I’ve got a code passing all the test but only 88% of the validators (23,27,31,35,37,43,47,49,51,57,63,65 are not validated).

Maybe a certain class of numbers is used in validator and not in test.

Can someone help me investigating this issue please ?

EDIT: I’ve found the problem. A class of integer is indeed present only in validators. @eulerscheZahl feel free to contact me to find a solution.


Hi all,
My code succeeds all the validators but 22 ! Can I get a tip to solve this problem ?
Thank you


Could you write English here on the forum please?
You can find the validators on my github.
Validator 22 (“bonus validator 2”) is here, you have to check if 3 is prime.


Shame on me ! Thank you :wink:


Hi, @eulerscheZahl

What is the range of integers on the stack? This should be clarified in the problem statement. It does seem to be the range of normal 32-bit integers (or maybe there is a bug in the stack visualization).


Maybe you can program a test for that question :smiley:

Here’s an ocaml code :

let l = (* ~ GOTO OK ! GOTO FALSE*)
[String.make 33 ‘2’^“v”;
String.make 33 ‘*’^"<"

let _ = Format.printf “%d@.” (List.length l)
let _ = List.iter (fun s -> Format.printf “%s@.” s) l


It is an int in the Java referee. So it’s a normal signed 32bit integer, going from -2^31 to 2^31-1.


@eulerscheZahl @Boulet

Thanks. I just realized I made a mistake. There is a delay in the visualization and the change of the stack is reflected only two commands afterwards (where the green cursor points to). In other words, the stack shows the action of the command that is two commands before the position of the green cursor. So I made a wrong assumption on where the program was actually at in my tests.


Is there any way to run custom test cases like some puzzles for the challenge?


Not online at least. It’s just not possible for me to add such an option.
You can download the game and add your custom test in this file, then execute the code offline.


Thanks for the information.