Example #1
0
    public void makeRandomMove()
    {
        clickDetection randomPosClick = grid.gridTiles[Random.Range(0, grid.gridTiles.Length - 1)].GetComponent <clickDetection>();

        if (randomPosClick.isAnO || randomPosClick.isAnX)
        {
            makeRandomMove();
            return;
        }
        else
        {
            randomPosClick.placeO();
        }
    }
Example #2
0
    public void makeHardMove()
    {
        int            oppositeIndexNumber = (grid.gridPositions.Length - 1) - grid.lastXPlaced.GetComponent <clickDetection>().indexInArray;
        clickDetection hardDecision        = grid.gridTiles[oppositeIndexNumber].GetComponent <clickDetection>();

        if (hardDecision.isAnO || hardDecision.isAnX)
        {
            makeRandomMove();
            return;
        }
        else
        {
            hardDecision.placeO();
        }
    }