forked from exercism/futhark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.fut
More file actions
29 lines (23 loc) · 3.4 KB
/
test.fut
File metadata and controls
29 lines (23 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import "diamond"
-- Degenerate case with a single 'A' row
-- ==
-- input { "A" }
-- output { ["A"] }
-- Degenerate case with no row containing 3 distinct groups of spaces
-- ==
-- input { "B" }
-- output { [" A ", "B B", " A "] }
-- Smallest non-degenerate case with odd diamond side length
-- ==
-- input { "C" }
-- output { [" A ", " B B ", "C C", " B B ", " A "] }
-- Smallest non-degenerate case with even diamond side length
-- ==
-- input { "D" }
-- output { [" A ", " B B ", " C C ", "D D", " C C ", " B B ", " A "] }
-- Largest possible diamond
-- ==
-- input { "Z" }
-- output { [" A ", " B B ", " C C ", " D D ", " E E ", " F F ", " G G ", " H H ", " I I ", " J J ", " K K ", " L L ", " M M ", " N N ", " O O ", " P P ", " Q Q ", " R R ", " S S ", " T T ", " U U ", " V V ", " W W ", " X X ", " Y Y ", "Z Z", " Y Y ", " X X ", " W W ", " V V ", " U U ", " T T ", " S S ", " R R ", " Q Q ", " P P ", " O O ", " N N ", " M M ", " L L ", " K K ", " J J ", " I I ", " H H ", " G G ", " F F ", " E E ", " D D ", " C C ", " B B ", " A "] }
let main (letter: [1]u8): [][]u8 =
rows letter[0]