Checkers Puzzle: Geometric and Logical Challenge on a Board
2021-01-03 15:34
This GeoGebra applet presents a classic checkers puzzle with an interactive board and pieces (8 black and 8 white). Using commands like Circle, Polygon, and Sort, it renders the board grid and tokens while implementing move logic through conditional checks. Users attempt to achieve swapping or jumping objectives under constrained rules, with a Restart button for resetting. The applet blends geomet
In collections
Math Games with GeoGebra
<?xml version="1.0" encoding="utf-8"?>
<geogebra format="5.0" version="5.0.620.0" app="classic" platform="w" id="87cf7592-c95d-48d1-b25e-0c75130af65d" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/apps/xsd/ggb.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<gui>
<window width="641" height="801" />
<perspectives>
<perspective id="tmp">
<panes>
<pane location="" divider="1" orientation="1" />
</panes>
<views>
<view id="512" toolbar="0 | 1 501 5 19 , 67 | 2 15 45 18 , 7 37 | 514 3 9 , 13 44 , 47 | 16 | 551 550 11 , 20 22 21 23 , 55 56 57 , 12 | 69 | 510 511 , 512 513 | 533 531 , 534 532 , 522 523 , 537 536 , 535 | 521 520 | 36 , 38 49 560 | 571 30 29 570 31 33 | 17 | 540 40 41 42 , 27 28 35 , 6 , 502" visible="false" inframe="false" stylebar="false" location="1,1,1" size="500" window="100,100,600,400" />
<view id="4" toolbar="0 || 2020 , 2021 , 2022 , 66 || 2001 , 2003 , 2002 , 2004 , 2005 || 2040 , 2041 , 2042 , 2044 , 2043" visible="false" inframe="false" stylebar="false" location="1,1" size="300" window="100,100,600,400" />
<view id="8" toolbar="1001 | 1002 | 1003 || 1005 | 1004 || 1006 | 1007 | 1010 || 1008 1009 || 66 68 || 6" visible="false" inframe="false" stylebar="false" location="1,3" size="300" window="100,100,600,400" />
<view id="1" visible="true" inframe="false" stylebar="false" location="3" size="641" window="100,100,600,400" />
<view id="2" visible="false" inframe="false" stylebar="true" location="3" size="200" tab="ALGEBRA" window="660,41,600,997" />
<view id="16" visible="false" inframe="false" stylebar="false" location="1" size="150" window="50,50,500,500" />
<view id="32" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="64" toolbar="0" visible="false" inframe="false" stylebar="false" location="1" size="150" window="50,50,500,500" />
<view id="128" visible="false" inframe="false" stylebar="false" location="1" size="480" window="50,50,500,500" />
<view id="4097" visible="false" inframe="false" stylebar="true" location="1" size="385" window="29,324,1224,550" />
<view id="70" toolbar="0 || 2020 || 2021 || 2022" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
</views>
<toolbar show="false" items="0 39 73 62 | 1 501 67 , 5 19 , 72 75 76 | 2 15 45 , 18 65 , 7 37 | 4 3 8 9 , 13 44 , 58 , 47 | 16 51 64 , 70 | 10 34 53 11 , 24 20 22 , 21 23 | 55 56 57 , 12 | 36 46 , 38 49 50 , 71 14 68 | 30 29 54 32 31 33 | 25 17 26 60 52 61 | 40 41 42 , 27 28 35 , 6" position="1" help="false" />
<input show="false" cmd="true" top="algebra" />
<dockBar show="false" east="false" />
</perspective>
</perspectives>
<labelingStyle val="3"/>
<font size="16"/>
</gui>
<euclidianView>
<viewNumber viewNo="1"/>
<size width="641" height="801"/>
<coordSystem xZero="320.5" yZero="423.61786531752165" scale="115.58932658760727" yscale="115.58932658760791"/>
<evSettings axes="false" grid="false" gridIsBold="false" pointCapturing="2" rightAngleStyle="1" checkboxSize="26" gridType="3"/>
<bgColor r="255" g="239" b="213"/>
<axesColor r="0" g="0" b="0"/>
<gridColor r="192" g="192" b="192"/>
<lineStyle axes="1" grid="0"/>
<axis id="0" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
<axis id="1" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true"/>
</euclidianView>
<kernel>
<continuous val="false"/>
<usePathAndRegionParameters val="true"/>
<decimals val="2"/>
<angleUnit val="degree"/>
<algebraStyle val="0" spreadsheet="0"/>
<coordStyle val="0"/>
</kernel>
<tableview min="-2" max="2" step="1"/>
<scripting blocked="false" disabled="false"/>
<construction title="" author="" date="">
<expression label="B6" exp="(-2, -2)" type="point"/>
<element type="point" label="B6">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-2" y="-2" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="B7" exp="(-1, -2)" type="point"/>
<element type="point" label="B7">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-1" y="-2" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="B8" exp="(0, -2)" type="point"/>
<element type="point" label="B8">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="0" y="-2" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="B3" exp="(-2, -1)" type="point"/>
<element type="point" label="B3">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-2" y="-1" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="B4" exp="(-1, -1)" type="point"/>
<element type="point" label="B4">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-1" y="-1" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="B5" exp="(0, -1)" type="point"/>
<element type="point" label="B5">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="0" y="-1" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="B1" exp="(-1, 0)" type="point"/>
<element type="point" label="B1">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-1" y="0" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="B2" exp="(-2, 0)" type="point"/>
<element type="point" label="B2">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-2" y="0" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="W2" exp="(1, 2)" type="point"/>
<element type="point" label="W2">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="1" y="2" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="W3" exp="(2, 2)" type="point"/>
<element type="point" label="W3">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="2" y="2" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="W5" exp="(1, 1)" type="point"/>
<element type="point" label="W5">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="1" y="1" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="W6" exp="(2, 1)" type="point"/>
<element type="point" label="W6">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="2" y="1" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="W4" exp="(0, 1)" type="point"/>
<element type="point" label="W4">
<show object="false" label="true" ev="4"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="0" y="1" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="W1" exp="(0, 2)" type="point"/>
<element type="point" label="W1">
<show object="false" label="true" ev="4"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="0" y="2" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="W7" exp="(1, 0)" type="point"/>
<element type="point" label="W7">
<show object="false" label="true" ev="4"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="1" y="0" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="W8" exp="(2, 0)" type="point"/>
<element type="point" label="W8">
<show object="false" label="true" ev="4"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="2" y="0" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="T" exp="(0, 0)" type="point"/>
<element type="point" label="T">
<show object="false" label="true" ev="4"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelOffset x="-5" y="4"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="0" y="0" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="S" exp="(0, 1)" type="point"/>
<element type="point" label="S">
<show object="false" label="true" ev="4"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="0" y="1" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<element type="numeric" label="r">
<value val="0.4"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="1"/>
<slider min="-5" max="5" absoluteScreenLocation="true" width="200" x="30" y="50" fixed="false" horizontal="true" showAlgebra="true"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation speed="1" type="0" playing="false"/>
</element>
<command name="Circle">
<input a0="B1" a1="r"/>
<output a0="b1"/>
</command>
<element type="conic" label="b1">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<layer val="2"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,B1]
If[T-S==(1,0)||T-S==(0,1),Execute({"SetValue(B1,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(B1,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]

"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="0.84" A3="0" A4="1" A5="0"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="B2" a1="r"/>
<output a0="b2"/>
</command>
<element type="conic" label="b2">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<layer val="2"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,B2]
If[T-S==(1,0)||T-S==(0,1),Execute({"SetValue(B2,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(B2,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="3.84" A3="0" A4="2" A5="0"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="B3" a1="r"/>
<output a0="b3"/>
</command>
<element type="conic" label="b3">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<layer val="2"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,B3]
If[T-S==(1,0)||T-S==(0,1),Execute({"SetValue(B3,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(B3,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="4.84" A3="0" A4="2" A5="1"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="B4" a1="r"/>
<output a0="b4"/>
</command>
<element type="conic" label="b4">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<layer val="2"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,B4]
If[T-S==(1,0)||T-S==(0,1),Execute({"SetValue(B4,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(B4,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="1.8399999999999999" A3="0" A4="1" A5="1"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="B5" a1="r"/>
<output a0="b5"/>
</command>
<element type="conic" label="b5">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<layer val="2"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,B5]
If[T-S==(1,0)||T-S==(0,1),Execute({"SetValue(B5,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(B5,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="0.84" A3="0" A4="0" A5="1"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="B6" a1="r"/>
<output a0="b6"/>
</command>
<element type="conic" label="b6">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<layer val="2"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,B6]
If[T-S==(1,0)||T-S==(0,1),Execute({"SetValue(B6,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(B6,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="7.84" A3="0" A4="2" A5="2"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="B7" a1="r"/>
<output a0="b7"/>
</command>
<element type="conic" label="b7">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<layer val="2"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,B7]
If[T-S==(1,0)||T-S==(0,1),Execute({"SetValue(B7,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(B7,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="4.84" A3="0" A4="1" A5="2"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="B8" a1="r"/>
<output a0="b8"/>
</command>
<element type="conic" label="b8">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<layer val="2"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,B8]
If[T-S==(1,0)||T-S==(0,1),Execute({"SetValue(B8,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(B8,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="3.84" A3="0" A4="0" A5="2"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="W1" a1="r"/>
<output a0="w1"/>
</command>
<element type="conic" label="w1">
<show object="true" label="false" ev="4"/>
<objColor r="255" g="255" b="255" alpha="1"/>
<layer val="1"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,W1]
If[T-S==(-1,0)||T-S==(0,-1),Execute({"SetValue(W1,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(W1,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="3.84" A3="0" A4="0" A5="-2"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="W2" a1="r"/>
<output a0="w2"/>
</command>
<element type="conic" label="w2">
<show object="true" label="false" ev="4"/>
<objColor r="255" g="255" b="255" alpha="1"/>
<layer val="1"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,W2]
If[T-S==(-1,0)||T-S==(0,-1),Execute({"SetValue(W2,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(W2,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="4.84" A3="0" A4="-1" A5="-2"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="W3" a1="r"/>
<output a0="w3"/>
</command>
<element type="conic" label="w3">
<show object="true" label="false" ev="4"/>
<objColor r="255" g="255" b="255" alpha="1"/>
<layer val="1"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,W3]
If[T-S==(-1,0)||T-S==(0,-1),Execute({"SetValue(W3,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(W3,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="7.84" A3="0" A4="-2" A5="-2"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="W4" a1="r"/>
<output a0="w4"/>
</command>
<element type="conic" label="w4">
<show object="true" label="false" ev="4"/>
<objColor r="255" g="255" b="255" alpha="1"/>
<layer val="1"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,W4]
If[T-S==(-1,0)||T-S==(0,-1),Execute({"SetValue(W4,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(W4,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="0.84" A3="0" A4="0" A5="-1"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="W5" a1="r"/>
<output a0="w5"/>
</command>
<element type="conic" label="w5">
<show object="true" label="false" ev="4"/>
<objColor r="255" g="255" b="255" alpha="1"/>
<layer val="1"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,W5]
If[T-S==(-1,0)||T-S==(0,-1),Execute({"SetValue(W5,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(W5,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="1.8399999999999999" A3="0" A4="-1" A5="-1"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="W6" a1="r"/>
<output a0="w6"/>
</command>
<element type="conic" label="w6">
<show object="true" label="false" ev="4"/>
<objColor r="255" g="255" b="255" alpha="1"/>
<layer val="1"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,W6]
If[T-S==(-1,0)||T-S==(0,-1),Execute({"SetValue(W6,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(W6,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="4.84" A3="0" A4="-2" A5="-1"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="W7" a1="r"/>
<output a0="w7"/>
</command>
<element type="conic" label="w7">
<show object="true" label="false" ev="4"/>
<objColor r="255" g="255" b="255" alpha="1"/>
<layer val="1"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,W7]
If[T-S==(-1,0)||T-S==(0,-1),Execute({"SetValue(W7,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(W7,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="0.84" A3="0" A4="-1" A5="0"/>
<eqnStyle style="specific"/>
</element>
<command name="Circle">
<input a0="W8" a1="r"/>
<output a0="w8"/>
</command>
<element type="conic" label="w8">
<show object="true" label="false" ev="4"/>
<objColor r="255" g="255" b="255" alpha="1"/>
<layer val="1"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<ggbscript val="SetValue[S,W8]
If[T-S==(-1,0)||T-S==(0,-1),Execute({"SetValue(W8,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]
If[Distance(S,T)==2,Execute({"SetValue(W8,T)","SetValue(T,S)","SetValue(moves,moves+1)"})]"/>
<lineStyle thickness="1" type="0" typeHidden="1" opacity="178"/>
<eigenvectors x0="1" y0="0" z0="1.0" x1="0" y1="1" z1="1.0"/>
<matrix A0="1" A1="1" A2="3.84" A3="0" A4="-2" A5="0"/>
<eqnStyle style="specific"/>
</element>
<element type="button" label="buttonRestart">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<bgColor r="191" g="255" b="0" alpha="255"/>
<layer val="0"/>
<labelOffset x="366" y="54"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<auxiliary val="true"/>
<ggbscript val="T=(0,0)
B1=(-1,0)
B2=(-2,0)
B3=(-2,-1)
B4=(-1,-1)
B5=(0,-1)
B6=(-2,-2)
B7=(-1,-2)
B8=(0,-2)
W1=(0,2)
W2=(1,2)
W3=(2,2)
W4=(0,1)
W5=(1,1)
W6=(2,1)
W7=(1,0)
W8=(2,0)
SetValue(moves,0)
"/>
<font serif="false" sizeM="2" size="16" style="1"/>
<dimensions width="120" height="50" />
<startPoint x="0.5" y="3.5" z="1"/>
<caption val="Restart"/>
</element>
<expression label="B9" exp="(0, -2)" type="point"/>
<element type="point" label="B9">
<show object="true" label="true"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<auxiliary val="true"/>
<coords x="NaN" y="NaN" z="NaN"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<command name="Sort">
<input a0="{(0, 2), (1, 2), (2, 2), (0, 1), (1, 1), (2, 1), (1, 0), (2, 0), (0, 0)}"/>
<output a0="success"/>
</command>
<element type="list" label="success">
<show object="false" label="false" ev="4"/>
<objColor r="0" g="100" b="0" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
<angleStyle val="0"/>
</element>
<command name="Sort">
<input a0="{B1, B2, B3, B4, B5, B6, B7, B8, T}"/>
<output a0="black"/>
</command>
<element type="list" label="black">
<show object="false" label="false" ev="4"/>
<objColor r="0" g="100" b="0" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<ggbscript onUpdate="If[black==success,SetValue(showDone,true),SetValue(showDone,false)]"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
<angleStyle val="0"/>
</element>
<expression label="text1" exp="" 恭喜成功了,
 您真是厲害!
Congratulations!
You are Genius!""/>
<element type="text" label="text1">
<show object="true" label="false" ev="40"/>
<condition showObject="showDone"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<bgColor r="255" g="0" b="0" alpha="255"/>
<layer val="6"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<font serif="false" sizeM="4" size="48" style="1"/>
<startPoint x="-2.2" y="1" z="1"/>
<ggbscript val="showDone=false"/>
</element>
<expression label="boardGrid" exp="{Sequence[Segment[(-3.5 + k, -2.5), (-3.5 + k, 0.5)], k, 1, 4], Sequence[Segment[(-1.5 + k, -0.5), (-1.5 + k, 2.5)], k, 1, 4], Sequence[Segment[(-2.5, -3.5 + k), (0.5, -3.5 + k)], k, 1, 4], Sequence[Segment[(-0.5, -1.5 + k), (2.5, -1.5 + k)], k, 1, 4]}" />
<element type="list" label="boardGrid">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="1"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<selectionAllowed val="false"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
<angleStyle val="0"/>
</element>
<expression label="board" exp="{Polygon[(-2.5, -2.5), (0.5, -2.5), (0.5, -0.5), (2.5, -0.5), (2.5, 2.5), (-0.5, 2.5), (-0.5, 0.5), (-2.5, 0.5)]}" />
<element type="list" label="board">
<show object="true" label="false" ev="4"/>
<objColor r="0" g="255" b="0" alpha="1"/>
<layer val="0"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<selectionAllowed val="false"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
<angleStyle val="0"/>
</element>
<command name="Polygon">
<input a0="{Corner[1], Corner[2], Corner[3], Corner[4]}"/>
<output a0="polyMask"/>
</command>
<element type="polygon" label="polyMask">
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<show object="false" label="false" ev="4"/>
<condition showObject="showRule"/>
<objColor r="64" g="64" b="64" alpha="0.9599999785423279"/>
<layer val="8"/>
<labelMode val="0"/>
<ggbscript val="showRule=false"/>
</element>
<expression label="textRule" exp=""移動規則
1. 當旁邊有空位時,黑棋只能向上或向右移動
2. 當旁邊有空位時,白棋只能向下或向左移動
3. 棋子也可以跳過其他鄰接的棋子移動




Rules to move
1. The BLACK marble can be moved UP or RIGHT 
 to an adjacent open space
2. The WHITE marble can be moved DOWN or LEFT 
 to an adjacent open space
3. The marble may jump over other marbles that are 
 right next to the marble.""/>
<element type="text" label="textRule">
<show object="false" label="false" ev="40"/>
<condition showObject="showRule"/>
<objColor r="255" g="255" b="0" alpha="0"/>
<layer val="8"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<selectionAllowed val="false"/>
<font serif="false" sizeM="1.4" size="7" style="1"/>
<startPoint x="-2.5" y="1" z="1"/>
</element>
<expression label="textTarget" exp=""遊戲目標:將所有黑棋與白棋對調
Target: To swap all black and white marbles""/>
<element type="text" label="textTarget">
<show object="false" label="false" ev="40"/>
<condition showObject="showRule"/>
<objColor r="255" g="255" b="0" alpha="0"/>
<layer val="8"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<selectionAllowed val="false"/>
<font serif="false" sizeM="1.4" size="7" style="1"/>
<startPoint x="-2.5" y="3" z="1"/>
</element>
<element type="boolean" label="showRule">
<value val="false"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<checkbox fixed="true"/>
</element>
<element type="button" label="buttonRule">
<show object="true" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<bgColor r="208" g="240" b="192" alpha="255"/>
<layer val="8"/>
<labelOffset x="540" y="54"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<fixed val="true"/>
<auxiliary val="true"/>
<ggbscript val="showRule=!showRule"/>
<font serif="false" sizeM="2" size="16" style="1"/>
<dimensions width="120" height="50" />
<startPoint x="1.7" y="3.5" z="1"/>
<caption val="Rule"/>
</element>
<element type="point" label="A">
<show object="false" label="false" ev="4"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="8"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-1.5" y="1" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<element type="point" label="B">
<show object="false" label="false"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="8"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="1.1656693149146935" y="1" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<element type="image" label="picTarget">
<file name="da9e8b3032a57be918d05b00719fb588/transferImage.png"/>
<inBackground val="false"/>
<startPoint number="0" x="-2" y="1.2" z="1"/>
<startPoint number="1" x="1.5" y="1.2" z="1"/>
<show object="true" label="false"/>
<condition showObject="showRule"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<layer val="9"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<animation step="1" speed="1" type="0" playing="false"/>
<selectionAllowed val="false"/>
</element>
<element type="point" label="C">
<show object="false" label="false" ev="4"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="8"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-3" y="-1.5" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<element type="point" label="D">
<show object="false" label="false" ev="4"/>
<objColor r="77" g="77" b="255" alpha="0"/>
<layer val="8"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="0.5" y="-1.5" z="1"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<element type="image" label="picRule">
<file name="b5053b96c2c8328c500fba0c7db3f4b9/transferImage.png"/>
<inBackground val="false"/>
<startPoint number="0" x="-2" y="-1" z="1"/>
<startPoint number="1" x="1.5" y="-1" z="1"/>
<show object="true" label="false"/>
<condition showObject="showRule"/>
<objColor r="0" g="0" b="0" alpha="1"/>
<layer val="9"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<animation step="1" speed="1" type="0" playing="false"/>
<selectionAllowed val="false"/>
</element>
<element type="boolean" label="showDone">
<value val="false"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="0"/>
<labelMode val="0"/>
<checkbox fixed="true"/>
</element>
<element type="numeric" label="moves">
<value val="0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="3"/>
<labelMode val="1"/>
<animation speed="1" type="0" playing="false"/>
</element>
<command name="LaTeX">
<input a0="moves" a1="true" a2="true"/>
<output a0="textMoves"/>
</command>
<element type="text" label="textMoves">
<show object="true" label="false" ev="8"/>
<objColor r="0" g="0" b="0" alpha="0"/>
<layer val="3"/>
<labelMode val="0"/>
<tooltipMode val="2"/>
<selectionAllowed val="false"/>
<isLaTeX val="true"/>
<font serif="false" sizeM="3" size="32" style="1"/>
<startPoint x="-2.5" y="3.5" z="1"/>
</element>
</construction>
</geogebra>