@Override public void initialize(){
  board=null;
switch (simPaneCtrl.getParamValueIndex(PARAM_INIT_CONF)) {
case 0:
    board=new EightPuzzleBoard(new int[]{1,2,5,3,4,0,6,7,8});
  break;
case 1:
board=new EightPuzzleBoard(new int[]{1,4,2,7,5,8,3,0,6});
break;
case 2:
board=new EightPuzzleBoard(new int[]{0,8,7,6,5,4,3,2,1});
break;
case 3:
board=new EightPuzzleBoard(new int[]{0,1,2,3,4,5,6,7,8});
Random r=new Random(System.currentTimeMillis());
for (int i=0; i < 200; i++) {
switch (r.nextInt(4)) {
case 0:
board.moveGapUp();
break;
case 1:
board.moveGapDown();
break;
case 2:
board.moveGapLeft();
break;
case 3:
board.moveGapRight();
break;
}
}
}
stateViewCtrl.initialize(board);
}

@ Override public void initialize ( ) { board = null ; switch ( simPaneCtrl . getParamValueIndex ( PARAM_INIT_CONF ) ) { case 0 : board = new EightPuzzleBoard ( new int [ ] { 1 , 2 , 5 , 3 , 4 , 0 , 6 , 7 , 8 } ) ; break ; case 1 : board = new EightPuzzleBoard ( new int [ ] { 1 , 4 , 2 , 7 , 5 , 8 , 3 , 0 , 6 } ) ; break ; case 2 : board = new EightPuzzleBoard ( new int [ ] { 0 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 } ) ; break ; case 3 : board = new EightPuzzleBoard ( new int [ ] { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } ) ; Random r = new Random ( System . currentTimeMillis ( ) ) ; for ( int i = 0 ; i < 200 ; i ++ ) { switch ( r . nextInt ( 4 ) ) { case 0 : board . moveGapUp ( ) ; break ; case 1 : board . moveGapDown ( ) ; break ; case 2 : board . moveGapLeft ( ) ; break ; case 3 : board . moveGapRight ( ) ; break ; } } } stateViewCtrl . initialize ( board ) ; }
displays the initialized board on the state view .
