Join for FREE | Take the Tour Lost Password?
[x]

deviantART

 
Creative Commons License
Some rights reserved. This work is licensed under a
Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.
:iconkaku:

Artist's Comments

This shows the transition from the old isSetWithCards:: method to the new one. The reason for the change is pretty obvious, as the algorithm for checking each card property is the same, yet was repeated in the old code for every property.

The change probably took all of 10 minutes, if that, but I find it much cleaner since I'm not repeating the same code like I was in the old one. I also updated the comments to make a little more sense. "Two different, one same" wasn't quite descriptive enough for me.

Note that I can't simply return YES when I find that a property passes the test. All properties have to pass before I know the set it valid, so checking for truth didn't make sense here. If any property doesn't pass, I know the set isn't valid, so I can safely return NO when I find it doesn't pass.

:iconcodeisart:

Comments


love 0 0 joy 0 0 wow 0 0 mad 0 0 sad 0 0 fear 0 0 neutral 0 0
No comments have been added yet.

Details

June 6, 2008
112 KB
242 KB
600×352

Statistics

0
0
178 (0 today)
13 (0 today)

Site Map