diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2018-08-20 20:34:57 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2018-08-20 20:34:57 -0400 |
commit | a4460f6d9453bbd7e584937686449cef3e19f052 (patch) | |
tree | 037c208f1e20302ed048c0952ef8e3418add9c86 /assets |
Initial commit0.0.0
Diffstat (limited to 'assets')
26 files changed, 671 insertions, 0 deletions
diff --git a/assets/fonts/DejaVuSans-ExtraLight.ttf b/assets/fonts/DejaVuSans-ExtraLight.ttf Binary files differnew file mode 100644 index 0000000..036d7af --- /dev/null +++ b/assets/fonts/DejaVuSans-ExtraLight.ttf diff --git a/assets/levels/connectedness/3x3.xml b/assets/levels/connectedness/3x3.xml new file mode 100644 index 0000000..ef712cc --- /dev/null +++ b/assets/levels/connectedness/3x3.xml @@ -0,0 +1,33 @@ +<level title="Create a connected graph" description="You can only use two of each edge color." objective="Make this graph connected."/> +<global-vertex-protections protect="ad"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> + <color color="#FFFF00" name="yellow"/> +</colors> +<graph> + <vertex x="300" y="300"/> + <vertex x="400" y="300"/> + <vertex x="500" y="300"/> + <vertex x="300" y="400"/> + <vertex x="400" y="400" origin="t"/> + <vertex x="500" y="400"/> + <vertex x="300" y="500"/> + <vertex x="400" y="500"/> + <vertex x="500" y="500"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> + <edge-rule v1="same" edge="same"/> + <edge-maximum color="yellow" max="2"/> + <edge-maximum color="blue" max="2"/> + <edge-maximum color="green" max="2"/> + <edge-maximum color="red" max="2"/> + <connected/> +</rules> +<values> + <var id="points" val="20"/> + <var id="objective" val="20"/> +</values> + diff --git a/assets/levels/connectedness/connect.xml b/assets/levels/connectedness/connect.xml new file mode 100644 index 0000000..c1b2094 --- /dev/null +++ b/assets/levels/connectedness/connect.xml @@ -0,0 +1,30 @@ +<level title="Connect this graph" description="Use as few edges as possible while following the rules." objective="Make this graph connected."/> +<global-vertex-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> + <vertex x="300" y="300" color="red" origin="t"/> + <vertex x="400" y="300" color="red"/> + <vertex x="500" y="300" color="red"/> + <vertex x="300" y="400" color="green"/> + <vertex x="400" y="400" color="green"/> + <vertex x="500" y="400" color="green"/> + <vertex x="300" y="500" color="blue"/> + <vertex x="400" y="500" color="blue"/> + <vertex x="500" y="500" color="blue"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> + <edge-rule v1="same" edge="same"/> + <edge-maximum color="blue" max="1"/> + <edge-maximum color="green" max="2"/> + <connected/> +</rules> +<values> + + <op id="points" val1="28" op="-" val2="E"/> + <var id="objective" val="20"/> +</values> diff --git a/assets/levels/connectedness/connectedness.xml b/assets/levels/connectedness/connectedness.xml new file mode 100644 index 0000000..535938e --- /dev/null +++ b/assets/levels/connectedness/connectedness.xml @@ -0,0 +1,17 @@ +<level title="Connectedness" description="A graph is connected if there is a path between any two vertices.;Filled in vertices are vertices which are connected to the origin vertex." objective="Make this graph connected."/> +<global-vertex-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> +</colors> +<graph> + <vertex x="300" y="400" color="red" origin="t"/> + <vertex x="400" y="550" color="red"/> + <vertex x="500" y="400" color="red"/> +</graph> +<rules> + <connected/> +</rules> +<values> + <var id="points" val="5"/> + <var id="objective" val="5"/> +</values> diff --git a/assets/levels/connectedness/multiple-components.xml b/assets/levels/connectedness/multiple-components.xml new file mode 100644 index 0000000..b313bc4 --- /dev/null +++ b/assets/levels/connectedness/multiple-components.xml @@ -0,0 +1,41 @@ +<level title="Connect this graph" description="Use as few edges as possible." objective="Make this graph connected."/> +<global-vertex-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> + <color color="#FFFF00" name="yellow"/> + <color color="#FF00FF" name="magenta"/> +</colors> +<graph> + <vertex x="250" y="300" color="red" origin="t"/> + <vertex x="350" y="300" color="red"/> + <vertex x="450" y="300" color="red"/> + <vertex x="550" y="300" color="red"/> + <vertex x="250" y="400" color="green"/> + <vertex x="350" y="400" color="green"/> + <vertex x="450" y="400" color="green"/> + <vertex x="550" y="400" color="green"/> + <vertex x="250" y="500" color="blue"/> + <vertex x="350" y="500" color="blue"/> + <vertex x="450" y="500" color="blue"/> + <vertex x="550" y="500" color="blue"/> + <vertex x="250" y="600" color="yellow"/> + <vertex x="350" y="600" color="yellow"/> + <vertex x="450" y="600" color="yellow"/> + <vertex x="550" y="600" color="yellow"/> + <vertex x="650" y="600" color="magenta"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> + <edge-rule v1="red" v2="blue"/> + <edge-rule v1="red" v2="yellow"/> + <edge-rule v1="green" v2="blue"/> + <edge-rule v1="green" v2="yellow"/> + <connected/> +</rules> +<values> + + <op id="points" val1="26" op="-" val2="E"/> + <var id="objective" val="10"/> +</values> diff --git a/assets/levels/connectedness/negative-points.xml b/assets/levels/connectedness/negative-points.xml new file mode 100644 index 0000000..a80ba35 --- /dev/null +++ b/assets/levels/connectedness/negative-points.xml @@ -0,0 +1,34 @@ +<level title="Connect this graph" description="Every edge color subtracts some number of points." objective="Make this graph connected."/> +<global-vertex-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red" edge-points="-4"/> + <color color="#00FF00" name="green" edge-points="-3"/> + <color color="#0000FF" name="blue" edge-points="-2"/> + <color color="#FFFF00" name="yellow" edge-points="-1"/> +</colors> +<graph> + <vertex x="250" y="250" color="red" origin="t"/> + <vertex x="250" y="350" color="red"/> + <vertex x="250" y="450" color="red"/> + <vertex x="250" y="550" color="red"/> + <vertex x="350" y="300" color="green"/> + <vertex x="350" y="400" color="green"/> + <vertex x="350" y="500" color="green"/> + <vertex x="450" y="350" color="blue"/> + <vertex x="450" y="450" color="blue"/> + <vertex x="550" y="400" color="yellow"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> + <edge-rule v1="same" edge="same"/> + <edge-maximum color="yellow" max="1"/> + <edge-maximum color="blue" max="2"/> + <edge-maximum color="green" max="3"/> + <edge-maximum color="red" max="4"/> + <connected/> +</rules> +<values> + <var id="points" val="46"/> + <var id="objective" val="20"/> +</values> + diff --git a/assets/levels/edge-coloring/coloring-edges.xml b/assets/levels/edge-coloring/coloring-edges.xml new file mode 100644 index 0000000..2b18687 --- /dev/null +++ b/assets/levels/edge-coloring/coloring-edges.xml @@ -0,0 +1,19 @@ +<level title="Coloring Edges" description="Click on an edge to color it." objective="Change the color of the edge."/> +<global-vertex-protections protect="ad"/> +<global-edge-protections protect="ad"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> + <vertex x="300" y="300" id="v1" color="red"/> + <vertex x="400" y="400" id="v2" color="red"/> + <edge v1="v1" v2="v2" id="e" color="red"/> +</graph> +<values> + <op op="edge-color" id="e_color" val1="e"/> + <op op="!=" id="is_changed" val1="e_color" val2="red"/> + <op op="*" id="points" val1="is_changed" val2="5"/> + <var id="objective" val="5"/> +</values> diff --git a/assets/levels/edge-coloring/create-edges.xml b/assets/levels/edge-coloring/create-edges.xml new file mode 100644 index 0000000..0e264bd --- /dev/null +++ b/assets/levels/edge-coloring/create-edges.xml @@ -0,0 +1,33 @@ +<level title="Create Edges" description="Press P to see how many points you get for each edge/vertex." objective="Earn as many points as possible."/> +<global-vertex-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red" edge-points="2"/> + <color color="#00FF00" name="green" edge-points="3"/> + <color color="#0000FF" name="blue" edge-points="1"/> + <color color="#FFFF00" name="yellow" edge-points="5"/> +</colors> +<graph> + <vertex x="250" y="250" color="red"/> + <vertex x="400" y="250" color="red"/> + <vertex x="550" y="250" color="green"/> + <vertex x="250" y="400" color="blue"/> + <vertex x="400" y="400" color="blue"/> + <vertex x="550" y="400" color="green"/> + <vertex x="250" y="550" color="yellow"/> + <vertex x="400" y="550" color="yellow"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> + <edge-rule v1="same" edge="same"/> + <edge-rule v1="red" v2="yellow"/> + <edge-rule v1="blue" edge="yellow"/> + <edge-rule v1="blue" v2="yellow"/> + <edge-rule v1="blue" v2="green"/> + + <edge-maximum max="2" color="same"/> + +</rules> +<values> + <var id="points" val="E"/> + <var id="objective" val="26"/> +</values> diff --git a/assets/levels/edge-coloring/create-graph.xml b/assets/levels/edge-coloring/create-graph.xml new file mode 100644 index 0000000..2922843 --- /dev/null +++ b/assets/levels/edge-coloring/create-graph.xml @@ -0,0 +1,17 @@ +<level title="Create a graph" description="Press P to see how many points you get for each edge/vertex." objective="Earn as many points as possible."/> +<colors> + <color color="#FF0000" name="red" edge-points="2" vertex-points="-1"/> + <color color="#00FF00" name="green" edge-points="3" vertex-points="-2"/> + <color color="#0000FF" name="blue" edge-points="1" vertex-points="-3"/> +</colors> +<graph></graph> +<rules> + <edge-rule v1="same" v2="same"/> + <edge-rule v1="same" edge="same"/> + <edge-maximum max="4" color="same"/> + +</rules> +<values> + <var id="points" val="E"/> + <var id="objective" val="24"/> +</values> diff --git a/assets/levels/edge-coloring/edge-rules.xml b/assets/levels/edge-coloring/edge-rules.xml new file mode 100644 index 0000000..8864c99 --- /dev/null +++ b/assets/levels/edge-coloring/edge-rules.xml @@ -0,0 +1,20 @@ +<level title="Edge Rules" description="There are now rules about which color edges can be." objective="Create as many edges as possible"/> +<global-vertex-protections protect="ad"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> + <vertex x="300" y="300" color="red"/> + <vertex x="500" y="300" color="red"/> + <vertex x="300" y="500" color="blue"/> + <vertex x="500" y="500" color="blue"/> +</graph> +<rules> + <edge-rule v1="same" edge="same" v2="same"/> + <edge-rule v1="red" edge="red" v2="blue"/> +</rules> +<values> + <var id="points" val="E"/> + <var id="objective" val="6"/> +</values> diff --git a/assets/levels/edge-coloring/three-of-each.xml b/assets/levels/edge-coloring/three-of-each.xml new file mode 100644 index 0000000..5def5c2 --- /dev/null +++ b/assets/levels/edge-coloring/three-of-each.xml @@ -0,0 +1,25 @@ +<level title="Create nine edges" description="Press R to see the rules. A white edge or vertex means one of any color." objective="Create three edges of each color"/> +<global-vertex-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> + <vertex x="300" y="350" color="red"/> + <vertex x="400" y="300" color="green"/> + <vertex x="500" y="350" color="blue"/> + + <vertex x="300" y="500" color="red"/> + <vertex x="400" y="550" color="green"/> + <vertex x="500" y="500" color="blue"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> + <edge-rule v1="same" edge="same"/> + <edge-maximum color="same" max="3"/> +</rules> +<values> + <var id="points" val="E"/> + <var id="objective" val="9"/> +</values> diff --git a/assets/levels/editor/graph-editor.xml b/assets/levels/editor/graph-editor.xml new file mode 100644 index 0000000..f4cfbeb --- /dev/null +++ b/assets/levels/editor/graph-editor.xml @@ -0,0 +1,17 @@ +<level title="Graph Editor" description="Create any graph you want."/> +<colors> + <color color="#FFFFFF" name="white"/> + <color color="#666666" name="gray"/> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> + <color color="#FFFF00" name="yellow"/> + <color color="#FF00FF" name="magenta"/> + <color color="#00FFFF" name="cyan"/> +</colors> +<graph /> +<rules /> +<values> + <var id="points" val="0"/> + <var id="objective" val="1"/> +</values> diff --git a/assets/levels/eulerian/add-edges-cycle.xml b/assets/levels/eulerian/add-edges-cycle.xml new file mode 100644 index 0000000..8a8c120 --- /dev/null +++ b/assets/levels/eulerian/add-edges-cycle.xml @@ -0,0 +1,25 @@ +<level title="Maximal Eulerian Cycle" description="Add as many edges as possible while still having an Eulerian cycle" objective="+1 point per edge, +3 points per edge in cycle"/> +<global-vertex-protections protect="acd"/> +<global-edge-protections protect="c"/> +<colors> + <color color="#FF0000" name="red"/> +</colors> +<graph> + <vertex x="200" y="450" id="l"/> + <vertex x="300" y="400" id="top-l"/> + <vertex x="400" y="350" id="top-m"/> + <vertex x="500" y="400" id="top-r"/> + <vertex x="300" y="500" id="bot-l"/> + <vertex x="400" y="550" id="bot-m"/> + <vertex x="500" y="500" id="bot-r"/> + <vertex x="600" y="450" id="r"/> +</graph> +<rules/> +<cycle points="0"> + <edge color="any" op="+" val="3"/> +</cycle> +<values> + <op id="points" op="-" val1="E" val2="20"/> + <var id="objective" val="44"/> +</values> + diff --git a/assets/levels/eulerian/add-edges-path.xml b/assets/levels/eulerian/add-edges-path.xml new file mode 100644 index 0000000..937e3b6 --- /dev/null +++ b/assets/levels/eulerian/add-edges-path.xml @@ -0,0 +1,28 @@ +<level title="Maximal Eulerian Path" description="Add as many edges as possible while still having an Eulerian path.;No two adjacent vertices can have the same color." objective="+1 point per edge, +3 points per edge in path"/> +<global-vertex-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> + <vertex x="200" y="450" id="l" color="red"/> + <vertex x="300" y="400" id="top-l" color="red"/> + <vertex x="400" y="350" id="top-m" color="green"/> + <vertex x="500" y="400" id="top-r" color="blue"/> + <vertex x="300" y="500" id="bot-l" color="red"/> + <vertex x="400" y="550" id="bot-m" color="green"/> + <vertex x="500" y="500" id="bot-r" color="blue"/> + <vertex x="600" y="450" id="r" color="blue"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> +</rules> +<path points="0"> + <edge color="any" op="+" val="3"/> +</path> +<values> + <op id="points" op="-" val1="E" val2="20"/> + <var id="objective" val="56"/> +</values> + diff --git a/assets/levels/eulerian/cycles.xml b/assets/levels/eulerian/cycles.xml new file mode 100644 index 0000000..1b36652 --- /dev/null +++ b/assets/levels/eulerian/cycles.xml @@ -0,0 +1,38 @@ +<level title="Eulerian Cycles" description="Every graph where all the vertices have an even degree has an Eulerian cycle.;An Eulerian cycle is a cycle through the graph that goes through each edge exactly once.;Right-click vertices in the order of an Eulerian cycle.;Press E to cancel your cycle." objective="Find an Eulerian cycle."/> +<global-vertex-protections protect="acd"/> +<global-edge-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> +</colors> +<graph> + <vertex x="300" y="400" id="top-l"/> + <vertex x="400" y="350" id="top-m"/> + <vertex x="500" y="400" id="top-r"/> + <vertex x="300" y="500" id="bot-l"/> + <vertex x="400" y="550" id="bot-m"/> + <vertex x="500" y="500" id="bot-r"/> + + <edge v1="top-l" v2="top-r"/> + <edge v1="top-l" v2="bot-l"/> + <edge v1="top-l" v2="bot-m"/> + <edge v1="top-l" v2="bot-r"/> + + <edge v1="top-m" v2="bot-l"/> + <edge v1="top-m" v2="bot-r"/> + + <edge v1="top-r" v2="bot-l"/> + <edge v1="top-r" v2="bot-m"/> + <edge v1="top-r" v2="bot-r"/> + + + <edge v1="bot-l" v2="bot-r"/> +</graph> +<rules/> +<cycle points="0"> + <edge color="any" op="+" val="1"/> +</cycle> +<values> + <var id="points" val="0"/> + <var id="objective" val="E"/> +</values> + diff --git a/assets/levels/eulerian/double-add-one.xml b/assets/levels/eulerian/double-add-one.xml new file mode 100644 index 0000000..b25b71b --- /dev/null +++ b/assets/levels/eulerian/double-add-one.xml @@ -0,0 +1,41 @@ +<level title="Best Path" description="Find a path through the graph (it does not have to be Eulerian).;Every time it passes through a red edge, your score will increase by 1.;Every time it passes through a blue edge, your score will double." objective="Earn as many points as possible."/> +<global-vertex-protections protect="acd"/> +<global-edge-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> + <vertex x="200" y="450" id="l"/> + <vertex x="300" y="400" id="top-l"/> + <vertex x="400" y="350" id="top-m"/> + <vertex x="500" y="400" id="top-r"/> + <vertex x="300" y="500" id="bot-l"/> + <vertex x="400" y="550" id="bot-m"/> + <vertex x="500" y="500" id="bot-r"/> + <vertex x="600" y="450" id="r"/> + + <edge v1="l" v2="top-l" color="red"/> + <edge v1="top-l" v2="top-m" color="red"/> + <edge v1="top-m" v2="top-r" color="red"/> + <edge v1="top-r" v2="r" color="red"/> + <edge v1="r" v2="bot-r" color="red"/> + <edge v1="bot-r" v2="bot-m" color="red"/> + <edge v1="bot-m" v2="bot-l" color="red"/> + <edge v1="bot-l" v2="l" color="red"/> + + + <edge v1="l" v2="r" color="blue"/> + <edge v1="top-l" v2="bot-l" color="blue"/> + <edge v1="top-m" v2="bot-m" color="blue"/> + <edge v1="top-r" v2="bot-r" color="blue"/> +</graph> +<path points="0"> + <edge color="red" op="+" val="1"/> + <edge color="blue" op="*" val="2"/> +</path> +<values> + <var id="points" val="0"/> + <var id="objective" val="46"/> +</values> + diff --git a/assets/levels/eulerian/paths.xml b/assets/levels/eulerian/paths.xml new file mode 100644 index 0000000..c3fa8b7 --- /dev/null +++ b/assets/levels/eulerian/paths.xml @@ -0,0 +1,37 @@ +<level title="Eulerian Paths" description="Every graph where all the vertices except for 2 have an even;degree has an Eulerian path.;An Eulerian path is a path through the graph that goes through each edge exactly once.;Paths do not have to start and end in the same place" objective="Find an Eulerian path in this graph."/> +<global-vertex-protections protect="acd"/> +<global-edge-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> +</colors> +<graph> + <vertex x="300" y="400" id="top-l"/> + <vertex x="400" y="350" id="top-m"/> + <vertex x="500" y="400" id="top-r"/> + <vertex x="300" y="500" id="bot-l"/> + <vertex x="400" y="550" id="bot-m"/> + <vertex x="500" y="500" id="bot-r"/> + + <edge v1="top-l" v2="bot-l"/> + <edge v1="top-l" v2="bot-m"/> + <edge v1="top-l" v2="bot-r"/> + + <edge v1="top-m" v2="bot-l"/> + <edge v1="top-m" v2="bot-r"/> + + <edge v1="top-r" v2="bot-l"/> + <edge v1="top-r" v2="bot-m"/> + <edge v1="top-r" v2="bot-r"/> + + + <edge v1="bot-l" v2="bot-r"/> +</graph> +<rules/> +<path points="0"> + <edge color="any" op="+" val="1"/> +</path> +<values> + <var id="points" val="0"/> + <var id="objective" val="E"/> +</values> + diff --git a/assets/levels/intro/degrees.xml b/assets/levels/intro/degrees.xml new file mode 100644 index 0000000..4e1484e --- /dev/null +++ b/assets/levels/intro/degrees.xml @@ -0,0 +1,13 @@ +<level title="Degrees" description="A vertex's degree is the number of edges which connect to it." objective="Give the vertex a degree of 5."/> +<global-vertex-protections protect="d"/> +<colors> + <color color="#FF0000" name="red"/> +</colors> +<graph> + <vertex x="300" y="300" id="v"/> +</graph> +<values> + <op op="degree" id="d" val1="v"/> + <op op="min" id="points" val1="d" val2="5"/> + <var id="objective" val="5"/> +</values> diff --git a/assets/levels/intro/edges.xml b/assets/levels/intro/edges.xml new file mode 100644 index 0000000..ecbf0ed --- /dev/null +++ b/assets/levels/intro/edges.xml @@ -0,0 +1,14 @@ +<level title="Edges" description="Press E to start or end an edge while hovering over a vertex." objective="Connect the two vertices."/> +<global-vertex-protections protect="ad"/> +<colors> + <color color="#FF0000" name="red"/> +</colors> +<graph> + <vertex x="300" y="300" id="v1"/> + <vertex x="400" y="400" id="v2"/> +</graph> +<values> + <op op="connected" id="is_connected" val1="v1" val2="v2"/> + <op op="*" id="points" val1="is_connected" val2="5"/> + <var id="objective" val="5"/> +</values> diff --git a/assets/levels/intro/vertices.xml b/assets/levels/intro/vertices.xml new file mode 100644 index 0000000..c83b018 --- /dev/null +++ b/assets/levels/intro/vertices.xml @@ -0,0 +1,11 @@ +<level title="Vertices" description="Press v to make a vertex (and press x to delete it)." objective="Create four more vertices."/> +<colors> + <color color="#FF0000" name="red"/> +</colors> +<graph> + <vertex x="300" y="300" id="v1"/> +</graph> +<values> + <op op="min" id="points" val1="V" val2="5"/> + <var id="objective" val="5"/> +</values> diff --git a/assets/levels/level-list.xml b/assets/levels/level-list.xml new file mode 100644 index 0000000..9875e95 --- /dev/null +++ b/assets/levels/level-list.xml @@ -0,0 +1,39 @@ +<?xml version="1.0"?> +<category-listing version="0.0.0"> + <category name="Introduction to Graphs" id="intro" color="#AAAAAA"> + <level id="vertices"/> + <level id="edges"/> + <level id="degrees"/> + </category> + <category name="Vertex Colorings" id="vertex-coloring" color="#DD0000"> + <level id="colors"/> + <level id="vertex-coloring"/> + <level id="more-rules"/> + <level id="max-edges"/> + <level id="maximum"/> + </category> + <category name="Edge Colorings" id="edge-coloring" color="#00DD00"> + <level id="coloring-edges"/> + <level id="edge-rules"/> + <level id="three-of-each"/> + <level id="create-edges"/> + <level id="create-graph"/> + </category> + <category name="Connectedness" id="connectedness" color="#DD44DD"> + <level id="connectedness"/> + <level id="connect"/> + <level id="multiple-components"/> + <level id="negative-points"/> + <level id="3x3"/> + </category> + <category name="Eulerian Cycles & Paths" id="eulerian" color="#DDDD00"> + <level id="cycles"/> + <level id="add-edges-cycle"/> + <level id="paths"/> + <level id="add-edges-path"/> + <level id="double-add-one"/> + </category> + <category name="Graph Editor" id="editor" color="#DDDDDD"> + <level id="graph-editor"/> + </category> +</category-listing> diff --git a/assets/levels/vertex-coloring/colors.xml b/assets/levels/vertex-coloring/colors.xml new file mode 100644 index 0000000..7139d18 --- /dev/null +++ b/assets/levels/vertex-coloring/colors.xml @@ -0,0 +1,16 @@ +<level title="Coloring" description="Click on a vertex to color it." objective="Change the color of the vertex."/> +<global-vertex-protections protect="ad"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> + <vertex x="300" y="300" id="v" color="red"/> +</graph> +<values> + <op op="vertex-color" id="v_color" val1="v"/> + <op op="!=" id="is_changed" val1="v_color" val2="red"/> + <op op="*" id="points" val1="is_changed" val2="5"/> + <var id="objective" val="5"/> +</values> diff --git a/assets/levels/vertex-coloring/max-edges.xml b/assets/levels/vertex-coloring/max-edges.xml new file mode 100644 index 0000000..1d6151a --- /dev/null +++ b/assets/levels/vertex-coloring/max-edges.xml @@ -0,0 +1,30 @@ +<level title="Create Edges" description="You will receive one point per edge and one point per red vertex." objective="Earn as many points as possible."/> +<global-vertex-protections protect="ad"/> +<colors> + <color color="#FF0000" name="red" vertex-points="1"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> + <color color="#FFFF00" name="yellow"/> +</colors> +<graph> + <vertex x="250" y="250"/> + <vertex x="400" y="250"/> + <vertex x="550" y="250"/> + <vertex x="250" y="400"/> + <vertex x="400" y="400"/> + <vertex x="550" y="400"/> + <vertex x="250" y="550"/> + <vertex x="400" y="550"/> + <vertex x="550" y="550"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> + + <edge-rule v1="red" v2="green"/> + <edge-rule v1="red" v2="blue"/> + <edge-rule v1="yellow" v2="blue"/> +</rules> +<values> + <var id="points" val="E"/> + <var id="objective" val="25"/> +</values> diff --git a/assets/levels/vertex-coloring/maximum.xml b/assets/levels/vertex-coloring/maximum.xml new file mode 100644 index 0000000..6f20cf0 --- /dev/null +++ b/assets/levels/vertex-coloring/maximum.xml @@ -0,0 +1,19 @@ +<level title="Highest E-V" description="There is now a limit to the number of vertices you can have of each color." objective="+1 point per edge, -1 point per vertex"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> + <edge-rule v1="red" v2="green"/> + <vertex-maximum color="red" max="5"/> + <vertex-maximum color="green" max="3"/> + <vertex-maximum color="blue" max="2"/> +</rules> +<values> + <op op="-" id="points" val1="E" val2="V"/> + <var id="objective" val="6"/> +</values> diff --git a/assets/levels/vertex-coloring/more-rules.xml b/assets/levels/vertex-coloring/more-rules.xml new file mode 100644 index 0000000..805d09d --- /dev/null +++ b/assets/levels/vertex-coloring/more-rules.xml @@ -0,0 +1,45 @@ +<level title="Vertex Colorings" description="Press R to see which colors can connect to which. Use at least one vertex of each color." objective="Color the graph so that it follows the rules."/> +<global-vertex-protections protect="ad"/> +<global-edge-protections protect="ad"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> + <color color="#FFFF00" name="yellow"/> +</colors> +<graph> + <vertex x="250" y="250" id="top1"/> + <vertex x="350" y="320" id="top2"/> + <vertex x="450" y="320" id="top3"/> + <vertex x="550" y="250" id="top4"/> + <vertex x="300" y="400" id="mid1"/> + <vertex x="500" y="400" id="mid2"/> + <vertex x="550" y="500" id="bot1"/> + + <edge v1="top1" v2="top2"/> + <edge v1="top2" v2="top3"/> + <edge v1="top3" v2="top4"/> + <edge v1="top1" v2="top4"/> + + <edge v1="mid1" v2="mid2"/> + + <edge v1="top1" v2="mid1"/> + <edge v1="top2" v2="mid1"/> + <edge v1="top3" v2="mid2"/> + <edge v1="top4" v2="mid2"/> + + <edge v1="top4" v2="bot1"/> + <edge v1="mid1" v2="bot1"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> + + <edge-rule v1="red" v2="green"/> + <edge-rule v1="red" v2="blue"/> + + <vertex-minimum color="same" min="1"/> +</rules> +<values> + <var id="points" val="15"/> + <var id="objective" val="15"/> +</values> diff --git a/assets/levels/vertex-coloring/vertex-coloring.xml b/assets/levels/vertex-coloring/vertex-coloring.xml new file mode 100644 index 0000000..7cb6cf4 --- /dev/null +++ b/assets/levels/vertex-coloring/vertex-coloring.xml @@ -0,0 +1,29 @@ +<level title="Vertex Colorings" description="A vertex coloring is a coloring where no two vertices of the same color are connected." objective="Find a vertex coloring of this graph."/> +<global-vertex-protections protect="ad"/> +<global-edge-protections protect="ad"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> + <vertex x="400" y="280" id="top"/> + <vertex x="300" y="380" id="top-l"/> + <vertex x="500" y="380" id="top-r"/> + <vertex x="300" y="530" id="bot-l"/> + <vertex x="500" y="530" id="bot-r"/> + <edge v1="top" v2="top-l"/> + <edge v1="top" v2="top-r"/> + <edge v1="top-l" v2="top-r"/> + <edge v1="top-l" v2="bot-l"/> + <edge v1="top-l" v2="bot-r"/> + <edge v1="top-r" v2="bot-r"/> + <edge v1="bot-l" v2="bot-r"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> +</rules> +<values> + <var id="points" val="10"/> + <var id="objective" val="10"/> +</values> |