[x]

deviantART

 

Creative Commons License
Some rights reserved. This work is licensed under a
Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.
Details
Submitted: June 6, 2008
File Size: 112 KB
Image Size: 242 KB
Resolution: 600×352
Comments: 0
Favourites & Collections: 0

Views
Total: 159
Today: 0

Downloads
Total: 12
Today: 0

Thumb

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:
[x]

Devious Comments

love 0 0 joy 0 0 wow 0 0 mad 0 0 sad 0 0 fear 0 0 neutral 0 0

Comments


No comments have been added yet.

Site Map