[gbrainy] Lever logic puzzle



commit cdf3a47b6a83145385d7d46a4d722a5066cad335
Author: Jordi Mas <jmas softcatala org>
Date:   Thu Sep 30 00:31:14 2010 +0200

    Lever logic puzzle

 data/Makefile.am             |    3 +-
 data/game-graphics/lever.svg |  103 ++++++++++++++++++++++++++++++++++++++++++
 data/games.xml               |   50 ++++++++++++++++++++
 3 files changed, 155 insertions(+), 1 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 1afa1da..be94a47 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -52,7 +52,8 @@ analogies_DATA = \
 	game-graphics/money.svg \
 	game-graphics/box.svg \
 	game-graphics/dartboard.svg \
-	game-graphics/horses_men.svg
+	game-graphics/horses_men.svg \
+	game-graphics/lever.svg
 	
 
 install-data-local:
diff --git a/data/game-graphics/lever.svg b/data/game-graphics/lever.svg
new file mode 100644
index 0000000..2b4ce66
--- /dev/null
+++ b/data/game-graphics/lever.svg
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   version="1.0"
+   width="500"
+   height="500"
+   id="svg1388"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="lever.svg">
+  <metadata
+     id="metadata18">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs16">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 250 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="500 : 250 : 1"
+       inkscape:persp3d-origin="250 : 166.66667 : 1"
+       id="perspective20" />
+  </defs>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1152"
+     inkscape:window-height="694"
+     id="namedview14"
+     showgrid="false"
+     inkscape:zoom="0.944"
+     inkscape:cx="200.47112"
+     inkscape:cy="307.62567"
+     inkscape:window-x="0"
+     inkscape:window-y="52"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg1388" />
+  <path
+     id="path1307"
+     style="fill:#c9c9c9;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.00000501;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;filter:url(#filter2923)"
+     d="m 248.61279,232.47533 42.34157,73.33775 -84.68314,0 42.34157,-73.33775 z" />
+  <path
+     id="path1309"
+     style="color:#000000;fill:none;stroke:#000000;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter2919)"
+     d="m 15.336544,224.92174 476.527566,0" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 249,224 c 0,-15 0,-15 0,-15 l 0,0 0,0"
+     id="path3142-7" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 299,224 c 0,-15 0,-15 0,-15 l 0,0 0,0"
+     id="path3142-2" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 349,224 c 0,-15 0,-15 0,-15 l 0,0 0,0"
+     id="path3142-3" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 399,224 c 0,-15 0,-15 0,-15 l 0,0 0,0"
+     id="path3142" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 449,224 c 0,-15 0,-15 0,-15 l 0,0 0,0"
+     id="path3142-5" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 48.674148,224 c 0,-15 0,-15 0,-15 l 0,0 0,0"
+     id="path3142-2-4" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 99,224 c 0,-15 0,-15 0,-15 l 0,0 0,0"
+     id="path3142-3-7" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 149,224 c 0,-15 0,-15 0,-15 l 0,0 0,0"
+     id="path3142-31" />
+  <path
+     style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 199,224 c 0,-15 0,-15 0,-15 l 0,0 0,0"
+     id="path3142-5-6" />
+</svg>
diff --git a/data/games.xml b/data/games.xml
index 8aa1354..23190b0 100644
--- a/data/games.xml
+++ b/data/games.xml
@@ -333,4 +333,54 @@
 			<_rationale plural ="[eyes]">There are [men] people and [horses] horses.</_rationale>
 		</variant>
 	</game>
+
+	<game>
+		<_name>Lever</_name>
+		<type>Logic</type>
+		<difficulty>All</difficulty>
+		<_question>How much weight is need at the point indicated by the question mark to balance the lever?</_question>
+		<_tip>Consider the sentence attributed to Archimedes: give me a lever long enough and a place to stand, and I can move the Earth.</_tip>
+		<_rationale>A lever is in equilibrium at distances reciprocally proportional to their weights.</_rationale>
+		<svg file = "lever.svg" x = "0.1" y = "0.1" width = "0.8" height = "0.8"/>
+	
+		<variant>
+			<variables>
+			int right_pos = 2;
+			int left_pos = 3;
+			int weight = 2 + random.Next (8);
+			int right_weight = right_pos * weight;
+			int left_weight = left_pos * weight;
+			</variables>
+			<string text = "?" x = "0.66" y = "0.4" centered = "yes" size = "large"/>
+			<string text = "[left_weight]" x = "0.26" y = "0.4" centered = "yes" size = "large"/>
+			<answer>[right_weight]</answer>
+		</variant>
+
+		<variant>
+			<variables>
+			int right_pos = 4;
+			int left_pos = 3;
+			int weight = 2 + random.Next (8);
+			int right_weight = right_pos * weight;
+			int left_weight = left_pos * weight;
+			</variables>
+			<string text = "?" x = "0.82" y = "0.4" centered = "yes" size = "large"/>
+			<string text = "[left_weight]" x = "0.26" y = "0.4" centered = "yes" size = "large"/>
+			<answer>[right_weight]</answer>
+		</variant>
+
+		<variant>
+			<variables>
+			int right_pos = 3;
+			int left_pos = 1;
+			int weight = 2 + random.Next (8);
+			int right_weight = right_pos * weight;
+			int left_weight = left_pos * weight;
+			</variables>
+			<string text = "?" x = "0.74" y = "0.4" centered = "yes" size = "large"/>
+			<string text = "[left_weight]" x = "0.42" y = "0.4" centered = "yes" size = "large"/>
+			<answer>[right_weight]</answer>
+		</variant>
+	</game>
+
 </games>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]