Skip to content

Commit

Permalink
Update assignment3.hs
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwarz1 committed Oct 8, 2014
1 parent 30f6b19 commit 0583a08
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions assignment3.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ checkindividual lookingfor currentstudent




{-
TODO make output True for true conidtion
Checks if the total number of students can be split into said group size
-}
checkmod :: Int -> Int -> Bool
checkmod x y
| mod x y == 0 = True
| otherwise = False

{-
Expand All @@ -80,13 +87,17 @@ main =
progName <- getProgName
let students = read(head args) :: Int --now we can use ints!
let grpsize = read(head $tail args) :: Int
putStrLn "The number of students are:"
putStrLn students
putStrLn "The group size is: "
putStrLn grpsize
putStrLn "Program name is:"
putStrLn progName


if checkmod students grpsize
then
listGen (splitList students grpsize) [1..students] grpsize

else
do
putStrLn $"Cannot pair up " ++
show(students) ++ " students into groups of "
++ show(grpsize) ++ " across eight assignments"




0 comments on commit 0583a08

Please sign in to comment.