Hey all I’ve just made a Quality of Life script that makes testing specific Test Cases for puzzles in your External Editor extremely easy, painless and most importantly: Automated!
It effectively works by overriding the default way of getting input from the user typing in the console (e.g. System.Console.ReadLine() in C#) and instead automatically grabs the input data for you from a dedicated file and uses this instead (line by line). This should save your sanity & fingers from repeatedly typing out the same test data each time you wan to debug the Test Case.
Pros
- Removes the need for you to ever type the Input Data from test cases line by line in the console ever again!
- It’s extremely simple to use (there’s a step-by-step guide on how to add it to your project)
- Setup takes a matter of minutes: Copy the file, follow the 5 steps and you’re good to go!
- It doesn’t intefere with your actual submission file on CodinGame in any way whatsoever
- You can enable and disable the functionality by a single character change
- Will work with any External Editor setup (although instructions are based on using Visual Studio)
- Removes the risk of typos happening from repeatedly typing the same data each time
- No need to temporarily change he code in order to hack in the input data for testing purposes
- Memory friendly! Won’t affect your running of the solution locally in any visible way
How to use
- Ensure you’ve setup the External Editor plugin: Coding Games and Programming Challenges to Code Better
- Head to: CodinGame/Helpers/InputHelper at main · Chazzmundo/CodinGame · GitHub
- Find the InputHelper file corresponding to the language of your choice (more will be added over time) and copy to your project
- Follow the steps as listed at the InputHelper file
- Enjoy living in the fast lane!
Supported languages
For now, I’ve only added support for:
- C#
However, the GitHub repository is open for contribution if anyone would like to help porting to other languages and I’ve added guidelines in the ReadMe file on how to ensure it’s ready to use by other people
Feedback
I hope it is helpful, please let me know if you encounter any bugs, or have suggestions/requests for future helpers!