Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab 3: Ex 4 #11

Open
BertLisser opened this issue Sep 28, 2017 · 0 comments
Open

Lab 3: Ex 4 #11

BertLisser opened this issue Sep 28, 2017 · 0 comments

Comments

@BertLisser
Copy link

Very nice solution. Excellent.
However important test cases Dsj, Conj with the empty list as argument are missed.
The cause of it is lying in the definitions placed in Exercise 2.

-- We can use the following functions from lecture 2, changing 0 to 1
getRandomInt :: Int -> IO Int
getRandomInt n = getStdRandom (randomR (1,n
.
.
generateForm level = do
                        n <- getRandomInt 6
                        m <- getRandomInt 
.
.
                        3 -> do
                                   frms <- generateForms m (level-1)
                                   return (Dsj frms)

Don't change in all cases 0 into 1.
Well done (=9)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant