Created
January 12, 2012 07:19
-
-
Save sdether/1599213 to your computer and use it in GitHub Desktop.
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 characters
| class Exponentiator { | |
| public static IEnumerator Coroutine(Coordinator<int[]> coordinator) { | |
| while(true) { | |
| if(coordinator.State == null) { | |
| continue; | |
| } | |
| if(coordinator.State.Length == 0) { | |
| Console.WriteLine("consumer finished, end of input"); | |
| yield break; | |
| } | |
| for(int i = 0; i < coordinator.State.Length; i++) { | |
| var item = coordinator.State[i]; | |
| coordinator.State[i] = item * item; | |
| } | |
| yield return coordinator; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment