Bug 647

Summary: In the AI mode, after the snake first die, snake would always die
Product: CS3343 2021/22 Group16 Greedy Snake Reporter: Baron Qu <zhiyanqu2-c>
Component: Model sectionAssignee: Baron Qu <zhiyanqu2-c>
Status: RESOLVED FIXED    
Severity: critical CC: ruoxinli3-c
Priority: ---    
Version: Ver 3.0   
Hardware: PC   
OS: Windows   
Attachments: Related code to init coordinate

Description Baron Qu 2021-12-05 17:46:11 HKT

    
Comment 1 Baron Qu 2021-12-05 17:49:50 HKT
The AI snake object's coordinate has stored in an ArrayList. Original, after the snake first dies, the length would set be 3, but the remaining value stored in the ArrayList has not been clean. So when it starts again, it would be very fast to meet the original code, then die. So just initial the coordinate again is OK.
Comment 2 Baron Qu 2021-12-05 17:58:06 HKT
Created attachment 101 [details]
Related code to init coordinate