(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 12.3' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 54479, 1394] NotebookOptionsPosition[ 50186, 1287] NotebookOutlinePosition[ 51933, 1339] CellTagsIndexPosition[ 51890, 1336] WindowTitle->ImportPGN | Example Notebook WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Basic Examples", "\[NonBreakingSpace]", Cell["(4)", "ExampleCount"], "\[NonBreakingSpace]" }], "Subsection", TaggingRules->{}, CellID->462042388], Cell["Start with a PGN text string:", "Text", TaggingRules->{}, CellChangeTimes->{{3.759852401095152*^9, 3.759852406639456*^9}, 3.759853142138152*^9, {3.7598531788378215`*^9, 3.759853201766114*^9}, { 3.7598653556493807`*^9, 3.7598653627110868`*^9}}, CellID->13078159], Cell[BoxData[ RowBox[{ RowBox[{ "myPGNString", "=", "\"\<[Event \\\"DSB-07.Kongress\\\"]\\n[Site \\\"Dresden\\\"]\\n[Date \ \\\"1892.??.??\\\"]\\n[Round \\\"16\\\"]\\n[White \\\"Paulsen, \ Wilfried\\\"]\\n[Black \\\"Von Gottschall, Hermann\\\"]\\n[Result \ \\\"0-1\\\"]\\n[ECO \\\"A00d\\\"]\\n[PlyCount \\\"64\\\"]\\n1. h3 e5 2. c4 \ Nc6 3. e3 Nf6 4. a3 d5 5. cxd5 Nxd5 6. Qc2 a6 7. Nf3 Be6\\n8. Nc3 Be7 9. Ne4 \ O-O 10. Nc5 Bxc5 11. Qxc5 Qd7 12. b4 f6 13. Bb2 Rad8\\n14. Rc1 Qf7 15. Qc2 \ Kh8 16. g4 Rfe8 17. b5 axb5 18. Bxb5 Rd6 19. Kf1 Nb6\\n20. d3 Red8 21. d4 \ exd4 22. Bxd4 Bd5 23. e4 Bb3 24. Qc3 Nxd4 25. Nxd4 Rxd4\\n26. Qxc7 Qxc7 27. \ Rxc7 Rxe4 28. Rxb7 Nc4 29. Kg2 Ne5 30. Bc6 Bc2\\n31. Rc1 Rc4 32. Re1 Rxc6 0-1\ \>\""}], ";"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.759853049594898*^9, 3.7598530913090696`*^9}, { 3.77055167560946*^9, 3.7705516790854735`*^9}}, CellLabel->"In[1]:=", CellID->265707063], Cell["Import this string as structured chess game data:", "Text", TaggingRules->{}, CellChangeTimes->{{3.759852401095152*^9, 3.759852406639456*^9}, 3.759853142138152*^9, {3.7598531788378215`*^9, 3.759853221477085*^9}, { 3.7598653291617327`*^9, 3.759865331119928*^9}}, CellID->889982941], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ TagBox[ DynamicModuleBox[{Typeset`open = False}, FrameBox[ PaneSelectorBox[{False->GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["ImportPGN", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"], ImageSizeCache->{11., {1., 10.}}], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"], ImageSizeCache->{11., {1., 10.}}]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}], True-> GridBox[{ {GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["ImportPGN", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"]], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"]]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}]}, { StyleBox[ PaneBox[GridBox[{ { RowBox[{ TagBox["\<\"Version (latest): \"\>", "IconizedLabel"], " ", TagBox["\<\"1.0.0\"\>", "IconizedItem"]}]}, { TagBox[ TemplateBox[{ "\"Documentation \[RightGuillemet]\"", "https://resources.wolframcloud.com/FunctionRepository/\ resources/ImportPGN"}, "HyperlinkURL"], "IconizedItem"]} }, DefaultBaseStyle->"Column", GridBoxAlignment->{"Columns" -> {{Left}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{5, 4}, {0, 4}}], "DialogStyle", FontFamily->"Roboto", FontSize->11]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxDividers->{"Columns" -> {{None}}, "Rows" -> {False, { GrayLevel[0.8]}, False}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[ Typeset`open], BaselinePosition->Baseline, ImageSize->Automatic], Background->RGBColor[ 0.9686274509803922, 0.9764705882352941, 0.984313725490196], BaselinePosition->Baseline, DefaultBaseStyle->{}, FrameMargins->{{0, 0}, {1, 0}}, FrameStyle->RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627], RoundingRadius->4]], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "ImportPGN"}, TagBoxNote->"FunctionResourceBox"], ResourceFunction["ImportPGN"], BoxID -> "ImportPGN", Selectable->False], "[", "myPGNString", "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.7598531519291306`*^9, 3.759853161310069*^9}}, CellLabel->"In[2]:=", CellID->137733969], Cell[BoxData[ RowBox[{"{", RowBox[{"\[LeftAssociation]", RowBox[{ RowBox[{"\<\"GameNumber\"\>", "\[Rule]", "1"}], ",", RowBox[{"\<\"Event\"\>", "\[Rule]", "\<\"\\\"DSB-07.Kongress\\\"\"\>"}], ",", RowBox[{"\<\"Site\"\>", "\[Rule]", "\<\"\\\"Dresden\\\"\"\>"}], ",", RowBox[{"\<\"Date\"\>", "\[Rule]", TemplateBox[{ RowBox[{ StyleBox[ "\"Year: \"", FontColor -> GrayLevel[0.5], FontWeight -> Plain], "\"1892\""}], RowBox[{"DateObject", "[", RowBox[{ RowBox[{"{", "1892", "}"}], ",", "\"Year\"", ",", "\"Gregorian\"", ",", RowBox[{"-", "5.`"}]}], "]"}]}, "DateObject", Editable->False]}], ",", RowBox[{"\<\"Round\"\>", "\[Rule]", "\<\"\\\"16\\\"\"\>"}], ",", RowBox[{"\<\"White\"\>", "\[Rule]", "\<\"\\\"Paulsen, Wilfried\\\"\"\>"}], ",", RowBox[{"\<\"Black\"\>", "\[Rule]", "\<\"\\\"Von Gottschall, Hermann\\\"\"\>"}], ",", RowBox[{"\<\"Result\"\>", "\[Rule]", "\<\"\\\"0-1\\\"\"\>"}], ",", RowBox[{"\<\"ECO\"\>", "\[Rule]", "\<\"\\\"A00d\\\"\"\>"}], ",", RowBox[{"\<\"PlyCount\"\>", "\[Rule]", "64"}], ",", RowBox[{"\<\"MoveList\"\>", "\[Rule]", RowBox[{"\[LeftAssociation]", RowBox[{ RowBox[{"1", "\[Rule]", RowBox[{"{", RowBox[{"\<\"h3\"\>", ",", "\<\"e5\"\>"}], "}"}]}], ",", RowBox[{"2", "\[Rule]", RowBox[{"{", RowBox[{"\<\"c4\"\>", ",", "\<\"Nc6\"\>"}], "}"}]}], ",", RowBox[{"3", "\[Rule]", RowBox[{"{", RowBox[{"\<\"e3\"\>", ",", "\<\"Nf6\"\>"}], "}"}]}], ",", RowBox[{"4", "\[Rule]", RowBox[{"{", RowBox[{"\<\"a3\"\>", ",", "\<\"d5\"\>"}], "}"}]}], ",", RowBox[{"5", "\[Rule]", RowBox[{"{", RowBox[{"\<\"cxd5\"\>", ",", "\<\"Nxd5\"\>"}], "}"}]}], ",", RowBox[{"6", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Qc2\"\>", ",", "\<\"a6\"\>"}], "}"}]}], ",", RowBox[{"7", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nf3\"\>", ",", "\<\"Be6\"\>"}], "}"}]}], ",", RowBox[{"8", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nc3\"\>", ",", "\<\"Be7\"\>"}], "}"}]}], ",", RowBox[{"9", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Ne4\"\>", ",", "\<\"O-O\"\>"}], "}"}]}], ",", RowBox[{"10", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nc5\"\>", ",", "\<\"Bxc5\"\>"}], "}"}]}], ",", RowBox[{"11", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Qxc5\"\>", ",", "\<\"Qd7\"\>"}], "}"}]}], ",", RowBox[{"12", "\[Rule]", RowBox[{"{", RowBox[{"\<\"b4\"\>", ",", "\<\"f6\"\>"}], "}"}]}], ",", RowBox[{"13", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Bb2\"\>", ",", "\<\"Rad8\"\>"}], "}"}]}], ",", RowBox[{"14", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Rc1\"\>", ",", "\<\"Qf7\"\>"}], "}"}]}], ",", RowBox[{"15", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Qc2\"\>", ",", "\<\"Kh8\"\>"}], "}"}]}], ",", RowBox[{"16", "\[Rule]", RowBox[{"{", RowBox[{"\<\"g4\"\>", ",", "\<\"Rfe8\"\>"}], "}"}]}], ",", RowBox[{"17", "\[Rule]", RowBox[{"{", RowBox[{"\<\"b5\"\>", ",", "\<\"axb5\"\>"}], "}"}]}], ",", RowBox[{"18", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Bxb5\"\>", ",", "\<\"Rd6\"\>"}], "}"}]}], ",", RowBox[{"19", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Kf1\"\>", ",", "\<\"Nb6\"\>"}], "}"}]}], ",", RowBox[{"20", "\[Rule]", RowBox[{"{", RowBox[{"\<\"d3\"\>", ",", "\<\"Red8\"\>"}], "}"}]}], ",", RowBox[{"21", "\[Rule]", RowBox[{"{", RowBox[{"\<\"d4\"\>", ",", "\<\"exd4\"\>"}], "}"}]}], ",", RowBox[{"22", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Bxd4\"\>", ",", "\<\"Bd5\"\>"}], "}"}]}], ",", RowBox[{"23", "\[Rule]", RowBox[{"{", RowBox[{"\<\"e4\"\>", ",", "\<\"Bb3\"\>"}], "}"}]}], ",", RowBox[{"24", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Qc3\"\>", ",", "\<\"Nxd4\"\>"}], "}"}]}], ",", RowBox[{"25", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nxd4\"\>", ",", "\<\"Rxd4\"\>"}], "}"}]}], ",", RowBox[{"26", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Qxc7\"\>", ",", "\<\"Qxc7\"\>"}], "}"}]}], ",", RowBox[{"27", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Rxc7\"\>", ",", "\<\"Rxe4\"\>"}], "}"}]}], ",", RowBox[{"28", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Rxb7\"\>", ",", "\<\"Nc4\"\>"}], "}"}]}], ",", RowBox[{"29", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Kg2\"\>", ",", "\<\"Ne5\"\>"}], "}"}]}], ",", RowBox[{"30", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Bc6\"\>", ",", "\<\"Bc2\"\>"}], "}"}]}], ",", RowBox[{"31", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Rc1\"\>", ",", "\<\"Rc4\"\>"}], "}"}]}], ",", RowBox[{"32", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Re1\"\>", ",", "\<\"Rxc6\"\>"}], "}"}]}]}], "\[RightAssociation]"}]}], ",", RowBox[{"\<\"MoveListString\"\>", "\[Rule]", "\<\"1. h3 e5 2. c4 Nc6 3. e3 Nf6 4. a3 d5 5. cxd5 Nxd5 6. \ Qc2 a6 7. Nf3 Be6 8. Nc3 Be7 9. Ne4 O-O 10. Nc5 Bxc5 11. Qxc5 Qd7 12. b4 f6 \ 13. Bb2 Rad8 14. Rc1 Qf7 15. Qc2 Kh8 16. g4 Rfe8 17. b5 axb5 18. Bxb5 Rd6 19. \ Kf1 Nb6 20. d3 Red8 21. d4 exd4 22. Bxd4 Bd5 23. e4 Bb3 24. Qc3 Nxd4 25. Nxd4 \ Rxd4 26. Qxc7 Qxc7 27. Rxc7 Rxe4 28. Rxb7 Nc4 29. Kg2 Ne5 30. Bc6 Bc2 31. Rc1 \ Rc4 32. Re1 Rxc6 0-1\"\>"}]}], "\[RightAssociation]"}], "}"}]], "Output", TaggingRules->{}, CellChangeTimes->{ 3.7598531624971876`*^9, 3.759865322020018*^9, 3.7598661119730053`*^9, 3.75986905730851*^9, {3.760187244730547*^9, 3.760187276547728*^9}, 3.7620895786317606`*^9, 3.762101094507233*^9, 3.762103879030334*^9, 3.762105954418398*^9}, CellLabel->"Out[2]=", CellID->1271377681] }, Open ]], Cell["Write the previous PGN out to a file:", "Text", TaggingRules->{}, CellChangeTimes->{{3.7598534864935837`*^9, 3.7598535158125153`*^9}}, CellID->428803150], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"pgnFilename", "=", RowBox[{"CreateFile", "[", "]"}]}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.759853415237459*^9, 3.7598534391968546`*^9}}, CellLabel->"In[3]:=", CellID->21332492], Cell[BoxData["\<\"C:\\\\Users\\\\pacoj\\\\AppData\\\\Local\\\\Temp\\\\m-\ 0ce46b08-69a6-4aa8-abfc-5e7f87f4c98c\"\>"], "Output", TaggingRules->{}, CellChangeTimes->{3.759853441498085*^9, 3.75986537514433*^9, 3.7598661165524635`*^9, 3.759869057373516*^9, 3.760187279601033*^9, 3.7620895990238*^9, 3.7621011011759*^9, 3.7621038790913343`*^9}, CellLabel->"Out[3]=", CellID->21803501] }, Open ]], Cell[BoxData[ RowBox[{"WriteString", "[", RowBox[{"pgnFilename", ",", "myPGNString"}], "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.7598534584857836`*^9, 3.759853459605895*^9}, { 3.7598535419591303`*^9, 3.759853561107044*^9}, {3.7598540230352325`*^9, 3.759854023525282*^9}}, CellLabel->"In[4]:=", CellID->328607237], Cell["Import structured chess data directly from the created file:", "Text", TaggingRules->{}, CellChangeTimes->{{3.7598534864935837`*^9, 3.7598535158125153`*^9}, { 3.75985357546248*^9, 3.7598536129042234`*^9}, {3.7598661299728055`*^9, 3.759866136160424*^9}, {3.773824175262553*^9, 3.773824186047347*^9}}, CellID->907883603], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ TagBox[ DynamicModuleBox[{Typeset`open = False}, FrameBox[ PaneSelectorBox[{False->GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["ImportPGN", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"], ImageSizeCache->{11., {1., 10.}}], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"], ImageSizeCache->{11., {1., 10.}}]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}], True-> GridBox[{ {GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["ImportPGN", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"]], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"]]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}]}, { StyleBox[ PaneBox[GridBox[{ { RowBox[{ TagBox["\<\"Version (latest): \"\>", "IconizedLabel"], " ", TagBox["\<\"1.0.0\"\>", "IconizedItem"]}]}, { TagBox[ TemplateBox[{ "\"Documentation \[RightGuillemet]\"", "https://resources.wolframcloud.com/FunctionRepository/\ resources/ImportPGN"}, "HyperlinkURL"], "IconizedItem"]} }, DefaultBaseStyle->"Column", GridBoxAlignment->{"Columns" -> {{Left}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{5, 4}, {0, 4}}], "DialogStyle", FontFamily->"Roboto", FontSize->11]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxDividers->{"Columns" -> {{None}}, "Rows" -> {False, { GrayLevel[0.8]}, False}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[ Typeset`open], BaselinePosition->Baseline, ImageSize->Automatic], Background->RGBColor[ 0.9686274509803922, 0.9764705882352941, 0.984313725490196], BaselinePosition->Baseline, DefaultBaseStyle->{}, FrameMargins->{{0, 0}, {1, 0}}, FrameStyle->RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627], RoundingRadius->4]], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "ImportPGN"}, TagBoxNote->"FunctionResourceBox"], ResourceFunction["ImportPGN"], BoxID -> "ImportPGN", Selectable->False], "[", "pgnFilename", "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.759853618399773*^9, 3.7598536316841016`*^9}}, CellLabel->"In[5]:=", CellID->591850384], Cell[BoxData[ RowBox[{"{", RowBox[{"\[LeftAssociation]", RowBox[{ RowBox[{"\<\"GameNumber\"\>", "\[Rule]", "1"}], ",", RowBox[{"\<\"Event\"\>", "\[Rule]", "\<\"\\\"DSB-07.Kongress\\\"\"\>"}], ",", RowBox[{"\<\"Site\"\>", "\[Rule]", "\<\"\\\"Dresden\\\"\"\>"}], ",", RowBox[{"\<\"Date\"\>", "\[Rule]", TemplateBox[{ RowBox[{ StyleBox[ "\"Year: \"", FontColor -> GrayLevel[0.5], FontWeight -> Plain], "\"1892\""}], RowBox[{"DateObject", "[", RowBox[{ RowBox[{"{", "1892", "}"}], ",", "\"Year\"", ",", "\"Gregorian\"", ",", RowBox[{"-", "5.`"}]}], "]"}]}, "DateObject", Editable->False]}], ",", RowBox[{"\<\"Round\"\>", "\[Rule]", "\<\"\\\"16\\\"\"\>"}], ",", RowBox[{"\<\"White\"\>", "\[Rule]", "\<\"\\\"Paulsen, Wilfried\\\"\"\>"}], ",", RowBox[{"\<\"Black\"\>", "\[Rule]", "\<\"\\\"Von Gottschall, Hermann\\\"\"\>"}], ",", RowBox[{"\<\"Result\"\>", "\[Rule]", "\<\"\\\"0-1\\\"\"\>"}], ",", RowBox[{"\<\"ECO\"\>", "\[Rule]", "\<\"\\\"A00d\\\"\"\>"}], ",", RowBox[{"\<\"PlyCount\"\>", "\[Rule]", "64"}], ",", RowBox[{"\<\"MoveList\"\>", "\[Rule]", RowBox[{"\[LeftAssociation]", RowBox[{ RowBox[{"1", "\[Rule]", RowBox[{"{", RowBox[{"\<\"h3\"\>", ",", "\<\"e5\"\>"}], "}"}]}], ",", RowBox[{"2", "\[Rule]", RowBox[{"{", RowBox[{"\<\"c4\"\>", ",", "\<\"Nc6\"\>"}], "}"}]}], ",", RowBox[{"3", "\[Rule]", RowBox[{"{", RowBox[{"\<\"e3\"\>", ",", "\<\"Nf6\"\>"}], "}"}]}], ",", RowBox[{"4", "\[Rule]", RowBox[{"{", RowBox[{"\<\"a3\"\>", ",", "\<\"d5\"\>"}], "}"}]}], ",", RowBox[{"5", "\[Rule]", RowBox[{"{", RowBox[{"\<\"cxd5\"\>", ",", "\<\"Nxd5\"\>"}], "}"}]}], ",", RowBox[{"6", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Qc2\"\>", ",", "\<\"a6\"\>"}], "}"}]}], ",", RowBox[{"7", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nf3\"\>", ",", "\<\"Be6\"\>"}], "}"}]}], ",", RowBox[{"8", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nc3\"\>", ",", "\<\"Be7\"\>"}], "}"}]}], ",", RowBox[{"9", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Ne4\"\>", ",", "\<\"O-O\"\>"}], "}"}]}], ",", RowBox[{"10", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nc5\"\>", ",", "\<\"Bxc5\"\>"}], "}"}]}], ",", RowBox[{"11", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Qxc5\"\>", ",", "\<\"Qd7\"\>"}], "}"}]}], ",", RowBox[{"12", "\[Rule]", RowBox[{"{", RowBox[{"\<\"b4\"\>", ",", "\<\"f6\"\>"}], "}"}]}], ",", RowBox[{"13", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Bb2\"\>", ",", "\<\"Rad8\"\>"}], "}"}]}], ",", RowBox[{"14", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Rc1\"\>", ",", "\<\"Qf7\"\>"}], "}"}]}], ",", RowBox[{"15", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Qc2\"\>", ",", "\<\"Kh8\"\>"}], "}"}]}], ",", RowBox[{"16", "\[Rule]", RowBox[{"{", RowBox[{"\<\"g4\"\>", ",", "\<\"Rfe8\"\>"}], "}"}]}], ",", RowBox[{"17", "\[Rule]", RowBox[{"{", RowBox[{"\<\"b5\"\>", ",", "\<\"axb5\"\>"}], "}"}]}], ",", RowBox[{"18", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Bxb5\"\>", ",", "\<\"Rd6\"\>"}], "}"}]}], ",", RowBox[{"19", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Kf1\"\>", ",", "\<\"Nb6\"\>"}], "}"}]}], ",", RowBox[{"20", "\[Rule]", RowBox[{"{", RowBox[{"\<\"d3\"\>", ",", "\<\"Red8\"\>"}], "}"}]}], ",", RowBox[{"21", "\[Rule]", RowBox[{"{", RowBox[{"\<\"d4\"\>", ",", "\<\"exd4\"\>"}], "}"}]}], ",", RowBox[{"22", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Bxd4\"\>", ",", "\<\"Bd5\"\>"}], "}"}]}], ",", RowBox[{"23", "\[Rule]", RowBox[{"{", RowBox[{"\<\"e4\"\>", ",", "\<\"Bb3\"\>"}], "}"}]}], ",", RowBox[{"24", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Qc3\"\>", ",", "\<\"Nxd4\"\>"}], "}"}]}], ",", RowBox[{"25", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nxd4\"\>", ",", "\<\"Rxd4\"\>"}], "}"}]}], ",", RowBox[{"26", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Qxc7\"\>", ",", "\<\"Qxc7\"\>"}], "}"}]}], ",", RowBox[{"27", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Rxc7\"\>", ",", "\<\"Rxe4\"\>"}], "}"}]}], ",", RowBox[{"28", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Rxb7\"\>", ",", "\<\"Nc4\"\>"}], "}"}]}], ",", RowBox[{"29", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Kg2\"\>", ",", "\<\"Ne5\"\>"}], "}"}]}], ",", RowBox[{"30", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Bc6\"\>", ",", "\<\"Bc2\"\>"}], "}"}]}], ",", RowBox[{"31", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Rc1\"\>", ",", "\<\"Rc4\"\>"}], "}"}]}], ",", RowBox[{"32", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Re1\"\>", ",", "\<\"Rxc6\"\>"}], "}"}]}]}], "\[RightAssociation]"}]}], ",", RowBox[{"\<\"MoveListString\"\>", "\[Rule]", "\<\"1. h3 e5 2. c4 Nc6 3. e3 Nf6 4. a3 d5 5. cxd5 Nxd5 6. \ Qc2 a6 7. Nf3 Be6 8. Nc3 Be7 9. Ne4 O-O 10. Nc5 Bxc5 11. Qxc5 Qd7 12. b4 f6 \ 13. Bb2 Rad8 14. Rc1 Qf7 15. Qc2 Kh8 16. g4 Rfe8 17. b5 axb5 18. Bxb5 Rd6 19. \ Kf1 Nb6 20. d3 Red8 21. d4 exd4 22. Bxd4 Bd5 23. e4 Bb3 24. Qc3 Nxd4 25. Nxd4 \ Rxd4 26. Qxc7 Qxc7 27. Rxc7 Rxe4 28. Rxb7 Nc4 29. Kg2 Ne5 30. Bc6 Bc2 31. Rc1 \ Rc4 32. Re1 Rxc6 0-1\"\>"}]}], "\[RightAssociation]"}], "}"}]], "Output", TaggingRules->{}, CellChangeTimes->{3.7598536323321667`*^9, 3.7598540278447137`*^9, 3.7598653826330786`*^9, 3.7598661391557236`*^9, 3.7598690574865274`*^9, 3.760187284748548*^9, 3.762089606838581*^9, 3.7621011044322257`*^9, 3.762103879159334*^9}, CellLabel->"Out[5]=", CellID->705249446] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Properties and Relations", "\[NonBreakingSpace]", Cell["(2)", "ExampleCount"], "\[NonBreakingSpace]" }], "Subsection", TaggingRules->{}, CellID->754506620], Cell[TextData[{ "If ", Cell[BoxData[ "\"\<\!\(\*StyleBox[\"input\", \"TI\"]\)\>\""], "InlineFormula", FontFamily->"Source Sans Pro", FontSize->0.9428571428571428 Inherited], " does not contain any properly formatted PGN games, ", Cell[BoxData[ StyleBox["ImportPGN", "InlineResourceFunction"]], "InlineFormula", FontFamily->"Source Sans Pro"], Cell[BoxData[ RowBox[{"[", "\"\<\!\(\*StyleBox[\"input\", \"TI\"]\)\>\"", "]"}]], "InlineFormula", FontFamily->"Source Sans Pro"], " returns ", Cell[BoxData[ RowBox[{"{", "}"}]], "InlineFormula", FontFamily->"Source Sans Pro", FontSize->0.9428571428571428 Inherited], ":" }], "Text", TaggingRules->{}, CellChangeTimes->{{3.759867189816779*^9, 3.759867198207618*^9}, { 3.7705517737333755`*^9, 3.770551834930365*^9}, {3.7738242037421436`*^9, 3.7738242139231415`*^9}, {3.773824405949853*^9, 3.7738244210134125`*^9}}, CellID->151911914], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ TagBox[ DynamicModuleBox[{Typeset`open = False}, FrameBox[ PaneSelectorBox[{False->GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["ImportPGN", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"], ImageSizeCache->{11., {1., 10.}}], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"], ImageSizeCache->{11., {1., 10.}}]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}], True-> GridBox[{ {GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["ImportPGN", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"]], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"]]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}]}, { StyleBox[ PaneBox[GridBox[{ { RowBox[{ TagBox["\<\"Version (latest): \"\>", "IconizedLabel"], " ", TagBox["\<\"1.0.0\"\>", "IconizedItem"]}]}, { TagBox[ TemplateBox[{ "\"Documentation \[RightGuillemet]\"", "https://resources.wolframcloud.com/FunctionRepository/\ resources/ImportPGN"}, "HyperlinkURL"], "IconizedItem"]} }, DefaultBaseStyle->"Column", GridBoxAlignment->{"Columns" -> {{Left}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{5, 4}, {0, 4}}], "DialogStyle", FontFamily->"Roboto", FontSize->11]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxDividers->{"Columns" -> {{None}}, "Rows" -> {False, { GrayLevel[0.8]}, False}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[ Typeset`open], BaselinePosition->Baseline, ImageSize->Automatic], Background->RGBColor[ 0.9686274509803922, 0.9764705882352941, 0.984313725490196], BaselinePosition->Baseline, DefaultBaseStyle->{}, FrameMargins->{{0, 0}, {1, 0}}, FrameStyle->RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627], RoundingRadius->4]], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "ImportPGN"}, TagBoxNote->"FunctionResourceBox"], ResourceFunction["ImportPGN"], BoxID -> "ImportPGN", Selectable->False], "[", "\"\\"", "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.7598672013599334`*^9, 3.7598672097517724`*^9}}, CellLabel->"In[1]:=", CellID->78722170], Cell[BoxData[ RowBox[{"{", "}"}]], "Output", TaggingRules->{}, CellChangeTimes->{3.7598672102608232`*^9, 3.76018729216929*^9, 3.762101160732855*^9, 3.7621038862703342`*^9}, CellLabel->"Out[1]=", CellID->416107197] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[Cell["\t", "ExampleDelimiter"], $Line = 0; Null]], "ExampleDelimiter", TaggingRules->{}, CellID->137154129], Cell["\<\ The concatenation of one or more PGN game strings yields a list of game data \ associations, which are each assigned consecutive integer \"GameNumber\" keys:\ \>", "Text", TaggingRules->{}, CellChangeTimes->{{3.759867189816779*^9, 3.759867198207618*^9}, { 3.7621011693487167`*^9, 3.7621011802168036`*^9}, {3.7621012541992006`*^9, 3.762101290246805*^9}, {3.762101629584736*^9, 3.762101706199396*^9}, { 3.7705518368442717`*^9, 3.7705518396696568`*^9}}, CellID->286527151], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{ "mySecondPGN", "=", "\"\<[Site \\\"Champaign, IL\\\"]\\n[Date \\\"2019.3.20\\\"]\\n[White \ \\\"Player 1\\\"]\\n[Black \\\"Player 2\\\"]\\n[Result \ \\\"1/2-1/2\\\"]\\n[ECO \\\"C48f\\\"]\\n[PlyCount \\\"14\\\"]\\n\\n1. e4 e5 \ 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bc5 5. O-O d6 6. d4 exd4 7. Nxd4 Bxd4 \ 1/2-1/2\>\""}], ";"}], "\n", RowBox[{ RowBox[{ InterpretationBox[ TagBox[ DynamicModuleBox[{Typeset`open = False}, FrameBox[ PaneSelectorBox[{False->GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["ImportPGN", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"], ImageSizeCache->{11., {1., 10.}}], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"], ImageSizeCache->{11., {1., 10.}}]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}], True-> GridBox[{ {GridBox[{ { PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.6538461538461539 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["ImportPGN", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], ItemBox[ PaneBox[ TogglerBox[Dynamic[Typeset`open], {True-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeCloser"]], False-> DynamicBox[FEPrivate`FrontEndResource[ "FEBitmaps", "IconizeOpener"]]}, Appearance->None, BaselinePosition->Baseline, ContentPadding->False, FrameMargins->0], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{1, 1}, {0, 0}}], Frame->{{ RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627, 0.5], False}, {False, False}}]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0}}, "Rows" -> {{0}}}]}, { StyleBox[ PaneBox[GridBox[{ { RowBox[{ TagBox["\<\"Version (latest): \"\>", "IconizedLabel"], " ", TagBox["\<\"1.0.0\"\>", "IconizedItem"]}]}, { TagBox[ TemplateBox[{ "\"Documentation \[RightGuillemet]\"", "https://resources.wolframcloud.com/FunctionRepository/\ resources/ImportPGN"}, "HyperlinkURL"], "IconizedItem"]} }, DefaultBaseStyle->"Column", GridBoxAlignment->{"Columns" -> {{Left}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], Alignment->Left, BaselinePosition->Baseline, FrameMargins->{{5, 4}, {0, 4}}], "DialogStyle", FontFamily->"Roboto", FontSize->11]} }, BaselinePosition->{1, 1}, GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}, GridBoxDividers->{"Columns" -> {{None}}, "Rows" -> {False, { GrayLevel[0.8]}, False}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}]}, Dynamic[ Typeset`open], BaselinePosition->Baseline, ImageSize->Automatic], Background->RGBColor[ 0.9686274509803922, 0.9764705882352941, 0.984313725490196], BaselinePosition->Baseline, DefaultBaseStyle->{}, FrameMargins->{{0, 0}, {1, 0}}, FrameStyle->RGBColor[ 0.8313725490196079, 0.8470588235294118, 0.8509803921568627], RoundingRadius->4]], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "ImportPGN"}, TagBoxNote->"FunctionResourceBox"], ResourceFunction["ImportPGN"], BoxID -> "ImportPGN", Selectable->False], "[", RowBox[{"StringRiffle", "[", RowBox[{ RowBox[{"{", RowBox[{"myPGNString", ",", "mySecondPGN"}], "}"}], ",", "\"\<\\n\\n\>\""}], "]"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"SelectFirst", "[", RowBox[{"%", ",", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"\"\\"", " ", "/.", " ", "#"}], ")"}], "\[Equal]", "2"}], "&"}]}], "]"}]}], "Input", TaggingRules->{}, CellChangeTimes->{ 3.7620962782916594`*^9, 3.762101414436223*^9, {3.762101448700649*^9, 3.762101493049083*^9}, {3.762101530043782*^9, 3.7621016049912767`*^9}}, CellLabel->"In[1]:=", CellID->273200592], Cell[BoxData[ RowBox[{"\[LeftAssociation]", RowBox[{ RowBox[{"\<\"GameNumber\"\>", "\[Rule]", "2"}], ",", RowBox[{"\<\"Site\"\>", "\[Rule]", "\<\"\\\"Champaign, IL\\\"\"\>"}], ",", RowBox[{"\<\"Date\"\>", "\[Rule]", TemplateBox[{ RowBox[{ StyleBox[ "\"Day: \"", FontColor -> GrayLevel[0.5], FontWeight -> Plain], "\"Wed 20 Mar 2019\""}], RowBox[{"DateObject", "[", RowBox[{ RowBox[{"{", RowBox[{"2019", ",", "3", ",", "20"}], "}"}], ",", "\"Day\"", ",", "\"Gregorian\"", ",", RowBox[{"-", "5.`"}]}], "]"}]}, "DateObject", Editable->False]}], ",", RowBox[{"\<\"White\"\>", "\[Rule]", "\<\"\\\"Player 1\\\"\"\>"}], ",", RowBox[{"\<\"Black\"\>", "\[Rule]", "\<\"\\\"Player 2\\\"\"\>"}], ",", RowBox[{"\<\"Result\"\>", "\[Rule]", "\<\"\\\"1/2-1/2\\\"\"\>"}], ",", RowBox[{"\<\"ECO\"\>", "\[Rule]", "\<\"\\\"C48f\\\"\"\>"}], ",", RowBox[{"\<\"PlyCount\"\>", "\[Rule]", "14"}], ",", RowBox[{"\<\"MoveList\"\>", "\[Rule]", RowBox[{"\[LeftAssociation]", RowBox[{ RowBox[{"1", "\[Rule]", RowBox[{"{", RowBox[{"\<\"e4\"\>", ",", "\<\"e5\"\>"}], "}"}]}], ",", RowBox[{"2", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nf3\"\>", ",", "\<\"Nc6\"\>"}], "}"}]}], ",", RowBox[{"3", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nc3\"\>", ",", "\<\"Nf6\"\>"}], "}"}]}], ",", RowBox[{"4", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Bb5\"\>", ",", "\<\"Bc5\"\>"}], "}"}]}], ",", RowBox[{"5", "\[Rule]", RowBox[{"{", RowBox[{"\<\"O-O\"\>", ",", "\<\"d6\"\>"}], "}"}]}], ",", RowBox[{"6", "\[Rule]", RowBox[{"{", RowBox[{"\<\"d4\"\>", ",", "\<\"exd4\"\>"}], "}"}]}], ",", RowBox[{"7", "\[Rule]", RowBox[{"{", RowBox[{"\<\"Nxd4\"\>", ",", "\<\"Bxd4\"\>"}], "}"}]}]}], "\[RightAssociation]"}]}], ",", RowBox[{"\<\"MoveListString\"\>", "\[Rule]", "\<\" 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Bc5 5. O-O d6 6. \ d4 exd4 7. Nxd4 Bxd4 1/2-1/2\"\>"}]}], "\[RightAssociation]"}]], "Output", TaggingRules->{}, CellChangeTimes->{{3.762101386419421*^9, 3.762101399973777*^9}, { 3.7621015195117292`*^9, 3.762101532267005*^9}, 3.7621016062734046`*^9, 3.762103886327334*^9, 3.7621059737612543`*^9}, CellLabel->"Out[1]=", CellID->861729589] }, Open ]] }, Open ]] }, Closed]] }, ClosingSaveDialog->False, WindowSize->Automatic, WindowMargins->Automatic, WindowTitle->"ImportPGN | Example Notebook", Visible->False, FrontEndVersion->"12.3 for Mac OS X x86 (64-bit) (May 11, 2021)", StyleDefinitions->Notebook[{ Cell[ StyleData[ StyleDefinitions -> FrontEnd`FileName[{"Wolfram"}, "Reference.nb", CharacterEncoding -> "UTF-8"]]], Cell[ StyleData[All, "Working"], Editable -> True, DockedCells -> {}], Cell[ StyleData["Notebook"], Editable -> True, DockedCells -> {}, ScrollingOptions -> {"VerticalScrollRange" -> Automatic}], Cell[ StyleData[ "Section", StyleDefinitions -> StyleData["PrimaryExamplesSection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData["Subsection", StyleDefinitions -> StyleData["ExampleSection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData[ "Subsubsection", StyleDefinitions -> StyleData["ExampleSubsection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData[ "Subsubsubsection", StyleDefinitions -> StyleData["ExampleSubsubsection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData["Text", StyleDefinitions -> StyleData["ExampleText"]], Editable -> True]}, Visible -> False, FrontEndVersion -> "12.3 for Mac OS X x86 (64-bit) (May 11, 2021)", StyleDefinitions -> "PrivateStylesheetFormatting.nb"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[622, 23, 168, 7, 70, "Subsection",ExpressionUUID->"d3f636f6-9d0a-4c52-aa7b-d0fdd75dbb98", CellID->462042388], Cell[793, 32, 277, 5, 70, "Text",ExpressionUUID->"f732db4d-28e0-43a4-8438-d4854adb40dd", CellID->13078159], Cell[1073, 39, 937, 18, 70, "Input",ExpressionUUID->"56b7bf83-b13e-4dde-9f61-99255f0c69c0", CellID->265707063], Cell[2013, 59, 296, 5, 70, "Text",ExpressionUUID->"3d425852-813c-44e9-a2bb-51151259bc9d", CellID->889982941], Cell[CellGroupData[{ Cell[2334, 68, 7121, 179, 70, "Input",ExpressionUUID->"8f026617-71cc-42c3-8e1e-f1fe14baa697", CellID->137733969], Cell[9458, 249, 6115, 143, 70, "Output",ExpressionUUID->"160a8300-5279-435b-ac99-3d3c9465e270", CellID->1271377681] }, Open ]], Cell[15588, 395, 162, 3, 70, "Text",ExpressionUUID->"909c99f1-108d-4d2b-8884-e8b0a13e0425", CellID->428803150], Cell[CellGroupData[{ Cell[15775, 402, 220, 6, 70, "Input",ExpressionUUID->"a672b290-45b4-49ab-9768-6b6d4826ec6c", CellID->21332492], Cell[15998, 410, 389, 7, 70, "Output",ExpressionUUID->"398f2f24-76e5-4e09-8942-6dc866148e67", CellID->21803501] }, Open ]], Cell[16402, 420, 339, 8, 70, "Input",ExpressionUUID->"92397384-210a-4a36-9b7a-a4d2b7f4cb65", CellID->328607237], Cell[16744, 430, 332, 5, 70, "Text",ExpressionUUID->"3828c3c7-ea6e-4d7f-a5df-ab3779cf6848", CellID->907883603], Cell[CellGroupData[{ Cell[17101, 439, 7121, 179, 70, "Input",ExpressionUUID->"d9cac327-1c54-460c-ad97-1a075e5df8b9", CellID->591850384], Cell[24225, 620, 6091, 142, 70, "Output",ExpressionUUID->"d839d209-477e-4a88-b0ff-2d9dfb3456bf", CellID->705249446] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[30365, 768, 178, 7, 70, "Subsection",ExpressionUUID->"f4d6e099-f444-41db-90aa-f71dfb1914d1", CellID->754506620], Cell[30546, 777, 913, 25, 70, "Text",ExpressionUUID->"73c4732a-b57c-4c06-8cee-662e6fd29082", CellID->151911914], Cell[CellGroupData[{ Cell[31484, 806, 7123, 179, 70, "Input",ExpressionUUID->"a847938a-0058-4e33-8fde-1e8b0b940281", CellID->78722170], Cell[38610, 987, 221, 6, 70, "Output",ExpressionUUID->"586a807d-225d-41d5-962e-96cdfb3f971c", CellID->416107197] }, Open ]], Cell[CellGroupData[{ Cell[38868, 998, 144, 4, 70, "ExampleDelimiter",ExpressionUUID->"0d9f536c-c9e5-4eda-9977-8996cf487af0", CellID->137154129], Cell[39015, 1004, 489, 9, 70, "Text",ExpressionUUID->"20006b57-cb28-4791-a0df-fb648f254538", CellID->286527151], Cell[CellGroupData[{ Cell[39529, 1017, 8180, 205, 70, "Input",ExpressionUUID->"a87e91c4-379d-4a1e-a3db-a976abbffbab", CellID->273200592], Cell[47712, 1224, 2434, 58, 70, "Output",ExpressionUUID->"4c2d3b18-ecec-41b3-b779-c3c62f06c995", CellID->861729589] }, Open ]] }, Open ]] }, Closed]] } ] *) (* End of internal cache information *)