Magic squares of odd order: Difference between revisions
→{{header|AppleScript}}
m (J: oops, diagonals matter) |
|||
Line 387:
to allow for first class functions and closures.
<lang AppleScript>----------------
-- oddMagicSquare :: Int -> [[Int]]
on oddMagicSquare(n)
cycleRows(transpose(cycleRows(table(n))))
else
missing value
end if
end oddMagicSquare
on run
-- Orders 3, 5, 11
Line 448 ⟶ 453:
-- intercalate :: Text -> [Text] -> Text
Line 521 ⟶ 526:
end transpose
-- WIKI DISPLAY ---------------------------------------------------------------▼
-- formattedTable :: [[Int]] -> String
|