| 1 | module main |
| 2 | |
| 3 | pub const n = 7 |
| 4 | pub const nsq = n * n |
| 5 | |
| 6 | pub fn empty_board(with_init bool) [nsq]u8 { |
| 7 | if with_init { |
| 8 | a := [nsq]u8{init: 0} |
| 9 | dump(a) |
| 10 | return [nsq]u8{init: 0} |
| 11 | } else { |
| 12 | a := [nsq]u8{} |
| 13 | dump(a) |
| 14 | return [nsq]u8{} |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | fn test_with_init() { |
| 19 | a := dump(empty_board(true)) |
| 20 | assert a.len == 49 |
| 21 | } |
| 22 | |
| 23 | fn test_without_init() { |
| 24 | a := dump(empty_board(false)) |
| 25 | assert a.len == 49 |
| 26 | } |
| 27 |