Skip to content
Snippets Groups Projects
Commit d1da42f6 authored by beekmannju85374's avatar beekmannju85374 :writing_hand:
Browse files

added functionality to save and load schedules

parent cb38e00f
No related branches found
No related tags found
1 merge request!12added functionality to save and load schedules
......@@ -67,7 +67,9 @@ schedule rooms startDay endDay professors = do
putStrLn "no valid schedule could been found, need more dates"
else do
writeFile "presentations.tex" $ generateLaTeX $ head schedules
putStrLn ("---" ++ "\n" ++ "created schedule in presentations.tex" ++ "\n" ++ "---" ++ "\n" ++ "if you want the room distribution to be more even (possibly needs more dates) run \"scheduleEven\" with the same parameters" ++ "\n" ++ "---")
saveToFile (head schedules) "presentations.txt"
putStrLn ("---" ++ "\n" ++ "created schedule in presentations.tex and saved in presentations.txt" ++ "\n" ++ "---" ++ "\n" ++ "if you want the room distribution to be more even (possibly needs more dates) run \"scheduleEven\" with the same parameters" ++ "\n" ++ "---")
-- tries to have as equal room distribution as possible
scheduleEven :: [Room] -> String -> String -> [Professor] -> IO ()
......@@ -78,7 +80,8 @@ scheduleEven rooms startDay endDay professors = do
putStrLn "no valid EVEN schedule could been found, need more dates, or run schedule"
else do
writeFile "presentations.tex" $ generateLaTeX $ head schedules
putStrLn ("---" ++ "\n" ++ "created even schedule in presentations.tex" ++ "\n" ++"---" )
saveToFile (head schedules) "presentations.txt"
putStrLn ("---" ++ "\n" ++ "created even schedule in presentations.tex and saved in presentations.txt" ++ "\n" ++"---" )
generateSchedules :: [Room] -> String -> String -> [Professor] -> [[[Presentation]]]
......
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment