A bug appears in the function checkPattern(Hand hand) of MixSuit.java which the function cannot handle the case of unsorted hand. When checking an unsorted hand pattern of mix suit, the expected output is supposed to be true. However, the actual output is false. By tracing the code, a possible reason is that the program takes the first tile as a suit checking tile. As a result, if the suit of the first tile is not character, bamboo or dot, such as red dragon, the program will go to the else statement which returns false. To resolve the bug, it is suggested to loop through the tile in the hand to find the suit of character, bamboo or dot, then use the suit for checking. If the program cannot find any suit of character, bamboo or dot, return false.
Thank you for raising the problem. It seems that the problem is caused by unsorted hand and incorrectly assigned variable. To solve the problem, the program will first enter the loop finding a suit of Character, Bamboo or Dot, rather than choosing the first element in ArrayList<tile> since it is not sorted. It will be included in the next release(2.0) as a patch, with another possible bug fixing.