Created
October 31, 2011 06:29
-
-
Save ellbur/1327011 to your computer and use it in GitHub Desktop.
Alternating...
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
| public class Cells { | |
| public static void main(String[] args) { | |
| int[] data = { 0, 1, 1, 0, 1, 0 }; | |
| System.out.println(java.util.Arrays.toString(data)); | |
| int[] data2 = new int[data.length]; | |
| for (int i=0; i<data.length; i++) { | |
| if (data[i] == 1) { | |
| data2[i] = 0; | |
| } | |
| else { | |
| data2[i] = 1; | |
| } | |
| } | |
| System.out.println(java.util.Arrays.toString(data2)); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment