renumber difficulty: 1=Easy, 2=Hard
authorgitknilch <gitknilch@cwde.de>
Tue, 26 Feb 2013 09:01:17 +0000 (10:01 +0100)
committergitknilch <gitknilch@cwde.de>
Tue, 26 Feb 2013 09:01:17 +0000 (10:01 +0100)
res/values/arrays.xml
src/de/cwde/shisensho/Board.java

index 14a60b444af5dfb42469708eb8e8819593a21487..e7ded555952f3c5fd8acf2c2c1f267665d022f8d 100644 (file)
         <item>Hard</item>
     </string-array>
     <string-array name="difficulty_values">
-        
-        <item >2</item><item>1</item>
+        <item>1</item>
+        <item>2</item>
     </string-array>
     <string-array name="size_values">
-        <item >1</item>
-        <item >2</item>
-        <item >3</item>
+        <item>1</item>
+        <item>2</item>
+        <item>3</item>
     </string-array>
-    
 </resources>
index f1627b046d41396799f4dd0895ec03881b5839c4..146b1d8ae6669d6523dd738489fbe6fd148774b7 100644 (file)
@@ -71,9 +71,9 @@ public class Board {
                this.difficulty=difficulty;
                this.gravity=gravity;
 
-               int numDifferentPieces=((boardSize[0]-2)*(boardSize[1]-2)/((difficulty+1)*2))+1;
-               for (int n=0;n<((difficulty+1)*2);n++) {
-                       for (int k=0;k<numDifferentPieces;k++) {
+               int numDifferentPieces=((boardSize[0]-2)*(boardSize[1]-2)/((4-difficulty)*2))+1;
+               for (int n=0; n<((4-difficulty)*2); n++) {
+                       for (int k=0; k<numDifferentPieces; k++) {
                                int i,j;
                                do {
                                        j=(myrand() % (boardSize[1]-2))+1;
Impressum, Datenschutz