I have coded a program for the ANEO sponsored puzzle in PHP. I build the program in VS Code instead of the online editor.
However, when I run the PHP program on my PC with the compiler that came with MAMP, and when I run the program with the online compiler of this website, a different result comes out.
There are 2 changes in the 2 programs, however neither of them matter, because I have standardised the input data, and have the same content in the initial variables on my PC, as I have with the online compiler. The entire rest of the program I have CTRL+C CTRL+V into this site’s compiler.
The 2 changes are:
- Input data is retreived from a txt file, instead of STDIN
- The output echo is different due to \n characters used for formatting debug.
I am currently using test1 as my data, where the outputs are the following:
- MyPC: 50 (correct answer)
- Online compiler: 49 (wrong answer)
Now I understand that one isn’t supposed to upload any solutions, however I see no other way of debugging this issue, so I am going to upload the program of my PC, and the online program. Plus, my solution is super sloppy and unoptimised, so who cares really…
I have linked my GitHub repository with the 2 files and the datafile in question.
GitHub for 2 PHP files
Would love if I could get a fix for this weird bug, or at least some pointers here in the comment section.
Thank you in advance.