Back
Close

CGFunge Batch Runner

Marchete
1,744 views

CGFunge Batch Runner

This Java playground can help you make faster tests on CGFunge Prime puzzle

It works by using the same code to a list of validators, giving you the number of valid tests, invalid ones, code coverage and a highlight of the first invalid execution.

It's easier to track down problems for me, as you can see with a color what part of the code was executed. If you copy it locally to your PC you can also pass a number parameter to see that execution path and not the first error.

It has some slight differences. First, you should not add the line count at start, my parser only takes a raw code. Besides that there is an additional instruccion 'Q', that ends the program but also prints the whole stack.

I worked on this puzzle in the following way:

  • I've created an ExcelTemplate.xlsx, and I code the solution there. Each cell is one instruction, and it's better to copy and paste, move, transpose, etc. That excel template has conditional formatting and helps you with empty spaces. If you forget an empty space it shows a red cell, always put an space instead of empty spaces.
  • Once I want to test the code I copy all and paste it to a plain text file called code.php
  • I have a file called validators.txt with all numbers I want to test. You can use the numbers you like.
  • Then I run the interpreter, and I got the valid tests, invalid tests, total steps and a code coverage.
  • Once I have a correct solution, I remove tabs from code.php, add the number of line as the first line (it's needed on the original puzzle), and I submit it.

Batch Interpreter

CG Funge Interpreter
v >v >> >0"EMIRP TON">D:E
>D3-:>D1-:^ ^C<
v >0"EMIRP"QD:E
>DD2/2*-:^ ^C<
v-*3/3DD<
> S:v>0"EMIRP TON" v
>5^ >0"EMIRP">D:E
>DD*2XD2X-:v ^C<
v<
>1XD2XD2X/2XD2X*2XD2X- v
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants