Created
May 14, 2015 00:22
-
-
Save chadbrewbaker/3090f5712f9c6f2b326d to your computer and use it in GitHub Desktop.
First iteration of endoscope, MVP on Z_7(*)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
monogenic :: Int -> Int -> (Int -> Int -> Int) -> [Int] | |
monogenic size seed mult = take size $ iterate f seed | |
where | |
f = mult seed | |
endoscope :: Int -> (Int -> Int -> Int) -> Graph | |
endoscope size mult = buildG (0,size) $ concat [ g i | i <- [0..size]] | |
where | |
g blar = zip (replicate size blar) (f blar) | |
where | |
f x = monogenic size x mult | |
mul7 :: Int -> Int -> Int | |
mul7 x y = mod (x*y) 7 | |
main = print $ endoscope 7 mul7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment