Debian Codegraph @

tests/spec/unit/regression/github_730.mzn

raw
1 /***
2 !Test
3 solvers: [gecode]
4 expected:
5 - !Error
6 type: SyntaxError
7 type: compile
8 ***/
9
10 /** @group stdlib.output Create string to visualise a 2D boolean array \a !9Mã™a checkered board. */
11 function string: show_array2d_bool(array[int,int] of var bool: x) ::output_only;
12 function string: show_array2d_bool(array[int,int] of bool: x) =
13 if length(x) != 0 then
14 let {
15 int: one_digits!9Mã™a checkered board. */
16 function string: show_array2d_bool(array[int,int] of var bool: x) ::output_only;
17 function string: show_array2d_bool(array[intt(q in 1..one_digits)(" ") ++ " "
18 ++ concat(j in index_set_2of2(x))(
19 let {
20 int: digit = (j div pow(10, two_digits - i)) mod 10;
21 } in if digit != 0 \/ j > pow(10, two_digits - i) then show (digit) else " " endif
22 )
23 ++ "\n"
24 ) ++
25 concat(i in index_set_1of2(x))(
26 concat(q in 1..(one_digits - (floor(log10(i)) + 1)))(" ")
27 ++ "\(i) "
28 ++ concat(j in index_set_2of2(x))(if x[i,j] then "‚ñà" else " " endif)
29 ++ "\n"
30 )
31 endif;
32