Bug 574

Summary: The program will produce more than 2 players
Product: CS3343 Chinese Checker Reporter: yutongmen2-c
Component: Algorithm ComponentAssignee: yutongmen2-c
Status: CONFIRMED ---    
Severity: minor CC: yutongmen2-c
Priority: ---    
Version: unspecified   
Hardware: All   
OS: All   
Attachments: The image indicates that more than 2 players are counted by the program.

Description yutongmen2-c 2021-11-18 00:33:36 HKT
Created attachment 88 [details]
The image indicates that more than 2 players are counted by the program.

The image indicates that more than 2 players are counted by the program.

The program prompt the 3rd player to play the move in turn 3.

Steps to reproduce:
1. Start the game.
2. Input 0 3
3. Choose 0 4
4. Input 0 4
5. Choose 1 3

Actual outcome:
The program prints: "Player 3 is playing."

Expected outcome:
The program prints: "Player 1 is playing."
Comment 1 yutongmen2-c 2021-11-18 00:35:10 HKT
Wrong Implementation:

System.out.println("Player " + TurnCounter.getTurn() + " is playing.");

Correct implementation:

System.out.println("Player " + (2 - TurnCounter.getTurn()%2) + " is playing.");