Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for compilation of source code #106

Open
tarapt opened this issue Feb 22, 2018 · 2 comments
Open

Support for compilation of source code #106

tarapt opened this issue Feb 22, 2018 · 2 comments

Comments

@tarapt
Copy link

tarapt commented Feb 22, 2018

Since Codeforces and other online judges compile with -DONLINE_JUDGE option in C++, I frequently use the following construct in my code. But, this causes a problem when using Hightail, as it expects output from stdout, not output.txt file.

#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif

So, if Hightail could recompile the code with -DONLINE_JUDGE option, it would solve this issue.

@tarapt tarapt changed the title Support for Compilation of source code Support for compilation of source code Feb 22, 2018
@ghost
Copy link

ghost commented Feb 22, 2018

Hey!

Hightail parses the sample input and output and then directly runs the code and takes input from stdin and outputs to stdout and also checks the output of your program to the correct output. By parsing, hightail saves you your time of copy pasting the sample input and output and checking the program's output to the correct output.

Thus using '#ifndef ONLINE_JUDGE' etc would be unnecessary. I don't think it is necessary for Hightail to run the program with the -DONLINE_JUDGE as the real motive of using Hightail is lost.

@tarapt
Copy link
Author

tarapt commented Feb 23, 2018

@deepamsarmah I agree with you. But still, it would be nice to have that additional functionality. That may come handy while debugging, when we may need to print lots of lines, like 2D arrays, sets, maps etc, I am not sure they would all fit on Hightail display. Afterall hightail purpose wasn't to aid as a debugging tool. It's a good testing tool, and it allows us to add extra test cases too. So, by having Hightail compile the code with -DONLINE_JUDGE, we can do both. Whenever we need to get our hands dirty with debugging, we can switch to the input/output in IDE, but before submitting the code, we can use Hightail to test the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant