This is a project for my college programming class, I feel like I am almost done with everything as most of the programming is done. The purpose is to play "Nim" or removing the toothpicks until a player removes the last one and that player loses. It may be a simple mistake, but I can't figure out how to get *matches* to show the change throughout the program. I think it may be a simple mistake, but any help would be awesome. 

Thanks!

```
package cs160.project2;

import java.util.Scanner;

public class CS160Project2 {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    System.out.println("Welcome to my game of Nym");
    int playerFirst = 1;     //(int) (Math.random() * 2) + 1;
    int matches;
    if (playerFirst == 1) {
        System.out.println("This time the computer will go first.");
        System.out.println("You may choose the number of toothpicks, This number must be bigger than 20 and less than 30.");
        Scanner keyboard = new Scanner(System.in);
        matches = keyboard.nextInt();
        if (matches <= 20 || matches > 29) {
            System.out.println("sorry but that cannot be an input please enter another number between 20 and 30.");
            matches = keyboard.nextInt();
        }
        System.out.print(matches);
        do {
            computerTurn(matches);
            playerTurn(matches);
        } while (matches > 0);
    }
    if (playerFirst == 2) {

    }
}

public static void playerTurn(int matches) {
    System.out.print("How many toothpicks do you want to remove? ");
    int input = 0;
    Scanner keyboard = new Scanner(System.in);
    input = keyboard.nextInt();
    while (input<=0||input>=4){
        System.out.println("Please enter a number between 1 and 3: ");
        input=keyboard.nextInt();
    }
    if (input > 0 && input < 4) {
        matches=matches-input;
    }

}

public static void computerTurn(int matches) {

    if (matches == 1) {
        System.out.println("I, the Computer will take the last toothpick, and YOU WIN!");
        matches = matches - 1;
        return;
    }
    if (matches == 2) {
        matches = matches - 1;
        System.out.println("My turn. There are 2 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there is 1 toothpick left.");
    }
    if (matches == 3) {
        matches = matches - 2;
        System.out.println("My turn. There are 3 toothpicks left. I, the Computer, will remove 2 of them.");
        System.out.print("Your turn, there is 1 toothpick left.");
    }
    if (matches == 4) {
        matches = matches - 3;
        System.out.println("My turn. There are 4 toothpicks left. I, the Computer, will remove 3 of them.");
        System.out.print("Your turn, there is 1 toothpick left.");
    }
    if (matches == 5) {
        matches = matches - 1;
        System.out.println("My turn. There are 5 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 4 toothpick left.");
    }
    if (matches == 6) {
        matches = matches - 1;
        System.out.println("My turn. There are 6 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 5 toothpick left.");
    }
    if (matches == 7) {
        matches = matches - 2;
        System.out.println("My turn. There are 7 toothpicks left. I, the Computer, will remove 2 of them.");
        System.out.print("Your turn, there are 5 toothpick left.");
    }
    if (matches == 8) {
        matches = matches - 3;
        System.out.println("My turn. There are 8 toothpicks left. I, the Computer, will remove 3 of them.");
        System.out.print("Your turn, there are 5 toothpick left.");
    }
    if (matches == 9) {
        matches = matches - 1;
        System.out.println("My turn. There are 9 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 8 toothpick left.");
    }
    if (matches == 10) {
        matches = matches - 1;
        System.out.println("My turn. There are 10 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 9 toothpick left.");
    }
    if (matches == 11) {
        matches = matches - 2;
        System.out.println("My turn. There are 11 toothpicks left. I, the Computer, will remove 2 of them.");
        System.out.print("Your turn, there are 9 toothpick left.");
    }
    if (matches == 12) {
        matches = matches - 3;
        System.out.println("My turn. There are 12 toothpicks left. I, the Computer, will remove 3 of them.");
        System.out.print("Your turn, there are 9 toothpick left.");
    }
    if (matches == 13) {
        matches = matches - 1;
        System.out.println("My turn. There are 13 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 12 toothpick left.");
    }
    if (matches == 14) {
        matches = matches - 1;
        System.out.println("My turn. There are 14 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 13 toothpick left.");
    }
    if (matches == 15) {
        matches = matches - 2;
        System.out.println("My turn. There are 15 toothpicks left. I, the Computer, will remove 2 of them.");
        System.out.print("Your turn, there are 13 toothpick left.");
    }
    if (matches == 16) {
        matches = matches - 3;
        System.out.println("My turn. There are 16 toothpicks left. I, the Computer, will remove 3 of them.");
        System.out.print("Your turn, there are 13 toothpick left.");
    }
    if (matches == 17) {
        matches = matches - 1;
        System.out.println("My turn. There are 17 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 16 toothpick left.");
    }
    if (matches == 18) {
        matches = matches - 1;
        System.out.println("My turn. There are 18 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 17 toothpick left.");
    }
    if (matches == 19) {
        matches = matches - 2;
        System.out.println("My turn. There are 19 toothpicks left. I, the Computer, will remove 2 of them.");
        System.out.print("Your turn, there are 17 toothpick left.");
    }
    if (matches == 20) {
        matches = matches - 3;
        System.out.println("My turn. There are 20 toothpicks left. I, the Computer, will remove 3 of them.");
        System.out.print("Your turn, there are 17 toothpick left.");
    }
    if (matches == 21) {
        matches = matches - 1;
        System.out.println("My turn. There are 21 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 20 toothpick left.");
    }
    if (matches == 22) {
        matches = matches - 1;
        System.out.println("My turn. There are 22 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 21 toothpick left.");
    }
    if (matches == 23) {
        matches = matches - 2;
        System.out.println("My turn. There are 23 toothpicks left. I, the Computer, will remove 2 of them.");
        System.out.print("Your turn, there are 21 toothpick left.");
    }
    if (matches == 24) {
        matches = matches - 3;
        System.out.println("My turn. There are 24 toothpicks left. I, the Computer, will remove 3 of them.");
        System.out.print("Your turn, there are 21 toothpick left.");
    }
    if (matches == 25) {
        matches = matches - 1;
        System.out.println("My turn. There are 25 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 24 toothpick left.");
    }
    if (matches == 26) {
        matches = matches - 1;
        System.out.println("My turn. There are 26 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 25 toothpick left.");
    }
    if (matches == 27) {
        matches = matches - 2;
        System.out.println("My turn. There are 27 toothpicks left. I, the Computer, will remove 2 of them.");
        System.out.print("Your turn, there are 25 toothpick left.");
    }
    if (matches == 28) {
        matches = matches - 3;
        System.out.println("My turn. There are 28 toothpicks left. I, the Computer, will remove 3 of them.");
        System.out.print("Your turn, there are 25 toothpick left.");
    }
    if (matches == 29) {
        matches = matches - 1;
        System.out.println("My turn. There are 29 toothpicks left. I, the Computer, will remove 1 of them.");
        System.out.print("Your turn, there are 28 toothpick left.");
    }
}

}

```