Bug 255

Summary: unable to output Nine Gate Hand
Product: Mahjong Calculator Reporter: Wong Jyu Fung <jfwong3-c>
Component: MahjongAssignee: Wong Jyu Fung <jfwong3-c>
Status: RESOLVED FIXED    
Severity: critical CC: kinlokho2-c
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Attachments: Captured screen of incorrect output for test case "Nine Gate Hand"

Description Wong Jyu Fung 2018-11-13 22:57:12 HKT
When we input the a string which is considered as a nine chain in Mah Jong. The bug occur in this time.

expected result:
The output of points would be 13 and the name of the win would be 'nine chain'

actual result: 
The output of points only 7 and the is the name of the win just become 'all one suit'
Comment 1 kinlokho2-c 2018-11-14 09:53:08 HKT
[Modified version]

Description:
When we input a set of tiles which should be able to complete the 'nine gate hand' into the Mahjong calculator. We discovered that the output result is not the hand type we want.

How to reproduce:
1. Input 14 tiles in the mahjong calculator which can fulfill the rule -
   " Hand in any one suit (characters / bamboo / dot) consisting of 
   1112345678999, must be totally concealed".
2. Submit to check the hand type and its fan point.

Expected result:
The output of points should be 13 and the name of the hand type should be 'nine gate hand'

Actual result: 
The output of points is only 7 and the name of the hand type become 'all
one suit'.
Comment 2 Wong Jyu Fung 2018-11-18 21:41:18 HKT
I have we check the winTracker Class and I found that the program is actually missing the checking of Nine chain. Therefore, It was unable to check the nine chain. 

After we add the check nine chain after the check All one suit. Therefore, it's now able to check the nine chain and the actual outcome match the expected outcome
Comment 3 kinlokho2-c 2018-11-18 21:54:17 HKT
I have rechecked the winTracker Class and I found that the program actually misses the checking of Nine Gate Hand. Therefore, It was unable to
output the correct name of hand type. 

After editing the code in class WinTracker to check "Nine Gate Hand" right after the "All one suit"

	private void checkNineGate() {
		if(MJUtil.isNineGate(win)) {
			new CountNineGate().count();
		} else {
			checkAllTriplet(true);
		}
	}

As a result, the system is able to check the Nine Gate Hand now and the actual outcome matches the expected outcome.
Comment 4 kinlokho2-c 2018-11-18 22:00:31 HKT
Description:
When we input a set of tiles which should be able to complete the 'nine gate hand' into the Mahjong calculator. We discovered that the output result is not the hand type we want.

How to reproduce:
1. Input 14 tiles which can fulfill the rule -
   " Hand in any one suit (characters / bamboo / dot) consisting of 
   1112345678999, must be totally concealed".
2. Select tab "Run", following by option "Run" in Eclipse Java Oxygen(version 3a)

Expected result:
The output of points should be 13 and the name of the hand type should be 'nine gate hand'

Actual result: 
The output of points is only 7 and the name of the hand type become 'all one suit'.

Possible cause:
Revised the code whether checking the "Nine Gate Hand" is missing or not in class WinTracker or class MJUtil.
Comment 5 kinlokho2-c 2018-11-25 22:11:13 HKT
Created attachment 21 [details]
Captured screen of incorrect output for test case "Nine Gate Hand"