Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package testStuff;
- public class TestStuff {
- static boolean[] A = {false, false, false};
- static boolean[] B = {!A[0], !A[1], !A[2]};
- public static void main(String[] args) {
- for(int i=0; i<8; i++) {
- B[0] = !A[0];
- B[1] = !A[1];
- B[2] = !A[2];
- double opposite = 0;
- for(int a=0; a<3; a++) {
- for(int b=0; b<3; b++) {
- if(A[a] != B[b]) opposite++;
- }
- }
- opposite /= 9;
- System.out.println("Opposite: " + opposite);
- if(A[2]==false) A[2]=true;
- else if(A[1]==false) {
- A[1]=true;
- A[2]=false;
- }
- else if(A[0]==false) {
- A[0]=true;
- A[1]=false;
- A[2]=false;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement