Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adding ability to ensure the correct words use the correct letters. T…

…He numbering may still be off, so that is disabled atm.
  • Loading branch information...
commit f122a9101c1da6c255365b3a7100e874727bc598 1 parent b450ef1
Robin Debreuil authored
BIN  WordGrid.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
88  WordGrid.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -2,4 +2,92 @@
2 2
 <Bucket
3 3
    type = "1"
4 4
    version = "1.0">
  5
+   <FileBreakpoints>
  6
+      <FileBreakpoint
  7
+         shouldBeEnabled = "No"
  8
+         ignoreCount = "0"
  9
+         continueAfterRunningActions = "No"
  10
+         isPathRelative = "1"
  11
+         filePath = "WordGrid/LevelEditorGrid.m"
  12
+         timestampString = "346922993.001561"
  13
+         startingColumnNumber = "9223372036854775807"
  14
+         endingColumnNumber = "9223372036854775807"
  15
+         startingLineNumber = "252"
  16
+         endingLineNumber = "252"
  17
+         landmarkName = "-serializeGridLetters"
  18
+         landmarkType = "5">
  19
+      </FileBreakpoint>
  20
+      <FileBreakpoint
  21
+         shouldBeEnabled = "No"
  22
+         ignoreCount = "0"
  23
+         continueAfterRunningActions = "No"
  24
+         isPathRelative = "1"
  25
+         filePath = "WordGrid/GameVC.m"
  26
+         timestampString = "346923999.311846"
  27
+         startingColumnNumber = "9223372036854775807"
  28
+         endingColumnNumber = "9223372036854775807"
  29
+         startingLineNumber = "164"
  30
+         endingLineNumber = "164"
  31
+         landmarkName = "-testWordComplete"
  32
+         landmarkType = "5">
  33
+      </FileBreakpoint>
  34
+      <FileBreakpoint
  35
+         shouldBeEnabled = "No"
  36
+         ignoreCount = "0"
  37
+         continueAfterRunningActions = "No"
  38
+         isPathRelative = "1"
  39
+         filePath = "WordGrid/GameVC.m"
  40
+         timestampString = "346924040.234651"
  41
+         startingColumnNumber = "9223372036854775807"
  42
+         endingColumnNumber = "9223372036854775807"
  43
+         startingLineNumber = "169"
  44
+         endingLineNumber = "169"
  45
+         landmarkName = "-testWordComplete"
  46
+         landmarkType = "5">
  47
+      </FileBreakpoint>
  48
+      <FileBreakpoint
  49
+         shouldBeEnabled = "No"
  50
+         ignoreCount = "0"
  51
+         continueAfterRunningActions = "No"
  52
+         isPathRelative = "1"
  53
+         filePath = "WordGrid/GameVC.m"
  54
+         timestampString = "346924562.046444"
  55
+         startingColumnNumber = "9223372036854775807"
  56
+         endingColumnNumber = "9223372036854775807"
  57
+         startingLineNumber = "174"
  58
+         endingLineNumber = "174"
  59
+         landmarkName = "-testWordComplete"
  60
+         landmarkType = "5">
  61
+      </FileBreakpoint>
  62
+      <FileBreakpoint
  63
+         shouldBeEnabled = "No"
  64
+         ignoreCount = "0"
  65
+         continueAfterRunningActions = "No"
  66
+         isPathRelative = "1"
  67
+         filePath = "WordGrid/GameVC.m"
  68
+         timestampString = "346924785.438361"
  69
+         startingColumnNumber = "9223372036854775807"
  70
+         endingColumnNumber = "9223372036854775807"
  71
+         startingLineNumber = "166"
  72
+         endingLineNumber = "166"
  73
+         landmarkName = "-testWordComplete"
  74
+         landmarkType = "5">
  75
+      </FileBreakpoint>
  76
+   </FileBreakpoints>
  77
+   <SymbolicBreakpoints>
  78
+      <SymbolicBreakpoint
  79
+         shouldBeEnabled = "Yes"
  80
+         ignoreCount = "0"
  81
+         continueAfterRunningActions = "No"
  82
+         symbolName = "[NSException raise]"
  83
+         moduleName = "">
  84
+      </SymbolicBreakpoint>
  85
+      <SymbolicBreakpoint
  86
+         shouldBeEnabled = "Yes"
  87
+         ignoreCount = "0"
  88
+         continueAfterRunningActions = "No"
  89
+         symbolName = "NSRangeException"
  90
+         moduleName = "">
  91
+      </SymbolicBreakpoint>
  92
+   </SymbolicBreakpoints>
5 93
 </Bucket>
3  WordGrid/AnswerData.h
@@ -9,7 +9,8 @@
9 9
 + (int)        getCurrentIndex;
10 10
 + (NSString *)  getCurrentQuote;
11 11
 + (NSString *)  getCurrentSource;
12  
-+ (NSString *) getCurrentGrid;
  12
++ (NSArray *)   getCurrentIndexes;
  13
++ (NSString *)  getCurrentGrid;
13 14
 + (void)       incrementIndex;
14 15
 
15 16
 @end
60  WordGrid/AnswerData.m
@@ -4,10 +4,12 @@ @implementation AnswerData
4 4
 
5 5
 static int currentIndex;
6 6
 static NSArray *quotes;
  7
+static BOOL hasPlayed;
7 8
 
8 9
 + (void) initialize
9 10
 {
10 11
     currentIndex = 0;
  12
+    hasPlayed = NO;
11 13
     quotes = [NSArray arrayWithObjects:
12 14
               
13 15
               
@@ -28,6 +30,7 @@ + (void) initialize
28 30
               //[NSArray arrayWithObjects:@"THERE ARE LIES, DAMNED LIES AND STATISTICS.", @"", @"MARK TWAIN", nil],
29 31
               //[NSArray arrayWithObjects:@"I'VE NEVER LET MY SCHOOLING INTERFERE WITH MY EDUCATION.", @"", @"MARK TWAIN", nil],
30 32
              //[NSArray arrayWithObjects:@"ACTION SPEAKS LOUDER THAN WORDS, BUT NOT NEARLY AS OFTEN.", @"", @"MARK TWAIN", nil],
  33
+              
31 34
   /*             [NSArray arrayWithObjects:@"ANY EMOTION, IF IT IS SINCERE, IS INVOLUNTARY.", @"", @"MARK TWAIN", nil],
32 35
               [NSArray arrayWithObjects:@"BUY LAND, THEY'RE NOT MAKING IT ANYMORE.", @"", @"MARK TWAIN", nil],
33 36
               [NSArray arrayWithObjects:@"CAULIFLOWER IS NOTHING BUT CABBAGE WITH A COLLEGE EDUCATION.", @"", @"MARK TWAIN", nil],
@@ -47,20 +50,17 @@ + (void) initialize
47 50
               [NSArray arrayWithObjects:@"REALITY IS MERELY AN ILLUSION, ALBEIT A VERY PERSISTENT ONE.", @"", @"ALBERT EINSTEIN", nil],
48 51
               [NSArray arrayWithObjects:@"TIME IS WHAT PREVENTS EVERYTHING FROM HAPPENING AT ONCE.", @"", @"ALBERT EINSTEIN", nil],
49 52
 */              
50  
-              
51 53
               [NSArray arrayWithObjects:
52  
-               @"FIND ALL THE WORDS", 
53  
-               @"                                       TW      ALHO   FINDLERDS", nil
  54
+               @"PRESS ON THE ANSWER TO UNDO WORDS",
  55
+               @"                             UTHE     AWORERP NNNDOSTO OSWERSDS",
  56
+               @"WAS THE CORRECT ANSWER!",
  57
+               @"44,43,42,51,60,55,55,30,31,32,38,47,56,57,58,59,52,53,56,57,58,59,57,58,59,61,62", nil
54 58
                ],
55 59
               [NSArray arrayWithObjects:
56  
-               @"PRESS ON THE ANSWER AREA TO UNDO SOME WORDS", 
57  
-               @"                     SW    UNDOOO   PRESSMRDSANSAREETOTHEWERAON", nil
58  
-               ],
59  
-              [NSArray arrayWithObjects:
60  
-               @"ALL GREAT TRUTHS BEGIN AS BLASPHEMIES",
61  
-               @"             E      TBTH     RUGS     BLINALA EHPGRELS MIEASATS",
62  
-               @"George Bernard Shaw",
63  
-               @"42,43,52,49,50,51,60,61,22,31,32,33,34,43,32,33,42,51,52,60,61,42,43,44,53,52,51,50,59,60,61,62", nil
  60
+               @"FIND ALL THE WORDS",
  61
+               @"                                      F    A   IW THLL  NDOREDS",
  62
+               @"WAS THE CORRECT ANSWER!",
  63
+               @"38,47,56,57,43,52,53,50,51,60,58,59,60,61,62", nil
64 64
                ],
65 65
               [NSArray arrayWithObjects:
66 66
                @"I AM NOT YOUNG ENOUGH TO KNOW EVERYTHING",
@@ -69,6 +69,12 @@ + (void) initialize
69 69
                @"53,61,62,60,61,62,12,13,14,23,32,41,50,59,60,61,62,26,25,34,35,44,53,15,24,33,42,43,52,51,60,61,62", nil
70 70
                ],
71 71
               [NSArray arrayWithObjects:
  72
+               @"ALL GREAT TRUTHS BEGIN AS BLASPHEMIES",
  73
+               @"             E      TBTH     RUGS     BLINALA EHPGRELS MIEASATS",
  74
+               @"George Bernard Shaw",
  75
+               @"42,43,52,49,50,51,60,61,22,31,32,33,34,43,32,33,42,51,52,60,61,42,43,44,53,52,51,50,59,60,61,62", nil
  76
+               ],
  77
+              [NSArray arrayWithObjects:
72 78
                @"ONE SHOULD ALWAYS PLAY FAIRLY WHEN ONE HAS THE WINNING CARDS",
73 79
                @"          TN PA  CWHEONEYAAIOAFAHSIRNESRLOUYDNHWLWALDSINHELYSNG",
74 80
                @"Oscar Wilde",
@@ -222,11 +228,15 @@ + (int) getCurrentIndex
222 228
 
223 229
 + (void) incrementIndex
224 230
 {
225  
-    currentIndex++;
226  
-    if(currentIndex >= quotes.count)
  231
+    if(hasPlayed)
227 232
     {
228  
-        currentIndex = 0;
  233
+        currentIndex++;
  234
+        if(currentIndex >= quotes.count)
  235
+        {
  236
+            currentIndex = 0;
  237
+        }
229 238
     }
  239
+    hasPlayed = YES;
230 240
 }
231 241
 
232 242
 + (NSString *) getCurrentQuote
@@ -245,6 +255,28 @@ + (NSString *) getCurrentSource
245 255
     return result;
246 256
 }
247 257
 
  258
++ (NSArray *) getCurrentIndexes
  259
+{
  260
+    NSArray *result;
  261
+    NSArray *ar = [quotes objectAtIndex:[AnswerData getCurrentIndex]];
  262
+    if(ar.count > 3)
  263
+    {
  264
+        NSString *s = [ar objectAtIndex:3];
  265
+        NSArray *sInts = [s componentsSeparatedByString:@","];
  266
+        int count = sInts.count;
  267
+        id nums[count];        
  268
+        
  269
+        for (int i = 0; i < count; i++) 
  270
+        {
  271
+            int num = [[sInts objectAtIndex:i] intValue];
  272
+            nums[i] = [NSNumber numberWithInt:num];
  273
+        }
  274
+        
  275
+        result = [NSArray arrayWithObjects:nums count:count];
  276
+    }
  277
+    return result;
  278
+}
  279
+
248 280
 + (NSString *) getCurrentGrid
249 281
 {
250 282
     return [[quotes objectAtIndex:[AnswerData getCurrentIndex]] objectAtIndex:1];
13  WordGrid/AnswerGrid.m
@@ -22,14 +22,7 @@ - (void) setup
22 22
 - (void) setDirection:(int)dir
23 23
 {
24 24
     direction = dir;
25  
-    if(dir == 1)
26  
-    {
27  
-        currentIndex = 0;        
28  
-    }
29  
-    else
30  
-    {
31  
-        currentIndex = answerLength - 1;
32  
-    }
  25
+    currentIndex = (direction == 1) ? 0 : answerLength - 1;
33 26
 }
34 27
 
35 28
 - (void) createLetters
@@ -40,7 +33,6 @@ - (void) createLetters
40 33
     answer = [answer stringByReplacingOccurrencesOfString:@"'" withString:@""];
41 34
     answerWords = [answer componentsSeparatedByString: @" "];
42 35
     wordBoundries = [[NSMutableArray alloc] init];
43  
-    currentIndex = 0;
44 36
     answerLength = 0;
45 37
     
46 38
     int wordIndex = 0;       
@@ -87,7 +79,8 @@ - (void) createLetters
87 79
                 }                
88 80
             }                
89 81
         }             
90  
-    }    
  82
+    } 
  83
+    currentIndex = (direction == 1) ? 0 : answerLength - 1;   
91 84
 }
92 85
 
93 86
 - (void) ownTileSelected:(Tile *)tile;
38  WordGrid/GameVC.m
@@ -10,6 +10,8 @@ @implementation GameVC
10 10
 typedef enum { Game, Victory } GameState;
11 11
 GameState gameState = Game;
12 12
 Boolean isLandscape = NO;
  13
+NSArray *indexes;
  14
+
13 15
 
14 16
 SystemSoundID correctWordSoundID;
15 17
 SystemSoundID errorSoundID;
@@ -154,7 +156,22 @@ - (void) testWordComplete
154 156
 {
155 157
     if([answerGrid atWordBoundry])
156 158
     {        
157  
-        [tileGrid resetGrid];  
  159
+        [tileGrid resetGrid];
  160
+        
  161
+        Boolean correct = [answerGrid testCurrentWordCorrect];
  162
+        if(correct)
  163
+        {
  164
+ /*         NSRange r = NSMakeRange([answerGrid getAnswerIndex] - answerRefs.count, answerRefs.count);
  165
+            NSArray *correctTileIndexes = [indexes subarrayWithRange:r];
  166
+            for (int i = 0; i < correctTileIndexes.count; i++) 
  167
+            {      
  168
+                NSNumber *corIndex = [correctTileIndexes objectAtIndex:i];
  169
+                Tile *corTile = [tileGrid getTileAtIndex:[corIndex integerValue]];
  170
+                [answerRefs replaceObjectAtIndex:i withObject:corTile];
  171
+            }
  172
+ */ 
  173
+        }
  174
+       
158 175
         [tileGrid removeWordAndDrop:answerRefs];
159 176
         [answerRefs removeAllObjects];
160 177
         
@@ -187,27 +204,30 @@ - (void) testWordComplete
187 204
 - (void) nextRound
188 205
 {
189 206
     gameState = Game;
  207
+    
190 208
     [AnswerData incrementIndex];
  209
+    
191 210
     [tileGrid createRound];
192 211
     [answerGrid createRound];
  212
+    
193 213
     NSString *let = [answerGrid getCurrentCorrectLetter];
194 214
     [tileGrid setSelectableByLetter:let];
  215
+    
  216
+    indexes = [AnswerData getCurrentIndexes];
  217
+    
195 218
     [self setOrientation];
196 219
 }
197 220
 
198 221
 - (void)didReceiveMemoryWarning
199 222
 {
200  
-    // Releases the view if it doesn't have a superview.
201 223
     [super didReceiveMemoryWarning];
202  
-    
203  
-    // Release any cached data, images, etc that aren't in use.
204 224
 }
205 225
 
206 226
 - (void)viewDidLoad
207 227
 {
208 228
     [super viewDidLoad];
209 229
     
210  
-    [answerGrid setup];
  230
+    [answerGrid setup]; // answer grid needs to be setup first
211 231
     [tileGrid setup];
212 232
     
213 233
     answerRefs = [[NSMutableArray alloc] initWithCapacity:20];    
@@ -236,13 +256,7 @@ - (void)viewDidLoad
236 256
     tickURLRef = [[NSBundle mainBundle] URLForResource:@"win" withExtension:@"caf"];
237 257
     AudioServicesCreateSystemSoundID ( (__bridge CFURLRef) tickURLRef, &winSoundID);  
238 258
     
239  
-    [self setOrientation];
240  
-    
241  
-    NSString *let = [answerGrid getCurrentCorrectLetter];
242  
-    if(let != nil)
243  
-    {
244  
-        [tileGrid setSelectableByLetter:let];
245  
-    }    
  259
+    [self nextRound];  
246 260
 }
247 261
 
248 262
 - (void)viewDidUnload
93  WordGrid/GameView.xib
@@ -43,7 +43,6 @@
43 43
 						<object class="NSPSMatrix" key="NSFrameMatrix"/>
44 44
 						<string key="NSFrameSize">{768, 1024}</string>
45 45
 						<reference key="NSSuperview" ref="191373211"/>
46  
-						<reference key="NSWindow"/>
47 46
 						<reference key="NSNextKeyView" ref="312021246"/>
48 47
 						<object class="NSColor" key="IBUIBackgroundColor" id="273351375">
49 48
 							<int key="NSColorSpace">3</int>
@@ -63,7 +62,6 @@
63 62
 						<object class="NSPSMatrix" key="NSFrameMatrix"/>
64 63
 						<string key="NSFrameSize">{1024, 768}</string>
65 64
 						<reference key="NSSuperview" ref="191373211"/>
66  
-						<reference key="NSWindow"/>
67 65
 						<reference key="NSNextKeyView" ref="888472147"/>
68 66
 						<reference key="IBUIBackgroundColor" ref="273351375"/>
69 67
 						<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -78,7 +76,6 @@
78 76
 						<int key="NSvFlags">292</int>
79 77
 						<string key="NSFrame">{{300, 572}, {630, 168}}</string>
80 78
 						<reference key="NSSuperview" ref="191373211"/>
81  
-						<reference key="NSWindow"/>
82 79
 						<reference key="NSNextKeyView"/>
83 80
 						<string key="NSReuseIdentifierKey">_NS:212</string>
84 81
 						<object class="NSColor" key="IBUIBackgroundColor">
@@ -93,7 +90,6 @@
93 90
 						<object class="NSPSMatrix" key="NSFrameMatrix"/>
94 91
 						<string key="NSFrame">{{278, 14}, {675, 525}}</string>
95 92
 						<reference key="NSSuperview" ref="191373211"/>
96  
-						<reference key="NSWindow"/>
97 93
 						<reference key="NSNextKeyView" ref="1029336070"/>
98 94
 						<object class="NSColor" key="IBUIBackgroundColor">
99 95
 							<int key="NSColorSpace">1</int>
@@ -107,7 +103,6 @@
107 103
 						<int key="NSvFlags">-2147483356</int>
108 104
 						<string key="NSFrameSize">{1024, 768}</string>
109 105
 						<reference key="NSSuperview" ref="191373211"/>
110  
-						<reference key="NSWindow"/>
111 106
 						<reference key="NSNextKeyView" ref="262109058"/>
112 107
 						<string key="NSReuseIdentifierKey">_NS:569</string>
113 108
 						<reference key="IBUIBackgroundColor" ref="273351375"/>
@@ -123,7 +118,6 @@
123 118
 						<int key="NSvFlags">-2147483356</int>
124 119
 						<string key="NSFrameSize">{768, 1024}</string>
125 120
 						<reference key="NSSuperview" ref="191373211"/>
126  
-						<reference key="NSWindow"/>
127 121
 						<reference key="NSNextKeyView" ref="197489539"/>
128 122
 						<string key="NSReuseIdentifierKey">_NS:569</string>
129 123
 						<reference key="IBUIBackgroundColor" ref="273351375"/>
@@ -140,7 +134,6 @@
140 134
 						<object class="NSPSMatrix" key="NSFrameMatrix"/>
141 135
 						<string key="NSFrame">{{100, 572}, {200, 34}}</string>
142 136
 						<reference key="NSSuperview" ref="191373211"/>
143  
-						<reference key="NSWindow"/>
144 137
 						<reference key="NSNextKeyView" ref="248888508"/>
145 138
 						<bool key="IBUIOpaque">NO</bool>
146 139
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -175,7 +168,6 @@
175 168
 						<int key="NSvFlags">-2147483356</int>
176 169
 						<string key="NSFrame">{{84, 200}, {600, 188}}</string>
177 170
 						<reference key="NSSuperview" ref="191373211"/>
178  
-						<reference key="NSWindow"/>
179 171
 						<reference key="NSNextKeyView" ref="1016526659"/>
180 172
 						<string key="NSReuseIdentifierKey">_NS:345</string>
181 173
 						<bool key="IBUIOpaque">NO</bool>
@@ -209,7 +201,6 @@
209 201
 				</array>
210 202
 				<string key="NSFrame">{{0, 20}, {768, 1004}}</string>
211 203
 				<reference key="NSSuperview"/>
212  
-				<reference key="NSWindow"/>
213 204
 				<reference key="NSNextKeyView" ref="158756890"/>
214 205
 				<reference key="IBUIBackgroundColor" ref="273351375"/>
215 206
 				<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
@@ -415,89 +406,7 @@
415 406
 			<nil key="sourceID"/>
416 407
 			<int key="maxID">31</int>
417 408
 		</object>
418  
-		<object class="IBClassDescriber" key="IBDocument.Classes">
419  
-			<array class="NSMutableArray" key="referencedPartialClassDescriptions">
420  
-				<object class="IBPartialClassDescription">
421  
-					<string key="className">AnswerGrid</string>
422  
-					<string key="superclassName">TileGrid</string>
423  
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
424  
-						<string key="majorKey">IBProjectSource</string>
425  
-						<string key="minorKey">./Classes/AnswerGrid.h</string>
426  
-					</object>
427  
-				</object>
428  
-				<object class="IBPartialClassDescription">
429  
-					<string key="className">GameVC</string>
430  
-					<string key="superclassName">UIViewController</string>
431  
-					<object class="NSMutableDictionary" key="actions">
432  
-						<string key="NS.key.0">onDone:</string>
433  
-						<string key="NS.object.0">id</string>
434  
-					</object>
435  
-					<object class="NSMutableDictionary" key="actionInfosByName">
436  
-						<string key="NS.key.0">onDone:</string>
437  
-						<object class="IBActionInfo" key="NS.object.0">
438  
-							<string key="name">onDone:</string>
439  
-							<string key="candidateClassName">id</string>
440  
-						</object>
441  
-					</object>
442  
-					<dictionary class="NSMutableDictionary" key="outlets">
443  
-						<string key="answerGrid">AnswerGrid</string>
444  
-						<string key="bkgH">UIView</string>
445  
-						<string key="bkgV">UIView</string>
446  
-						<string key="btDone">UIButton</string>
447  
-						<string key="tileGrid">TileGrid</string>
448  
-						<string key="txVictory">UILabel</string>
449  
-						<string key="victoryH">UIView</string>
450  
-						<string key="victoryV">UIView</string>
451  
-					</dictionary>
452  
-					<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
453  
-						<object class="IBToOneOutletInfo" key="answerGrid">
454  
-							<string key="name">answerGrid</string>
455  
-							<string key="candidateClassName">AnswerGrid</string>
456  
-						</object>
457  
-						<object class="IBToOneOutletInfo" key="bkgH">
458  
-							<string key="name">bkgH</string>
459  
-							<string key="candidateClassName">UIView</string>
460  
-						</object>
461  
-						<object class="IBToOneOutletInfo" key="bkgV">
462  
-							<string key="name">bkgV</string>
463  
-							<string key="candidateClassName">UIView</string>
464  
-						</object>
465  
-						<object class="IBToOneOutletInfo" key="btDone">
466  
-							<string key="name">btDone</string>
467  
-							<string key="candidateClassName">UIButton</string>
468  
-						</object>
469  
-						<object class="IBToOneOutletInfo" key="tileGrid">
470  
-							<string key="name">tileGrid</string>
471  
-							<string key="candidateClassName">TileGrid</string>
472  
-						</object>
473  
-						<object class="IBToOneOutletInfo" key="txVictory">
474  
-							<string key="name">txVictory</string>
475  
-							<string key="candidateClassName">UILabel</string>
476  
-						</object>
477  
-						<object class="IBToOneOutletInfo" key="victoryH">
478  
-							<string key="name">victoryH</string>
479  
-							<string key="candidateClassName">UIView</string>
480  
-						</object>
481  
-						<object class="IBToOneOutletInfo" key="victoryV">
482  
-							<string key="name">victoryV</string>
483  
-							<string key="candidateClassName">UIView</string>
484  
-						</object>
485  
-					</dictionary>
486  
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
487  
-						<string key="majorKey">IBProjectSource</string>
488  
-						<string key="minorKey">./Classes/GameVC.h</string>
489  
-					</object>
490  
-				</object>
491  
-				<object class="IBPartialClassDescription">
492  
-					<string key="className">TileGrid</string>
493  
-					<string key="superclassName">UIView</string>
494  
-					<object class="IBClassDescriptionSource" key="sourceIdentifier">
495  
-						<string key="majorKey">IBProjectSource</string>
496  
-						<string key="minorKey">./Classes/TileGrid.h</string>
497  
-					</object>
498  
-				</object>
499  
-			</array>
500  
-		</object>
  409
+		<object class="IBClassDescriber" key="IBDocument.Classes"/>
501 410
 		<int key="IBDocument.localizationMode">0</int>
502 411
 		<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
503 412
 		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
14  WordGrid/LevelEditorGrid.m
@@ -9,7 +9,7 @@ @implementation LevelEditorGrid
9 9
 
10 10
 int answerIndex;
11 11
 int rightmostColumn;
12  
-NSMutableArray *indexes;
  12
+NSMutableArray *sequence;
13 13
 AnswerGrid *answerGrid;
14 14
 
15 15
 - (void) setup
@@ -35,7 +35,7 @@ - (void) createLetters
35 35
 { 
36 36
     answerGrid = [[GameVC getCurrentGame] getAnswerGrid];    
37 37
     [answerGrid setDirection:-1];
38  
-    indexes = [[NSMutableArray alloc] initWithCapacity:100];
  38
+    sequence = [[NSMutableArray alloc] initWithCapacity:100];
39 39
         
40 40
     for (Tile* t in tiles) 
41 41
     {
@@ -179,7 +179,7 @@ - (void) insertLetter:(Tile *) tile
179 179
     
180 180
     [answerGrid setNextTileUsingTile:tile];
181 181
     
182  
-    [indexes addObject:[NSNumber numberWithInteger:tile.gridIndex]];
  182
+    [sequence addObject:tile];
183 183
     
184 184
     answerIndex--;
185 185
     if(answerIndex < 0)
@@ -230,7 +230,7 @@ - (NSString *) serializeGridLetters
230 230
      @"62,61,60,59,58,49,40,31,22,61,60,59,57,48,39,56,55,54,45,36,27,18,60,61,62,46,47,59,58,57,56,47,37,28,19,44,35,34,33,32,23,24,25,26,20,21,12,11,14,15,16", nil
231 231
      ],
232 232
      */
233  
-    NSMutableString *s = [NSMutableString stringWithCapacity:tiles.count];
  233
+    NSMutableString *s = [NSMutableString stringWithCapacity:tiles.count];  
234 234
     [s appendString:@"\r\r[NSArray arrayWithObjects:\r"];    
235 235
     [s appendString:@"@\""]; [s appendString:answer]; [s appendString:@"\",\r"];
236 236
     
@@ -250,11 +250,11 @@ - (NSString *) serializeGridLetters
250 250
     
251 251
     [s appendString:@"@\""];
252 252
     NSString *comma = @"";    
253  
-    for (int i = indexes.count - 1; i >= 0; i--) 
  253
+    for (int i = sequence.count - 1; i >= 0; i--) 
254 254
     {
255  
-        NSNumber *n = [indexes objectAtIndex:i];
  255
+        Tile *t = [sequence objectAtIndex:i];
256 256
         [s appendString:comma];
257  
-        [s appendString:[NSString stringWithFormat:@"%i", [n intValue]] ];
  257
+        [s appendString:[NSString stringWithFormat:@"%i", t.gridIndex] ];
258 258
         comma = @",";
259 259
     }    
260 260
     [s appendString:@"\", nil\r"];
7  WordGrid/TileGrid.m
@@ -8,7 +8,6 @@ @implementation TileGrid
8 8
 float tw;
9 9
 float th;
10 10
 NSMutableArray *gapsInserted;
11  
-
12 11
 -(id)init
13 12
 {
14 13
     self = [super init];
@@ -138,7 +137,7 @@ - (void) layoutGrid:(Boolean) useAnimation
138 137
 }
139 138
 
140 139
 - (void) createLetters
141  
-{ 
  140
+{     
142 141
     NSString *testString = [AnswerData getCurrentGrid];
143 142
     int index = 0;
144 143
     for (Tile* t in tiles) 
@@ -321,10 +320,10 @@ - (void) removeVerticalGaps
321 320
     }
322 321
 }
323 322
 
324  
--(void) removeWordAndDrop:(NSArray *) indexes
  323
+-(void) removeWordAndDrop:(NSArray *) indexesToRemove
325 324
 {
326 325
     animationDelay = 0.3;
327  
-    for (Tile *t in indexes) 
  326
+    for (Tile *t in indexesToRemove) 
328 327
     {
329 328
         [self removeTile:t.gridIndex];
330 329
     }

0 notes on commit f122a91

Please sign in to comment.
Something went wrong with that request. Please try again.