Bug 737

Summary: Wrong queen movement
Product: Chess Game - Group 24 Reporter: gsalter2-c
Component: ChessAssignee: Assan Kozhin <akozhin2-c>
Status: RESOLVED FIXED    
Severity: major CC: gsalter2-c
Priority: ---    
Version: unspecified   
Hardware: PC   
OS: Mac OS   

Description gsalter2-c 2022-11-28 00:58:55 HKT

    
Comment 1 gsalter2-c 2022-11-28 16:27:45 HKT
Steps to reproduce:
1. Run App.java
2. Make moves: 1. d4 d5 2. Qa5

Expected results:
Last move is a valid move, move should be executed.

Actual results:
Recognized as invalid move, move not executed.
Comment 2 gsalter2-c 2022-11-28 16:31:42 HKT
Reason:
Logic of queen movement didn't work properly on one edge case. When queen wants to move diagonally to the edge of the board, it can't.

Resolution:
Rewrite logic of code to check for edge cases, the reason was that in one specific case we used < operator instead of <=. Also, I rewrote code to use more concise for loop instead of while.

https://github.com/glennsalter/cs3343-chess/commit/8fd6d15523f7541b26fcd5c612faa29adc6eabc9