The sieve of Sundaram: Difference between revisions

Content added Content deleted
Line 524: Line 524:




// table :: Int -> String -> [[String]] -> String
// table :: Int -> String -> [String] -> String
const table = colCount =>
const table = nCols =>
// A tabulation of rows of string values,
// A tabulation of a list of values into a given
// with a specified gap between columns.
// 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(colCount)(xs)
return chunksOf(nCols)(xs)
.map(
.map(
row => row.map(
row => row.map(