gbrainy r312 - trunk/src
- From: jmas svn gnome org
- To: svn-commits-list gnome org
- Subject: gbrainy r312 - trunk/src
- Date: Thu, 1 May 2008 15:53:10 +0100 (BST)
Author: jmas
Date: Thu May 1 14:53:10 2008
New Revision: 312
URL: http://svn.gnome.org/viewvc/gbrainy?rev=312&view=rev
Log:
2008-05-01 Jordi Mas <jmas softcatala org>
* GameManager.cs: New logic game
* PuzzleCountSeries.cs: New logic game
* Makefile.am: New logic game
Added:
trunk/src/PuzzleCountSeries.cs
Modified:
trunk/src/ChangeLog
trunk/src/GameManager.cs
trunk/src/Makefile.am
Modified: trunk/src/GameManager.cs
==============================================================================
--- trunk/src/GameManager.cs (original)
+++ trunk/src/GameManager.cs Thu May 1 14:53:10 2008
@@ -59,6 +59,7 @@
typeof (PuzzleEquation),
typeof (PuzzleQuadrilaterals),
typeof (PuzzleExtraCircle),
+ typeof (PuzzleCountSeries),
};
static Type[] CalculationTrainers = new Type[]
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Thu May 1 14:53:10 2008
@@ -60,6 +60,7 @@
$(srcdir)/PuzzleQuadrilaterals.cs \
$(srcdir)/CalculationFractions.cs \
$(srcdir)/PuzzleExtraCircle.cs \
+ $(srcdir)/PuzzleCountSeries.cs \
$(srcdir)/gbrainy.cs
ASSEMBLIES = \
@@ -67,8 +68,6 @@
-r:Mono.Cairo.dll \
-r:Mono.Posix
-
-
RESOURCES = \
-resource:$(srcdir)/gbrainy.glade \
-resource:$(top_srcdir)/data/resume-32.png \
Added: trunk/src/PuzzleCountSeries.cs
==============================================================================
--- (empty file)
+++ trunk/src/PuzzleCountSeries.cs Thu May 1 14:53:10 2008
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2008 Jordi Mas i HernÃndez <jmas softcatala org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+using System;
+using Cairo;
+using Mono.Unix;
+
+public class PuzzleCountSeries : Game
+{
+ enum GameType
+ {
+ HowManyNines,
+ HowManySmallerDigits,
+ HowManyBiggerDigits,
+ Length
+ }
+
+ private Game game;
+ private string question;
+ private string answer;
+
+ public override string Name {
+ get {return Catalog.GetString ("Count series");}
+ }
+
+ public override string Question {
+ get {return question;}
+ }
+
+ public override string Answer {
+ get {
+ string answer = base.Answer + " ";
+ return answer;
+ }
+ }
+
+ public override void Initialize ()
+ {
+ switch ((GameType) random.Next ((int) GameType.Length))
+ {
+ case GameType.HowManyNines:
+ question = "How many 9 digits are needed to represent the the numbers between 10 to 100?";
+ right_answer = "20";
+ break;
+
+ case GameType.HowManyBiggerDigits:
+ question = "How many numbers of two digits have the first digit bigger than the second (e.g.: 20 and 21)?";
+ right_answer = "45";
+ break;
+
+ case GameType.HowManySmallerDigits:
+ question = "How many numbers of two digits have the first digit smaller than the second (e.g.: 12 and 13)?";
+ right_answer = "36";
+ break;
+ }
+ }
+
+ public override void Draw (CairoContextEx gr, int area_width, int area_height)
+ {
+ gr.Scale (area_width, area_height);
+ DrawBackground (gr);
+ }
+}
+
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]