[gbrainy/gbrainy_16x] Dartboard logic game



commit 4c87435b83013c7ca6ab259b4e6d8a38017d3943
Author: Jordi Mas <jmas softcatala org>
Date:   Tue Sep 14 20:34:10 2010 +0200

    Dartboard logic game

 data/Makefile.am                 |    4 +-
 data/game-graphics/dartboard.svg |  105 ++++++++++++++++++++++++++++++++++++++
 data/games.xml                   |   58 +++++++++++++++++++++
 3 files changed, 166 insertions(+), 1 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 2ade944..f958ec5 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -50,7 +50,8 @@ analogies_DATA = \
 	game-graphics/tennis.svg \
 	game-graphics/father_son.svg \
 	game-graphics/money.svg \
-	game-graphics/box.svg
+	game-graphics/box.svg \
+	game-graphics/dartboard.svg
 	
 
 install-data-local:
@@ -72,6 +73,7 @@ install-data-local:
 	$(INSTALL_DATA) $(srcdir)/game-graphics/father_son.svg $(DESTDIR)$(images)/father_son.svg
 	$(INSTALL_DATA) $(srcdir)/game-graphics/money.svg $(DESTDIR)$(images)/money.svg
 	$(INSTALL_DATA) $(srcdir)/game-graphics/box.svg $(DESTDIR)$(images)/box.svg
+	$(INSTALL_DATA) $(srcdir)/game-graphics/dartboard.svg $(DESTDIR)$(images)/dartboard.svg
 
 gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
 
diff --git a/data/game-graphics/dartboard.svg b/data/game-graphics/dartboard.svg
new file mode 100644
index 0000000..325bdc5
--- /dev/null
+++ b/data/game-graphics/dartboard.svg
@@ -0,0 +1,105 @@
+<?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";
+   width="500"
+   height="500"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="dartboard.svg">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <inkscape:perspective
+       id="perspective3623"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective3649"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="111.64334"
+     inkscape:cy="154.2747"
+     inkscape:document-units="px"
+     inkscape:current-layer="capa1"
+     showgrid="false"
+     inkscape:window-width="1152"
+     inkscape:window-height="694"
+     inkscape:window-x="0"
+     inkscape:window-y="52"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Capa 1"
+     inkscape:groupmode="layer"
+     id="capa1">
+    <path
+       sodipodi:type="arc"
+       style="fill:none;stroke:#000000;stroke-width:7.45885372;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path2818"
+       sodipodi:cx="363.65491"
+       sodipodi:cy="453.34174"
+       sodipodi:rx="309.10669"
+       sodipodi:ry="285.87317"
+       d="m 672.7616,453.34174 a 309.10669,285.87317 0 1 1 -618.213382,0 309.10669,285.87317 0 1 1 618.213382,0 z"
+       transform="matrix(0.64904128,0,0,0.69234652,13.342147,-65.697481)" />
+    <path
+       transform="matrix(0.50905199,0,0,0.54555926,62.938683,1.5466736)"
+       sodipodi:type="arc"
+       style="fill:none;stroke:#000000;stroke-width:9.48785305;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path2818-5"
+       sodipodi:cx="363.65491"
+       sodipodi:cy="453.34174"
+       sodipodi:rx="309.10669"
+       sodipodi:ry="285.87317"
+       d="m 672.7616,453.34174 a 309.10669,285.87317 0 1 1 -618.213382,0 309.10669,285.87317 0 1 1 618.213382,0 z" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 245.43541,50.248784 c 2.62252,398.644086 2.62252,398.644086 2.62252,398.644086 l 0,0"
+       id="path3639" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 447.39596,239.80769 c -396.053665,-0.0562 -396.053665,-0.0562 -396.053665,-0.0562 l 0,0"
+       id="path3639-4" />
+  </g>
+</svg>
diff --git a/data/games.xml b/data/games.xml
index 6a8f838..d78a1fa 100644
--- a/data/games.xml
+++ b/data/games.xml
@@ -255,4 +255,62 @@
 			<_rationale>Palindrome years occur usually at 110 year intervals except for the end of each millennium that occur at a 11 years interval.</_rationale>
 		</variant>
 	</game>
+
+	<game>
+		<_name>Dartboard</_name>
+		<type>Logic</type>
+		<difficulty>All</difficulty>
+		<variant>
+			<!-- 
+				* The array 'numbers' always contains 1 number that is not needed to accomplish the game
+				* There is a single combination that can solve the problem
+				* There are always 2 numbers that have to be repeated
+			-->
+			<variables>
+			int [] numbers = new int [] 
+			{
+				2, 20, 39, 10,
+				6, 30, 39, 11,
+				31, 12, 34, 8,
+				18, 20, 2, 31,
+				4, 14, 26, 27,
+				26, 7, 20, 27,
+			};
+
+			int [] ans = new int [] 
+			{
+				2, 20, 20, 39, 39,
+				6, 6, 30, 39, 39,
+				31, 31, 12, 12, 34,
+				18, 20, 20, 31, 31,
+				14, 26, 26, 27, 27,
+				26, 20, 20, 27, 27,
+			};
+
+			int idx = random.Next (6);
+			int value_a = numbers [4 * idx + 0];
+			int value_b = numbers [4 * idx + 1];
+			int value_c = numbers [4 * idx + 2];
+			int value_d = numbers [4 * idx + 3];
+
+			int answer_a = ans [5 * idx + 0];
+			int answer_b = ans [5 * idx + 1];
+			int answer_c = ans [5 * idx + 2];
+			int answer_d = ans [5 * idx + 3];
+			int answer_e = ans [5 * idx + 4];
+			</variables>
+			<_question>Where you have to hit the darts to add 120 points in 5 throws? Answer using a list of numbers (e.g.: 4, 5, 6, 3, 2)</_question>
+			<svg file = "dartboard.svg" x = "0.1" y = "0.1" width = "0.8" height = "0.8"/>
+
+			<string _text = "[value_a]" x = "0.35" y = "0.35" size = "x-large"/>
+			<string _text = "[value_b]" x = "0.54" y = "0.35" size = "x-large"/>
+			<string _text = "[value_c]" x = "0.35" y = "0.55" size = "x-large"/>
+			<string _text = "[value_d]" x = "0.54" y = "0.55" size = "x-large"/>
+
+			<_answer_show>[answer_a], [answer_b], [answer_c], [answer_d], [answer_e]</_answer_show>
+			<answer>[answer_a] | [answer_b] | [answer_c] | [answer_d] | [answer_e]</answer>
+			<answer_expression>[0-9]+</answer_expression>
+			<answer_checkattributes>Trim | MatchAll </answer_checkattributes>
+		</variant>
+	</game>
 </games>



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