~ubuntu-branches/ubuntu/lucid/gbrainy/lucid

« back to all changes in this revision

Viewing changes to src/PuzzleGames/PuzzleCountSeries.cs

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2010-01-12 11:21:24 UTC
  • mfrom: (13.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100112112124-o4ztomxa0xfh2ulj
Tags: 1.30-1ubuntu1
* debian/control:
  - Revert build-depends to lucid versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2008 Jordi Mas i Hernàndez <jmas@softcatala.org>
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU General Public License as
6
 
 * published by the Free Software Foundation; either version 2 of the
7
 
 * License, or (at your option) any later version.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 
 * General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU General Public
15
 
 * License along with this program; if not, write to the
16
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
 
 * Boston, MA 02111-1307, USA.
18
 
 */
19
 
 
20
 
using System;
21
 
using Cairo;
22
 
using Mono.Unix;
23
 
 
24
 
public class PuzzleCountSeries : Game
25
 
{
26
 
        enum GameType
27
 
        {
28
 
                HowManyNines,
29
 
                HowManySmallerDigits,
30
 
                HowManyBiggerDigits,
31
 
                Length          
32
 
        }
33
 
 
34
 
        private string question;
35
 
 
36
 
        public override string Name {
37
 
                get {return Catalog.GetString ("Count series");}
38
 
        }
39
 
 
40
 
        public override string Question {
41
 
                get {return question;} 
42
 
        }
43
 
 
44
 
        public override string Answer {
45
 
                get { 
46
 
                        string answer = base.Answer + " ";
47
 
                        return answer;
48
 
                }
49
 
        }
50
 
 
51
 
        public override void Initialize ()
52
 
        {
53
 
                switch ((GameType) random.Next ((int) GameType.Length))
54
 
                {
55
 
                        case GameType.HowManyNines:
56
 
                                question = Catalog.GetString ("How many numbers \"9\" are required to represent the numbers between 10 to 100?");
57
 
                                right_answer = "19";
58
 
                                break;
59
 
 
60
 
                        case GameType.HowManyBiggerDigits:
61
 
                                question = Catalog.GetString ("How many two digit numbers occur where the first digit is larger than the second (e.g.: 20 and 21)?");
62
 
                                right_answer = "45";
63
 
                                break;
64
 
 
65
 
                        case GameType.HowManySmallerDigits:
66
 
                                question = Catalog.GetString ("How many two digit numbers occur where the first digit is smaller than the second (e.g.: 12 and 13)?");
67
 
                                right_answer = "36";
68
 
                                break;
69
 
                }
70
 
        }
71
 
 
72
 
        public override void Draw (CairoContextEx gr, int area_width, int area_height)
73
 
        {
74
 
                base.Draw (gr, area_width, area_height);
75
 
        }
76
 
}
77
 
 
78