Closed allegroCoder closed 8 years ago
I propose not to use interactive mode at all. Don't ask the user to input numbers, filenames, etc. Instead, use command line arguments. There are good libraries for parsing command line parameters in Haskell, the most commonly used being System.Console.GetOpt
. An example of how I use it in Shaking up GHC project: https://github.com/snowleopard/shaking-up-ghc/blob/master/src/CmdLineFlag.hs.
Thanks for the link! I will learn how to use command line parameters for the next part. Now I will try to skip the interactive mode, in order to automate the test.
However, a memo for myself: the problem should be related to the c++ function. I should double-check the function for loading the scenarios.
So, I think we can close this issue for now?
I am splitting the c++ encoding framework in multiple functions (loading scenarios and the custom opcodes, one per encoding algorithm).
I am facing with a problem when I have to read a number from stdin in Haskell.
the code above generates the following error message:
I tackled the problem opening a new handle, the code below works:
Though, I don't like this solution. I split up the c++ encoding framework over multiple functions (loading scenarios and opcodes, one function for each algorithm). After that the function for loading scenarios is called, the problem arises. @snowleopard do you know how to fix this?