The sieve of Sundaram: Difference between revisions
Content added Content deleted
Line 524: | Line 524: | ||
// table :: Int -> String -> |
// table :: Int -> String -> [String] -> String |
||
const table = |
const table = nCols => |
||
// A tabulation of |
// A tabulation of a list of values into a given |
||
// |
// number of columns, using a specified gap |
||
// between those columns. |
|||
gap => xs => { |
gap => xs => { |
||
const w = xs[xs.length - 1].length; |
const w = xs[xs.length - 1].length; |
||
return chunksOf( |
return chunksOf(nCols)(xs) |
||
.map( |
.map( |
||
row => row.map( |
row => row.map( |