[Community Puzzle] CGFunge Prime

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

agreed, completely unreadable

Very unique puzzle, well done.

I suspect that top of the leaderboard just hardcoded all validators with some binary search (or they might know some serious math stuff which I don’t…) :slight_smile:

It seems to me that whitespaces are counted towards the points. That means this is a two-in-one optim puzzle: (1) find the algorithm with the fewest befunge instruction steps; (2) codegolf your solution by arranging it in the 2D grid as tight as possible…

Looking at leaderboard language selections: LOL, I always knew that there MUST be a puzzle where php is the best choice… :slight_smile:

yes unfortunately to be at the top of the leaderboard… just need to hard-code the validators…

“just” need to hard-code :wink:

Yes, offline computation allows to compute for a bit longer but it’s pointless if it takes years to compute.
So having a fast algorithm is what makes the difference anyway.

Hi,

I wonder why (in python)

solution = “”“1
E”""
print(solution)

lead to this error “Program pointer out of code area at (1/0)”
(before the expected error “Output was: ; expected: NOT PRIME”)
while

solution = “”“1
E “””
print(solution)

works fine just with an added space.

Also why sometimes I get a warning that the input was not entirely read ?

Thanks

I got the warning when the number of lines specified did not match

For such puzzle, it would be feasible to have random numbers as validators, wouldn’t it? Or one random numbers per predefined range.

1 Like

In hindsight I could have made a single validator testing every number within the range (and show the first replay where your solution failed).
But too late to change now, it would break the entire leaderboard.

I don’t mind about breaking the leaderboard of one puzzle that started recently. And that would be fair in this case.

One could still create a new puzzle for checking that a number is within a given list.

Here is a live interpreter I made for CG Funge. Make it easier to see what happens as you change the code.
http://johann-elsass.net/cgfungelive.php

2 Likes

Thanks for sharing.
There’s also this one from Marchete: Coding Games and Programming Challenges to Code Better.
I’m a bit scared to add a link to the statement at this point. I have some history of clearing the entire leaderboard with such small changes.

1 Like

It would be nice to add the link indeed. Thanks for thinking about that. I understand you have some responsibility here about clearing the leaderboard. I wonder if people would loose their submissions, their code. That would be bad because people may not have saved them locally.

Not losing the code. But there’s a risk of removing every player from the leaderboard. If this happens, some scores would be gone forever (inactive users who don’t resubmit).
I think it won’t happen, as CG addressed the issue. At the same time there is a limit for the amount of validators that’s lower now than it was back when I created the puzzle. I really don’t want to risk breaking anything.

Thanks for this puzzle, I had so much fun solving it.
Now, I think I would like to try to climb the leaderboard, but only if I know that there are no cheaters in there… Really, is there no solution to have some randomly selected validators to make certain to get-rid of the hard-coders ?
Having the possibility to play for real would be amazing !