Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Vector<int[]> getStates(int[] actual)
- {
- Vector<int[]> states = new Vector<int[]>();
- int temp[] = new int[4];
- if(actual[0] == 1)
- actual[0] = 0;
- else
- actual[0] = 1;
- temp = actual;
- //printArray(actual);
- printArray(temp);
- states.add(temp);
- for(int i = 1 ; i < 4 ; i++)
- {
- if(actual[0] == 1)
- {
- if(actual[i] == 0)
- {
- temp[i] = 1;
- }
- }else{
- if(actual[i] == 1)
- {
- temp[i] = 0;
- }
- }
- states.add(temp);
- printArray(temp);
- if(actual[i] == 1)
- temp[i] = 0;
- else
- temp[i] = 1;
- }
- return states;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement