Multiplication tables: Difference between revisions
m
→AppleScript :: Functional: Tweaked types for simpler separation between model and display
m (→Applescript: Iteration: ( normalized indentation )) |
m (→AppleScript :: Functional: Tweaked types for simpler separation between model and display) |
||
Line 546:
on multiplicationTable(n)
tableText(mulTable(enumFromTo(1,
end multiplicationTable
-- mulTable :: [Int
on mulTable(
script column
Line 560 ⟶ 559:
on |λ|(y)
if y < x then
else
end if
end |λ|
end script
{{{x}} & map(row, axis)}
end |λ|
end script
end mulTable
-- tableText :: [[Int]] -> String
on tableText(
script tableLine
on |λ|(lstLine)
Line 589:
end script
set axis to {{"x"}} & rest of (item 1 of rows)
intercalate(linefeed, map(tableLine,
end tableText
|