| Paste number 26591: | where wtf |
| Pasted by: | Tobsan |
| 2 years, 3 months ago | |
| None | |
| Paste contents: |
--This obviously works... twoRandomIntegers :: StdGen -> (Integer , Integer) twoRandomIntegers g = (n1 , n2 ) where (n1 , g1 ) = randomR (0, 10) g (n2 , g2 ) = randomR (0, 10) g1 --then why not this? shuffle' :: Integer -> Hand -> StdGen -> Hand shuffle' indx Empty rnd = Empty shuffle' indx (Add c h) rnd = Add( theCard (shuffle' newIndx newDeck gen) ) where (theCard, newDeck) = getCard indx (Add c h) newIndx = randomR (0, sizeH hand) |
Annotations for this paste:
| Annotation number 1: | fixed where |
| Pasted by: | glguy |
| 2 years, 3 months ago | |
| Paste contents: |
| --then why not this? shuffle' :: Integer -> Hand -> StdGen -> Hand shuffle' indx Empty rnd = Empty shuffle' indx (Add c h) rnd = Add( theCard (shuffle' newIndx newDeck gen) ) where (theCard, newDeck) = getCard indx (Add c h) newIndx = randomR (0, sizeH hand) |
| Annotation number 2: | Indent fixes |
| Pasted by: | ndm |
| 2 years, 3 months ago | |
| Paste contents: |
| shuffle' :: Integer -> Hand -> StdGen -> Hand shuffle' indx Empty rnd = Empty shuffle' indx (Add c h) rnd = Add( theCard (shuffle' newIndx newDeck gen) ) where (theCard, newDeck) = getCard indx (Add c h) newIndx = randomR (0, sizeH hand) |