Bug 813 - Next Player is not updated when playing draw four card
Summary: Next Player is not updated when playing draw four card
Status: RESOLVED FIXED
Alias: None
Product: .CS3343 Group2 2324A Uno Game
Classification: Unclassified
Component: Game (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Assignee: tinloklee2-c
URL:
Depends on:
Blocks:
 
Reported: 2023-12-07 21:33 HKT by kaiskafel2-c
Modified: 2023-12-11 21:56 HKT (History)
0 users

See Also:


Attachments
Attachment: Color is not updated when playing draw four card (75.85 KB, image/jpeg)
2023-12-07 21:33 HKT, kaiskafel2-c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kaiskafel2-c 2023-12-07 21:33:05 HKT
The current card is GREEN 6, and user played Draw Four and change color to RED, but the current card changed into Draw Four (Green) as the previous card was GREEN 6

When the Draw Four card is played, the user will need to input the color that the user intend to, and the system will check the validity of the color passed by the user where it should be either Red, Green, Blue, or Yellow. Then, the system will update the current card to Draw Card (*new color passed by the user*)

Steps to reproduce:
1. Run the main function
2. Play the game until it is the user's turn, and user has the Draw Four card
3. Play the Draw Four Card and input the color to change

Expected result: the game will update the current color to the new color passed by the user (RED in this case)

Actual result: the game does not update the current card color to the new color passed by the user (still GREEN due to the previous current card: GREEN 6)
Comment 1 kaiskafel2-c 2023-12-07 21:33:52 HKT
Created attachment 162 [details]
Attachment: Color is not updated when playing draw four card
Comment 2 tinloklee2-c 2023-12-07 22:20:23 HKT
I will try to resolve the problem. Please also provide the seed of the game if possible.
Comment 3 tinloklee2-c 2023-12-07 22:47:00 HKT
Found seed 210376603 with the problem. (didn't have this problem in our previous code :/, or in my own branch)
Comment 4 tinloklee2-c 2023-12-08 16:45:37 HKT
Problem found. This is caused by game.getNextPlayer() falsely skipping 2 players. The actual target still drew the cards but since the game skipped 2 players, it appeared to us that the next player did not draw cards.

Thank you for your debugging efforts!
Comment 5 kaiskafel2-c 2023-12-10 01:51:56 HKT
(In reply to kaiskafel2-c from comment #0)
> The current card is GREEN 6, and user played Draw Four and change color to
> RED, but the current card changed into Draw Four (Green) as the previous
> card was GREEN 6
> 
> When the Draw Four card is played, the user will need to input the color
> that the user intend to, and the system will check the validity of the color
> passed by the user where it should be either Red, Green, Blue, or Yellow.
> Then, the system will update the current card to Draw Card (*new color
> passed by the user*)
> 
> Steps to reproduce:
> 1. Run the main function
> 2. Play the game until it is the user's turn, and user has the Draw Four card
> 3. Play the Draw Four Card and input the color to change
> 
> Expected result: the game will update the current color to the new color
> passed by the user (RED in this case)
> 
> Actual result: the game does not update the current card color to the new
> color passed by the user (still GREEN due to the previous current card:
> GREEN 6)

The actual error is that the next Player does not draw cards after Draw Four Card is played, and it is now solved.