Bug 724

Summary: changing getBoard returning a clone instead of reference break the score caluation
Product: Group 9 Reporter: cklo36-c
Component: DecisionTreeAssignee: cklo36-c
Status: IN_PROGRESS ---    
Severity: major    
Priority: High    
Version: 1   
Hardware: PC   
OS: Windows   
Deadline: 2022-11-30   
Attachments: invalid score

Description cklo36-c 2022-11-22 22:09:18 HKT
Created attachment 128 [details]
invalid score

After update GameBoare.getBoard() function returning a clone of board instead of reference, AiPlayer minmax() gave invalid score causing AiPlayer cannot make the right move.

Further investigation shows that it may be caused by the recursion.
Comment 1 cklo36-c 2022-11-24 21:09:00 HKT
After investing, it seems that the recursion in minmax() needs the board reference to make the algorithm work properly.

Overriding getBoard() in DefaultGameBoard to return the reference seems to solve the problem