Bug 734

Summary: The possible position generate for cannon is not as expected
Product: CS3343 Group 26 XiangQi Game Reporter: Tracy Puk <tcpuk2-c>
Component: DisplayAssignee: Teresa Fung <chinwfung3-c>
Status: RESOLVED FIXED    
Severity: major CC: likslee2-c
Priority: ---    
Version: unspecified   
Hardware: All   
OS: All   
Attachments: Possible position generated for cannon is not as expected

Description Tracy Puk 2022-11-25 13:15:16 HKT
Created attachment 134 [details]
Possible position generated for cannon is not as expected

- Steps to reproduce
1. start the game
2. player selects RC/BC to move

- Expected result
The possible moves for RC at h2
[i2,g2,f2,e2,d2,c2,h1,h3,h4,h5,h6,h9]


- Actual result
The possible moves for RC at h2
[i2,g2,f2,e2,d2,c2,h1,h0,h3,h4,h5,h6]
Comment 1 likslee2-c 2022-11-29 15:24:45 HKT
Updated function private void validationForCannonOrRook(Chess toMove) in class ChessBoard to solve the buog:
1) Correct the condition of while loop for validation of bottom positions
2) Change variable numOfChess to correct line
Comment 2 Teresa Fung 2022-11-30 15:03:55 HKT
Fixed by Tim