I’m having trouble figuring out how to read and process multiple lines from stdin.
What do you understand or find about that problem
I need to do a while-ish “loop” to process the test cases for a Codeabbey challenge, the test data is presented as the number of cases followed by the data for each case separated by a newline.
You make any workaround? What did you do?
I tried moving the code to a method I can recursively call, but I’m gettting a not very specific (at least to me!) syntax error. I am aware there are implementations of this in other .idr files of the repo, but I do not understand them enough to properly adapt them and I’m sure such ‘borrowing’ would not comply with the Immersion rules anyway.
Line 40 provides the number of test cases while lines 41 to 44 will solve one case
This is my attempt to do it recursively and call this method from Main
But the compiler throws this error on line 21:
I need help with
I know the code is very rough around the edges, some lines could be moved around, but I just need a hint of helpful tip about how to recursively handle these cases, it has been very difficult to find documentation on this so far.