# [Community Puzzle] CGFunge Prime

https://www.codingame.com/multiplayer/optimization/cgfunge-prime

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

1 Like

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.

1 Like

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.

1 Like

Shame on me ! Thank you

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

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.

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.

Thanks for the information.

Is the final score the total number of steps executed in all validators?

Yep thatās it

Those little red letters over black background have given me a headache, Literally.

1 Like

I created a CGFunge Batch Interpreter that I used some time ago. I canāt use the IDE, too complex and I needed something more direct, like highlighting the execution path, total steps and some other info you canāt get from the IDE.

As itās tech.io it works right out the box. If you want to make tests locally you just need a Java compiler. Itās just a single file with 2 classes, no weird imports or boring downloads, just a simple ājavac CGFunge.javaā . I canāt recall what Java version I used, also I only tested it in Linux, especially for background colors in terminal.

Feel free to use to your needs.

2 Likes