Created
February 4, 2011 15:23
-
-
Save aterreno/811226 to your computer and use it in GitHub Desktop.
n by n wavefront matrix
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
wavefront :: Int -> Array (Int,Int) Int | |
wavefront n = a where | |
a = array ((1,1),(n,n)) | |
([((1,j), 1) | j <- [1..n]] ++ | |
[((i,1), 1) | i <- [2..n]] ++ | |
[((i,j), a!(i,j-1) + a!(i-1,j-1) + a!(i-1,j)) | |
| i <- [2..n], j <- [2..n]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment