diff --git a/build/app.js b/build/app.js index a7c7fd5..0b4d311 100644 --- a/build/app.js +++ b/build/app.js @@ -8941,7 +8941,7 @@ var _rtfeldman$elm_css_helpers$Html_CssHelpers$Namespace = F4( return {$class: a, classList: b, id: c, name: d}; }); -var _user$project$Player$show = function (player) { +var _user$project$Player$showPlayer = function (player) { var _p0 = player; switch (_p0.ctor) { case 'A': @@ -8969,8 +8969,21 @@ var _user$project$CssTypes$Header = {ctor: 'Header'}; var _user$project$CssTypes$Box = {ctor: 'Box'}; var _user$project$CssTypes$Page = {ctor: 'Page'}; +var _user$project$Models_Box$showBox = function (_p0) { + var _p1 = _p0; + return _user$project$Player$showPlayer(_p1._0); +}; +var _user$project$Models_Box$Box = function (a) { + return {ctor: 'Box', _0: a}; +}; + var _user$project$Model$initialModel = { - boxes: A2(_elm_lang$core$Array$repeat, 9, _user$project$Player$Unclaimed), + boxes: A2( + _elm_lang$core$Array$initialize, + 9, + function (index) { + return _user$project$Models_Box$Box(_user$project$Player$Unclaimed); + }), currentPlayer: _user$project$Player$A, winner: _elm_lang$core$Maybe$Nothing }; @@ -8984,9 +8997,10 @@ var _user$project$GameEvent$CheckWinner = F3( function (a, b, c) { return {ctor: 'CheckWinner', _0: a, _1: b, _2: c}; }); -var _user$project$GameEvent$Clicked = function (a) { - return {ctor: 'Clicked', _0: a}; -}; +var _user$project$GameEvent$Clicked = F2( + function (a, b) { + return {ctor: 'Clicked', _0: a, _1: b}; + }); var _user$project$EventHandlers_OnClicked$onClicked = F2( function (model, index) { @@ -8994,7 +9008,10 @@ var _user$project$EventHandlers_OnClicked$onClicked = F2( return _elm_lang$core$Basics$identity; }; var markBoxForPlayer = function (player) { - return A2(_elm_lang$core$Array$set, index, player); + return A2( + _elm_lang$core$Array$set, + index, + _user$project$Models_Box$Box(player)); }; return function (_p0) { var _p1 = _p0; @@ -9019,7 +9036,7 @@ var _user$project$EventHandlers_OnClicked$onClicked = F2( }( function (box) { var _p4 = box; - if (_p4.ctor === 'Unclaimed') { + if (_p4._0.ctor === 'Unclaimed') { return {ctor: '_Tuple2', _0: markBoxForPlayer, _1: true}; } else { return {ctor: '_Tuple2', _0: leaveBoardIntact, _1: false}; @@ -9027,18 +9044,23 @@ var _user$project$EventHandlers_OnClicked$onClicked = F2( }( A2( _elm_lang$core$Maybe$withDefault, - _user$project$Player$Unclaimed, + _user$project$Models_Box$Box(_user$project$Player$Unclaimed), A2(_elm_lang$core$Array$get, index, model.boxes)))); }); var _user$project$GameLogic$noneUnclaimed = function (ary) { - return _elm_lang$core$Native_Utils.eq( + return A2( + F2( + function (x, y) { + return _elm_lang$core$Native_Utils.eq(x, y); + }), 0, _elm_lang$core$Array$length( A2( _elm_lang$core$Array$filter, function (x) { - return _elm_lang$core$Native_Utils.eq(x, _user$project$Player$Unclaimed); + var _p0 = x; + return _elm_lang$core$Native_Utils.eq(_p0._0, _user$project$Player$Unclaimed); }, ary))); }; @@ -9185,16 +9207,16 @@ var _user$project$Update$currentPlayerWinning = F2( _elm_lang$core$Array$length( A2( _elm_lang$core$Array$filter, - F2( - function (x, y) { - return _elm_lang$core$Native_Utils.eq(x, y); - })(player), + function (x) { + var _p0 = x; + return _elm_lang$core$Native_Utils.eq(_p0._0, player); + }, A2( _elm_lang$core$Array$map, function (index) { return A2( _elm_lang$core$Maybe$withDefault, - _user$project$Player$Unclaimed, + _user$project$Models_Box$Box(_user$project$Player$Unclaimed), A2(_elm_lang$core$Array$get, index, ary)); }, _elm_lang$core$Array$fromList(indices))))); @@ -9215,16 +9237,16 @@ var _user$project$Update$currentPlayerWinning = F2( }); var _user$project$Update$playerWon = F2( function (player, model) { - var _p0 = A2(_user$project$Update$currentPlayerWinning, player, model.boxes); - if (_p0 === true) { + var _p1 = A2(_user$project$Update$currentPlayerWinning, player, model.boxes); + if (_p1 === true) { return _elm_lang$core$Result$Ok(player); } else { return _elm_lang$core$Result$Err('Not there yet!'); } }); var _user$project$Update$changePlayer = function (p) { - var _p1 = p; - switch (_p1.ctor) { + var _p2 = p; + switch (_p2.ctor) { case 'A': return _user$project$Player$B; case 'B': @@ -9235,24 +9257,24 @@ var _user$project$Update$changePlayer = function (p) { }; var _user$project$Update$update = F2( function (msg, model) { - var _p2 = msg; - switch (_p2.ctor) { + var _p3 = msg; + switch (_p3.ctor) { case 'Reset': return A2( _elm_lang$core$Platform_Cmd_ops['!'], _user$project$Model$initialModel, {ctor: '[]'}); case 'CheckWinner': - var _p6 = _p2._0; + var _p7 = _p3._0; if (_user$project$GameLogic$noneUnclaimed(model.boxes)) { - var _p3 = A2(_user$project$Update$playerWon, _p6, model); - if (_p3.ctor === 'Ok') { + var _p4 = A2(_user$project$Update$playerWon, _p7, model); + if (_p4.ctor === 'Ok') { return A2( _elm_lang$core$Platform_Cmd_ops['!'], _elm_lang$core$Native_Utils.update( model, { - winner: _elm_lang$core$Maybe$Just(_p3._0) + winner: _elm_lang$core$Maybe$Just(_p4._0) }), {ctor: '[]'}); } else { @@ -9266,16 +9288,16 @@ var _user$project$Update$update = F2( {ctor: '[]'}); } } else { - var _p4 = _p2._1; - if (_p4 === true) { - var _p5 = A2(_user$project$Update$playerWon, _p6, model); - if (_p5.ctor === 'Ok') { + var _p5 = _p3._1; + if (_p5 === true) { + var _p6 = A2(_user$project$Update$playerWon, _p7, model); + if (_p6.ctor === 'Ok') { return A2( _elm_lang$core$Platform_Cmd_ops['!'], _elm_lang$core$Native_Utils.update( model, { - winner: _elm_lang$core$Maybe$Just(_p5._0) + winner: _elm_lang$core$Maybe$Just(_p6._0) }), {ctor: '[]'}); } else { @@ -9284,7 +9306,7 @@ var _user$project$Update$update = F2( _elm_lang$core$Native_Utils.update( model, { - currentPlayer: _user$project$Update$changePlayer(_p6) + currentPlayer: _user$project$Update$changePlayer(_p7) }), {ctor: '[]'}); } @@ -9296,14 +9318,18 @@ var _user$project$Update$update = F2( } } default: - return A2(_user$project$EventHandlers_OnClicked$onClicked, model, _p2._0); + return A2(_user$project$EventHandlers_OnClicked$onClicked, model, _p3._1); } }); -var _user$project$View$_p0 = _user$project$CssTypes$indexNamespace; -var _user$project$View$id = _user$project$View$_p0.id; -var _user$project$View$class = _user$project$View$_p0.$class; -var _user$project$View$classList = _user$project$View$_p0.classList; +var _user$project$View$boxCssClass = function (_p0) { + var _p1 = _p0; + return _user$project$CssTypes$PlayerColor(_p1._0); +}; +var _user$project$View$_p2 = _user$project$CssTypes$indexNamespace; +var _user$project$View$id = _user$project$View$_p2.id; +var _user$project$View$class = _user$project$View$_p2.$class; +var _user$project$View$classList = _user$project$View$_p2.classList; var _user$project$View$view = function (model) { var showDeadEnd = function (msg) { return A2( @@ -9359,7 +9385,7 @@ var _user$project$View$view = function (model) { } }); }; - var showPlayer = function (player) { + var showTurn = function (player) { return A2( _elm_lang$html$Html$div, { @@ -9380,19 +9406,19 @@ var _user$project$View$view = function (model) { 'Hey ', A2( _elm_lang$core$Basics_ops['++'], - _user$project$Player$show(player), + _user$project$Player$showPlayer(player), ', it\'s your turn'))), _1: {ctor: '[]'} }); }; - var box = function (index) { + var boxButton = function (index) { return function (currentBox) { return A2( _elm_lang$html$Html$button, { ctor: '::', _0: _elm_lang$html$Html_Events$onClick( - _user$project$GameEvent$Clicked(index)), + A2(_user$project$GameEvent$Clicked, currentBox, index)), _1: { ctor: '::', _0: _user$project$View$class( @@ -9401,7 +9427,7 @@ var _user$project$View$view = function (model) { _0: _user$project$CssTypes$Box, _1: { ctor: '::', - _0: _user$project$CssTypes$PlayerColor(currentBox), + _0: _user$project$View$boxCssClass(currentBox), _1: {ctor: '[]'} } }), @@ -9411,18 +9437,18 @@ var _user$project$View$view = function (model) { { ctor: '::', _0: _elm_lang$html$Html$text( - _user$project$Player$show(currentBox)), + _user$project$Models_Box$showBox(currentBox)), _1: {ctor: '[]'} }); }( A2( _elm_lang$core$Maybe$withDefault, - _user$project$Player$Unclaimed, + _user$project$Models_Box$Box(_user$project$Player$Unclaimed), A2(_elm_lang$core$Array$get, index, model.boxes))); }; var boxes = function () { - var _p1 = model.winner; - if (_p1.ctor === 'Nothing') { + var _p3 = model.winner; + if (_p3.ctor === 'Nothing') { return A2( _elm_lang$html$Html$div, { @@ -9437,13 +9463,13 @@ var _user$project$View$view = function (model) { }, { ctor: '::', - _0: box(0), + _0: boxButton(0), _1: { ctor: '::', - _0: box(1), + _0: boxButton(1), _1: { ctor: '::', - _0: box(2), + _0: boxButton(2), _1: { ctor: '::', _0: A2( @@ -9452,13 +9478,13 @@ var _user$project$View$view = function (model) { {ctor: '[]'}), _1: { ctor: '::', - _0: box(3), + _0: boxButton(3), _1: { ctor: '::', - _0: box(4), + _0: boxButton(4), _1: { ctor: '::', - _0: box(5), + _0: boxButton(5), _1: { ctor: '::', _0: A2( @@ -9467,13 +9493,13 @@ var _user$project$View$view = function (model) { {ctor: '[]'}), _1: { ctor: '::', - _0: box(6), + _0: boxButton(6), _1: { ctor: '::', - _0: box(7), + _0: boxButton(7), _1: { ctor: '::', - _0: box(8), + _0: boxButton(8), _1: { ctor: '::', _0: A2( @@ -9482,7 +9508,7 @@ var _user$project$View$view = function (model) { {ctor: '[]'}), _1: { ctor: '::', - _0: showPlayer(model.currentPlayer), + _0: showTurn(model.currentPlayer), _1: {ctor: '[]'} } } @@ -9498,7 +9524,7 @@ var _user$project$View$view = function (model) { } }); } else { - if (_p1._0.ctor === 'Unclaimed') { + if (_p3._0.ctor === 'Unclaimed') { return showDeadEnd('Draw!!1!1!'); } else { return showDeadEnd( @@ -9507,7 +9533,7 @@ var _user$project$View$view = function (model) { 'Player ', A2( _elm_lang$core$Basics_ops['++'], - _user$project$Player$show(_p1._0), + _user$project$Player$showPlayer(_p3._0), ' wins!'))); } } diff --git a/src/EventHandlers/OnClicked.elm b/src/EventHandlers/OnClicked.elm index a6c2fba..d5d0dbe 100644 --- a/src/EventHandlers/OnClicked.elm +++ b/src/EventHandlers/OnClicked.elm @@ -4,26 +4,27 @@ module EventHandlers.OnClicked exposing ( onClicked ) @docs onClicked -} -import Array exposing (..) -import Maybe exposing (..) -import Model exposing (..) -import GameEvent exposing (..) -import Player exposing (..) -import Task exposing (..) -import Time exposing (..) +import Array exposing (..) +import Maybe exposing (..) +import Model exposing (..) +import Models.Box exposing (..) +import GameEvent exposing (..) +import Player exposing (..) +import Task exposing (..) +import Time exposing (..) {-| onClicked -} onClicked : Model -> Int -> (Model, Cmd GameEvent) onClicked model index = let - markBoxForPlayer player = set index player + markBoxForPlayer player = set index <| Box player leaveBoardIntact player = identity in get index model.boxes - |> Maybe.withDefault Unclaimed + |> Maybe.withDefault (Box Unclaimed) |> (\box -> case box of - Unclaimed -> (markBoxForPlayer, True) - _ -> (leaveBoardIntact, False)) + (Box Unclaimed) -> (markBoxForPlayer, True) + _ -> (leaveBoardIntact, False)) |> \(transformBoard, validMove) -> ( transformBoard model.currentPlayer model.boxes , CheckWinner model.currentPlayer validMove) diff --git a/src/GameEvent.elm b/src/GameEvent.elm index bf6fb3d..a9753c2 100644 --- a/src/GameEvent.elm +++ b/src/GameEvent.elm @@ -1,8 +1,9 @@ module GameEvent exposing ( GameEvent(Clicked, CheckWinner, Reset) ) -import Player exposing (..) -import Time exposing (..) +import Player exposing (..) +import Time exposing (..) +import Models.Box exposing (..) -type GameEvent = Clicked Int - | CheckWinner Player Bool Time - | Reset +type GameEvent = Clicked Box Int + | CheckWinner Player Bool Time + | Reset diff --git a/src/GameLogic.elm b/src/GameLogic.elm index e89b7d5..da07e8d 100644 --- a/src/GameLogic.elm +++ b/src/GameLogic.elm @@ -1,7 +1,14 @@ module GameLogic exposing (noneUnclaimed) -import Array exposing (..) -import Player exposing (..) +import Array exposing (..) +import Player exposing (..) +import Models.Box exposing (..) -noneUnclaimed : Array Player -> Bool -noneUnclaimed ary = (0 == length(filter (\x -> x == Unclaimed) ary)) +noneUnclaimed : Array Box -> Bool +noneUnclaimed ary = + ary + |> filter + (\x -> case x of + (Box player) -> player == Unclaimed) + |> length + |> ((==) 0) diff --git a/src/Model.elm b/src/Model.elm index 871d418..87014b4 100644 --- a/src/Model.elm +++ b/src/Model.elm @@ -2,16 +2,17 @@ module Model exposing ( Model , initialModel ) -import Array exposing (..) -import Player exposing (..) +import Array exposing (..) +import Player exposing (..) +import Models.Box exposing (..) -type alias Model = { boxes : Array Player +type alias Model = { boxes : Array Box , currentPlayer : Player , winner : Maybe Player } initialModel : Model -initialModel = { boxes = repeat 9 Unclaimed +initialModel = { boxes = initialize 9 (\index -> Box Unclaimed) , currentPlayer = A , winner = Nothing } diff --git a/src/Models/Box.elm b/src/Models/Box.elm new file mode 100644 index 0000000..b181d5a --- /dev/null +++ b/src/Models/Box.elm @@ -0,0 +1,8 @@ +module Models.Box exposing (..) + +import Player exposing (..) + +type Box = Box Player + +showBox : Box -> String +showBox (Box player) = showPlayer player diff --git a/src/Player.elm b/src/Player.elm index 9528d75..0c105e7 100644 --- a/src/Player.elm +++ b/src/Player.elm @@ -1,13 +1,13 @@ module Player exposing ( Player(A, B, Unclaimed) - , show + , showPlayer ) type Player = A | B | Unclaimed -show : Player -> String -show player = case player of - A -> "A" - B -> "B" - Unclaimed -> "?" +showPlayer : Player -> String +showPlayer player = case player of + A -> "A" + B -> "B" + Unclaimed -> "?" diff --git a/src/Update.elm b/src/Update.elm index 3750e59..564d897 100644 --- a/src/Update.elm +++ b/src/Update.elm @@ -5,9 +5,10 @@ module Update exposing ( update import Array exposing (..) import EventHandlers.OnClicked +import GameEvent exposing (..) import GameLogic exposing (noneUnclaimed) import Model exposing (..) -import GameEvent exposing (..) +import Models.Box exposing (..) import Player exposing (..) changePlayer : Player -> Player @@ -16,7 +17,6 @@ changePlayer p = case p of B -> A _ -> A - type alias GameStatus = Result String Player winningCombos : List (List Int) @@ -26,14 +26,16 @@ winningCombos = , [3, 4, 5] , [1, 4, 7], [6, 4, 2] , [6, 7, 8] , [2, 5, 8]] -currentPlayerWinning : Player -> Array Player -> Bool +currentPlayerWinning : Player -> Array Box -> Bool currentPlayerWinning currentPlayer boxes = let - checkPlayerPositionsInList : Player -> List Int -> Array Player -> Bool + checkPlayerPositionsInList : Player -> List Int -> Array Box -> Bool checkPlayerPositionsInList player indices ary = fromList indices - |> map (\index -> (get index ary |> Maybe.withDefault Unclaimed)) - |> filter ((==) player) + |> map (\index -> (get index ary |> Maybe.withDefault (Box Unclaimed))) + |> filter + (\x -> case x of + (Box boxPlayer) -> boxPlayer == player) |> length |> (==) 3 in @@ -73,4 +75,4 @@ update msg model = -- Illegal move, same player should play again False -> model ! [] - Clicked index -> EventHandlers.OnClicked.onClicked model index + Clicked (Box player) index -> EventHandlers.OnClicked.onClicked model index diff --git a/src/View.elm b/src/View.elm index 2dc9e7d..fbbdcf0 100644 --- a/src/View.elm +++ b/src/View.elm @@ -7,42 +7,48 @@ import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (..) import Model exposing (..) +import Models.Box as M exposing (..) import GameEvent exposing (..) import Player exposing (..) { id, class, classList } = indexNamespace +boxCssClass : Box -> Classes +boxCssClass (M.Box player) = PlayerColor player + view : Model -> Html GameEvent view model = let - box index = get index model.boxes - |> Maybe.withDefault Unclaimed - |> \currentBox -> - button - [ onClick (Clicked index), class [ Box, (PlayerColor currentBox) ] ] - [ (text <| Player.show currentBox) ] - - showPlayer player = div + boxButton index = get index model.boxes + |> Maybe.withDefault (M.Box Unclaimed) + |> \currentBox -> + button + [ onClick (Clicked currentBox index) + , class [ CssTypes.Box, (boxCssClass currentBox) ] + ] + [ (text <| showBox currentBox) ] + + showTurn player = div [ class [ Footer ] ] - [ text("Hey " ++ (Player.show player) ++ ", it's your turn") ] + [ text("Hey " ++ (showPlayer player) ++ ", it's your turn") ] showDeadEnd msg = div [ class [ DeadEndMessage ] ] [ h2 [] [ text msg ] - , button [ onClick Reset, class [ Box, ResetButton ] ] [ text "Reset" ] ] + , button [ onClick Reset, class [ CssTypes.Box, ResetButton ] ] [ text "Reset" ] ] boxes = case model.winner of Nothing -> div [ class [ Container ] ] - [ box 0 , box 1 , box 2 , br [][] - , box 3 , box 4 , box 5 , br [][] - , box 6 , box 7 , box 8 , br [][] - , showPlayer model.currentPlayer] + [ boxButton 0, boxButton 1, boxButton 2, br [][] + , boxButton 3, boxButton 4, boxButton 5, br [][] + , boxButton 6, boxButton 7, boxButton 8, br [][] + , showTurn model.currentPlayer] Just Unclaimed -> showDeadEnd <| "Draw!!1!1!" Just winner -> showDeadEnd - <| "Player " ++ (Player.show winner) ++ " wins!" + <| "Player " ++ (showPlayer winner) ++ " wins!" in div [ id Page ] diff --git a/tests/unit/GameLogicTests.elm b/tests/unit/GameLogicTests.elm index 9527f54..ec8968e 100644 --- a/tests/unit/GameLogicTests.elm +++ b/tests/unit/GameLogicTests.elm @@ -1,21 +1,22 @@ module Unit.GameLogicTests exposing (gameLogicTests) -import Test exposing (..) +import Test exposing (..) import Expect import Array -import GameLogic exposing (noneUnclaimed) -import Model exposing (Model, initialModel) -import Player exposing (Player (A, B, Unclaimed)) +import GameLogic exposing (noneUnclaimed) +import Model exposing (Model, initialModel) +import Models.Box exposing (..) +import Player exposing (Player (A, B, Unclaimed)) gameLogicTests : List Test gameLogicTests = [ describe "GameLogic.noneUnclaimed" [ test "returns True if none of the boxes are unclaimed" <| \() -> Expect.equal True - <| noneUnclaimed <| Array.fromList <| [A, B, A] + <| noneUnclaimed <| Array.fromList <| [(Box A), (Box B), (Box A)] , test "returns False if at least one box is unclaimed" <| \() -> Expect.equal False - <| noneUnclaimed <| Array.fromList <| [A, Unclaimed, A] + <| noneUnclaimed <| Array.fromList <| [(Box A), (Box Unclaimed), (Box A)] ] ] diff --git a/tests/unit/PlayerTests.elm b/tests/unit/PlayerTests.elm index 0457b92..4def7c9 100644 --- a/tests/unit/PlayerTests.elm +++ b/tests/unit/PlayerTests.elm @@ -3,14 +3,14 @@ module Unit.PlayerTests exposing (playerTests) import Test exposing (..) import Expect import Set exposing (map) -import Player exposing (Player (A, B, Unclaimed)) +import Player exposing (Player (A, B, Unclaimed), showPlayer) playerTests : List Test -playerTests = [ describe "Player.show" +playerTests = [ describe "showPlayer" [ test "player names are all different" <| \() -> Expect.equal 3 <| Set.size <| Set.fromList -- Set.map requires comparables... thank, Elm :-D - <| List.map Player.show [A, B, Unclaimed] + <| List.map showPlayer [A, B, Unclaimed] ] ] diff --git a/tests/unit/UpdateTests.elm b/tests/unit/UpdateTests.elm index 8e5caf1..1219d4e 100644 --- a/tests/unit/UpdateTests.elm +++ b/tests/unit/UpdateTests.elm @@ -3,11 +3,14 @@ module Unit.UpdateTests exposing (updateTests) import Test exposing (..) import Expect import Array -import Model exposing (initialModel) -import GameEvent exposing (GameEvent(Clicked, CheckWinner, Reset)) -import Player exposing (Player (A, B, Unclaimed)) -import Update exposing (changePlayer, currentPlayerWinning, update) -import Time exposing (second) +import Model exposing (initialModel) +import Models.Box exposing (..) +import GameEvent exposing (GameEvent(Clicked, CheckWinner, Reset)) +import Player exposing (Player (A, B, Unclaimed)) +import Update exposing (changePlayer, currentPlayerWinning, update) +import Time exposing (second) + +makeBoard ary = Array.map (\player -> (Box player)) ary updateTests : List Test updateTests = [ describe "Update.update" @@ -21,7 +24,7 @@ updateTests = [ describe "Update.update" let message = (CheckWinner A False Time.second) previousModel = { initialModel - | boxes = (Array.fromList [ A, A, A + | boxes = makeBoard (Array.fromList [ A, A, A , A, B, B , B, B, A ]) } @@ -34,7 +37,7 @@ updateTests = [ describe "Update.update" let message = (CheckWinner A False Time.second) previousModel = { initialModel - | boxes = (Array.fromList [ A, A, B + | boxes = makeBoard (Array.fromList [ A, A, B , B, B, A , A, B, A ]) } @@ -47,7 +50,7 @@ updateTests = [ describe "Update.update" let message = (CheckWinner A True Time.second) previousModel = { initialModel - | boxes = (Array.fromList [ A, A, A + | boxes = makeBoard (Array.fromList [ A, A, A , B, B, Unclaimed , Unclaimed, Unclaimed, Unclaimed]) } @@ -60,7 +63,7 @@ updateTests = [ describe "Update.update" let message = (CheckWinner A True Time.second) previousModel = { initialModel - | boxes = (Array.fromList [ A, A, Unclaimed + | boxes = makeBoard (Array.fromList [ A, A, Unclaimed , B, B, Unclaimed , Unclaimed, Unclaimed, Unclaimed]) }