Could someone please share a guide or an explanation on how to go about testing interactive problems locally? I am asking this as it is hard to gauge what is wrong in your solution on Codechef as the judge does not give any hints on why the test cases are failing. Any leads would be appreciated.
You get the output after taking in all the input. That won’t work in interactive problems where you have to give the next input on the basis of the output you recieve.
Oh! I didn’t know that. So we can’t use this on the submission too right?
Good thing I didn’t use this for the interactive problems last contest.
Till now the interactive problems I have attempted are basic(involve yes/no queries) which I can personally judge, hence haven’t used any script. However I remember in Google Codejam/Hashcode they had provided a script to mimic behaviour and also given instructions how to use it. Check that out. Hope it helps
I guess to “mimic” the behavior, you need to personally input into the program behaving as the Judge based on the properties specified for the Judge.
I use Sublime Text along with the MinGW compiler for competitive programming. It is really easy to solve the interactive problems along with that because the command prompt gives you output after every case and not all together.
To simulate the interactive judge, you will need to write the problem checker (judge) code alongside your solution.
Then, use the CROUPIER PYTHON SCRIPT to connect the input/outputs of two different programs.
For eg : This is how i would test a simple interactive binary search game in Linux Environment . I have not tested this on windows but i guess the instruction are pretty similar.