Bug 734 - The possible position generate for cannon is not as expected
Summary: The possible position generate for cannon is not as expected
Status: RESOLVED FIXED
Alias: None
Product: CS3343 Group 26 XiangQi Game
Classification: Unclassified
Component: Display (show other bugs)
Version: unspecified
Hardware: All All
: --- major
Assignee: Teresa Fung
URL:
Depends on:
Blocks:
 
Reported: 2022-11-25 13:15 HKT by Tracy Puk
Modified: 2022-11-30 15:03 HKT (History)
1 user (show)

See Also:


Attachments
Possible position generated for cannon is not as expected (73.60 KB, image/jpeg)
2022-11-25 13:15 HKT, Tracy Puk
Details

Note You need to log in before you can comment on or make changes to this bug.
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