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

fixed typo in fairRest

parent 25d91e84
No related branches found
No related tags found
1 merge request!9fixed typo in fairRest
......@@ -109,7 +109,6 @@ generateSchedules rooms startDay endDay professors = groups
-- 3a + 4b + 5c = n
-- if 3,4 or 5 are equal, does findEven change if the other equal number is chosen?
-- guard order is important!
fairRest :: Int -> Int
fairRest n
| first result == 5 && second result == 1 = first resultDif -- last group cannot be 6 since its not allowed
......@@ -121,7 +120,7 @@ fairRest n
result = minimumBy (compare `on` second) modResults
resultDif = minimumBy (compare `on` third) modResults
modResult x = (x, n `mod` x, x - (n `mod` x))
modResults = map modResult [5,4]
modResults = map modResult [5,4,3]
first (x, _, _) = x
second (_, x, _) = x
third (_, _, x) = x
......
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