Created
October 11, 2020 17:36
-
-
Save dynoChris/2d5d44d2ddd8a12479a1c90c82f75c88 to your computer and use it in GitHub Desktop.
Revisions
-
dynoChris created this gist
Oct 11, 2020 .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,29 @@ public class Repeater { private final int mEach; private int mLap; public Repeater(int each) { this.mEach = each; this.mLap = each; } public int getLap() { return mLap; } public boolean repeat() { if (mLap == mEach) { mLap = 1; return true; } else { mLap++; return false; } } public void reset() { mLap = mEach; } }