[gbrainy] Makes Calculation of Proportions more easy



commit 0fe2c00607e81b2d077af877c2d3c4044d442bf5
Author: Jordi Mas <jmas softcatala org>
Date:   Sat Sep 26 13:14:19 2009 +0200

    Makes Calculation of Proportions more easy

 src/CalculationGames/CalculationProportions.cs |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/CalculationGames/CalculationProportions.cs b/src/CalculationGames/CalculationProportions.cs
index 188ffa0..cf67120 100644
--- a/src/CalculationGames/CalculationProportions.cs
+++ b/src/CalculationGames/CalculationProportions.cs
@@ -48,8 +48,8 @@ public class CalculationProportions : Game
 		get { 
 			string answer = base.Answer + " ";
 
-			answer += String.Format (Catalog.GetString ("The result of the operation is {0:##0.###}"), 
-				correct);
+			answer += String.Format (Catalog.GetString ("The result of the operation is {0:##0.###}. You have to divide {1}/100 by {2}/{3}."), 
+				correct, percentage, num, den);
 			return answer;
 		}
 	}
@@ -60,23 +60,22 @@ public class CalculationProportions : Game
 		
 		switch (CurrentDifficulty) {
 		case Difficulty.Easy:
-			random_max = 20;
+			random_max = 10;
 			break;
 		default:
 		case Difficulty.Medium:
-			random_max = 30;
+			random_max = 15;
 			break;
 		case Difficulty.Master:
-			random_max = 50;
+			random_max = 25;
 			break;
 		}
 
-
 		do {
 			// Fraction
-			num = 10 + random.Next (random_max);
+			num = 15 + random.Next (random_max) * 2;
 			den = 1 + random.Next (random_max);
-			percentage = 30 + random.Next (random_max);
+			percentage = 50 + random.Next (random_max);
 		} while (num / den == 1); 	
 
 		options = new double [options_cnt];
@@ -86,7 +85,6 @@ public class CalculationProportions : Game
 		options [options_next++] = percentage / 50 * (num / den);
 		options [options_next++] = percentage / 100 / (den / num);
 		options [options_next++] = percentage / 150 * (den / num);
-		
 
 		random_indices = new ArrayListIndicesRandom (options_cnt);
 		random_indices.Initialize ();



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