Exemplo n.º 1
0
 public Board_6x6(FocusBoard_4x4 focus)
 {
     this.focus          = focus;
     this.focus_sector_x = focus.getSectorX();
     this.focus_sector_y = focus.getSectorY();
     this.boardstate6x6  = focus.translateToBoardState6x6();
     this.solution       = 0;
 }
Exemplo n.º 2
0
    public Board_6x6 generateRandomDisplay()
    {
        FocusBoard_4x4 displayfocus    = new FocusBoard_4x4(this.focus.getBoard4x4State(), Random.Range(0, 3), Random.Range(0, 3));
        int            random_rotation = Random.Range(0, 4);

        for (int i = 0; i < random_rotation; i++)
        {
            displayfocus.rotateClockwise();
        }
        return(new Board_6x6(displayfocus));
    }
Exemplo n.º 3
0
    public Board_6x6(long boardstate6x6)
    {
        this.boardstate6x6 = boardstate6x6;

        int xshift = Random.Range(0, 3);
        int yshift = Random.Range(0, 3);
        int state  = (int)
                     (
            (((boardstate6x6 >> (6 * yshift + xshift + 0)) & 0xFL) << 0) |
            (((boardstate6x6 >> (6 * yshift + xshift + 6)) & 0xFL) << 4) |
            (((boardstate6x6 >> (6 * yshift + xshift + 12)) & 0xFL) << 8) |
            (((boardstate6x6 >> (6 * yshift + xshift + 18)) & 0xFL) << 12)
                     );
        FocusBoard_4x4 focus = new FocusBoard_4x4(state, xshift, yshift);

        this.focus    = focus;
        this.solution = focus.translateToBoardState6x6();
    }