Bug 500 - There will be one extra "Please enter your move(eg: 1 3 W): " appeared after choosing map
Summary: There will be one extra "Please enter your move(eg: 1 3 W): " appeared after ...
Status: CONFIRMED
Alias: None
Product: CandyCrush 2020
Classification: Unclassified
Component: Source Code (show other bugs)
Version: 3.0
Hardware: PC Windows
: --- enhancement
Assignee: jli262-c
URL:
Depends on:
Blocks:
 
Reported: 2020-11-29 11:36 HKT by jli262-c
Modified: 2020-11-29 15:05 HKT (History)
0 users

See Also:


Attachments
This is the class where the bug comes from (2.66 KB, text/plain)
2020-11-29 11:39 HKT, jli262-c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jli262-c 2020-11-29 11:36:30 HKT
Summary: 
The bug is found after the user chooses the map he wants to play.

Steps to Reproduce:
1. Run the program;
2. Input preferred map "1"

Actual Results:
Please choose the map you want to play(eg: 1): 
2
Refreshing the map
  1 2 3 4 5 6 7 8
 /----------------
1|& @ $ % 5 @ $ 2
2|# % $ # $ $ 1 @
3|& # % 1 & $ # &
4|@ % 2 ~ ~ 4 @ &
5|$ % & ~ ~ $ & #
6|1 # # 3 @ % % &
7|# & & $ & & @ #
8|# $ # & $ % # $

Please enter your move(eg: 1 3 W): 
Please enter your move(eg: 1 3 W): 

Expected Results:
Please choose the map you want to play(eg: 1): 
2
Refreshing the map
  1 2 3 4 5 6 7 8
 /----------------
1|& @ $ % 5 @ $ 2
2|# % $ # $ $ 1 @
3|& # % 1 & $ # &
4|@ % 2 ~ ~ 4 @ &
5|$ % & ~ ~ $ & #
6|1 # # 3 @ % % &
7|# & & $ & & @ #
8|# $ # & $ % # $

Please enter your move(eg: 1 3 W):
Comment 1 jli262-c 2020-11-29 11:39:56 HKT
Created attachment 63 [details]
This is the class where the bug comes from
Comment 2 jli262-c 2020-11-29 12:06:47 HKT
(In reply to jli262-c from comment #0)
> Summary: 
> The bug is found after the user chooses the map he wants to play.
> 
> Steps to Reproduce:
> 1. Run the program;
> 2. Input preferred map "1"
> 
> Actual Results:
> Please choose the map you want to play(eg: 1): 
> 2
> Refreshing the map
>   1 2 3 4 5 6 7 8
>  /----------------
> 1|& @ $ % 5 @ $ 2
> 2|# % $ # $ $ 1 @
> 3|& # % 1 & $ # &
> 4|@ % 2 ~ ~ 4 @ &
> 5|$ % & ~ ~ $ & #
> 6|1 # # 3 @ % % &
> 7|# & & $ & & @ #
> 8|# $ # & $ % # $
> 
> Please enter your move(eg: 1 3 W): 
> Please enter your move(eg: 1 3 W): 
> 
> Expected Results:
> Please choose the map you want to play(eg: 1): 
> 2
> Refreshing the map
>   1 2 3 4 5 6 7 8
>  /----------------
> 1|& @ $ % 5 @ $ 2
> 2|# % $ # $ $ 1 @
> 3|& # % 1 & $ # &
> 4|@ % 2 ~ ~ 4 @ &
> 5|$ % & ~ ~ $ & #
> 6|1 # # 3 @ % % &
> 7|# & & $ & & @ #
> 8|# $ # & $ % # $
> 
> Please enter your move(eg: 1 3 W):

The extra "Please enter your move(eg: 1 3 W): " appeared because the getUserInput() will get one "Enter" at first,which is not a valid input. There fore, add a scanner.next() to remove the "Enter", and the bug can be solved.