File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,7 @@ export class PenguinGame extends GameBase {
346346 throw new Error ( "Unable to parse move" ) ;
347347 }
348348 m = parsed . normalized ;
349+ console . log ( `parsed: ${ JSON . stringify ( parsed ) } ` )
349350
350351 if ( m . length === 0 ) {
351352 result . valid = true ;
@@ -361,7 +362,7 @@ export class PenguinGame extends GameBase {
361362 // if no turns were provided, and the piece is not standing
362363 // then not yet complete
363364 let complete : 0 | 1 | - 1 | undefined = 1 ;
364- if ( ( parsed . turnDir === undefined || parsed . turnNum === undefined ) && this . ball !== parsed . cell ) {
365+ if ( ( parsed . turnDir === undefined || parsed . turnNum === undefined ) && ( parsed . cell === undefined || this . ball !== parsed . cell ) ) {
365366 const cloned = this . clone ( ) ;
366367 const exe = cloned . executeMove ( m ) ;
367368 if ( cloned . board . has ( exe . endCell ! ) ) {
You can’t perform that action at this time.
0 commit comments