Back to General discussions forum
Hi!
I just solved the second easiest problem and do not know exactly how to submit a solution that is divided into two files.
I have a Program.fs file that only calls a function from another module. I looked at the previous solutions
they only submitted the function without specifying how and where it is called. I can of course also copy paste only the
function definition, but in later exercises I will have many functions possibly in multiple files.
I believe you make it too complex. All my solutions on this website are at max 100 lines long... and fit into single file. What problem you are trying to solve?
I checked your profile and have the following suggestion:
namespace Solution
(* Content of Input.fs goes here *)
[<AutoOpen>]
module Input =
open System
let readInt() =
Console.ReadLine()
|> int
(* more code... *)
(* Content of Program.fs goes here *)
module Program =
readInt() |> ignore
(* more code... *)
This way you will have your code in single file, but separated to modules as you like.
I checked another solutions of this task and I think that this is a textbook solution
Clearly you see now that without overcomplicating yourself with extra functions and modules you can get a short and concise code!
Hi qwerty, Thank you, it is nice of you.
You are right I am overcomplicating a little bit.
I think of every problem as a separate module and every module should reuse already existing functions
from earlier modules as much as possible.
The solution is then called from a Main/Program file/class.
Because the structure of the input varies from task to task, I need a utility module with
tailored functionsfor preprocessing the input.
The flow of the program should be such that
In other words, I want to