ZUIY422H4XJARH5I366XA4WXHY72VFMGJJPL4T6BIXBH6OHY4USAC
PUEVD5LHJH2GUKOBNHZTGYW6YTIBZGE7AMAHPDMMGSCUQFULII2AC
KZKRGZBWLSKWVN6ZKDGGK6W6EAQLMSKUEJBVMMZ2UD3TZERZKS7QC
F2NSN45RYCMFIJ4WVEKRTCORP2IEFSAWH3XNRAT2I55CNSBK6DUAC
JFVDXTQS6OZQWXXRQ3I4HC7BBFXWQUWQO56C7AXQ35PMWUQI2MKAC
U3DDUM6PNGQS3342RSZVDTLLZNS55EPHFVI36GWXHAJ23P5PVPDQC
PBRYNWYOTORTAAYHMNGLU5KNAS4T5FCSEIWM656VQ7IZJ6P7NQ3QC
COS2T3FPTP6JB7UANIDCGVTW5T7HEAOSTNWI6JNVL6K3I6EOWJNQC
var $author$project$Queens$solutionDecoder = A2(
$elm$json$Json$Decode$field,
'queens',
$elm$json$Json$Decode$list(
$elm$json$Json$Decode$list($elm$json$Json$Decode$int)));
var $elm$core$Basics$negate = function (n) {
return -n;
};
var $author$project$Queens$solutionDecoder = function () {
var listToTuple = function (l) {
if (l.b && l.b.b) {
var x = l.a;
var _v1 = l.b;
var y = _v1.a;
var xs = _v1.b;
return _Utils_Tuple2(x, y);
} else {
return _Utils_Tuple2(-1, -1);
}
};
return A2(
$elm$json$Json$Decode$field,
'queens',
$elm$json$Json$Decode$list(
A2(
$elm$json$Json$Decode$map,
listToTuple,
$elm$json$Json$Decode$list($elm$json$Json$Decode$int))));
}();
Ok(sol) ->
( { model
| status = Just Solved
, solutionQueens = Set.fromList
<| List.filter (\x -> not (Set.member x model.fixedQueens))
<| List.map (\l -> listToTuple l) sol
}
, Cmd.none
)
Ok(sol) ->
( { model
| status = Just Solved
, solutionQueens = Set.fromList
<| List.filter (\x -> not (Set.member x model.fixedQueens))
<| sol
}
, Cmd.none
)
listToTuple : List Int -> (Int,Int)
listToTuple l =
case l of
(x::y::xs) -> (x,y)
_ -> (-1, -1)
solutionDecoder : Decoder (List (Int, Int))
solutionDecoder =
let
listToTuple l =
case l of
(x::y::xs) -> (x,y)
_ -> (-1, -1)
in
field "queens" <| list (Decode.map listToTuple (list int))
[ el [centerX, paddingXY 0 20] (text "Queens")
, el [] (html <| board model)
, row [spacing 10, Element.width fill] [ status, sizeSlider, b "Clear" ClearQueens]
[ el [centerX, paddingXY 0 20] (text "Queens") -- heading
, el [] (html <| board model) -- board
, row -- controls
[spacing 10, Element.width fill]
[ status, sizeSlider, but "Clear" ClearQueens]