Last active
August 29, 2015 14:24
Revisions
-
gchriswill revised this gist
Jul 11, 2015 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ // Created on 6/2/15 by Christopher Gonzalez D.K.A. @gchriswill https://github.com/JWShroyer // Reviewed and optimyzed by Josh Shroyer D.K.A @JWShroyer https://github.com/JWShroyer // Last revision on 7/11/15 by @gchriswill and @JWShroyer -
gchriswill created this gist
Jul 11, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ // Created on 6/2/15 by Christopher Gonzalez D.K.A. @gchriswill https://github.com/JWShroyer // Reviewed and optimyzed by Josh Shroyer D.K.A @JWShroyer https://github.com/JWShroyer // Last revision on 7/11/15 by @gchriswill and @JWShroyer extension Array { mutating func countForward(inout counter c: Int) -> Void { var s = self.count - 1 c = c < s && !(0 > c) ? (c + 1) : 0 } mutating func countBackward(inout counter c: Int) -> Void { var s = self.count - 1 c = 0 >= c || c > s ? s : (c - 1) } }