Advertisement
VincentOostelbos

Testing spin plans

Oct 5th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. package testStuff;
  2.  
  3. public class TestStuff {
  4.     static boolean[] A = {false, false, false};
  5.     static boolean[] B = {!A[0], !A[1], !A[2]};
  6.    
  7.     public static void main(String[] args) {
  8.         for(int i=0; i<8; i++) {
  9.             B[0] = !A[0];
  10.             B[1] = !A[1];
  11.             B[2] = !A[2];
  12.             double opposite = 0;
  13.             for(int a=0; a<3; a++) {
  14.                 for(int b=0; b<3; b++) {
  15.                     if(A[a] != B[b]) opposite++;
  16.                 }
  17.             }
  18.             opposite /= 9;
  19.             System.out.println("Opposite: " + opposite);
  20.            
  21.             if(A[2]==false) A[2]=true;
  22.             else if(A[1]==false) {
  23.                 A[1]=true;
  24.                 A[2]=false;
  25.             }
  26.             else if(A[0]==false) {
  27.                 A[0]=true;
  28.                 A[1]=false;
  29.                 A[2]=false;
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement