File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 32963296 "NORMALISE" : " The move needs to be normalised. Try '{{normalised}}'."
32973297 },
32983298 "byte" : {
3299+ "ADJ_ONLY" : " Stacks may only move to adjacent cells." ,
32993300 "DIAG_ONLY" : " Stacks may only move diagonally." ,
33003301 "INITIAL_INSTRUCTIONS" : " Select a stack to move. If merging stacks, select the bottom checker you wish to move." ,
33013302 "INVALID_INDEX" : " There is no checker at position {{index}} in the stack at {{where}}." ,
Original file line number Diff line number Diff line change @@ -377,6 +377,12 @@ export class ByteGame extends GameBase {
377377 result . message = i18next . t ( "apgames:validation._general.SAME_FROM_TO" ) ;
378378 return result ;
379379 }
380+ // must be adjacent
381+ if ( ! graph . neighbours ( from ) . includes ( to ) ) {
382+ result . valid = false ;
383+ result . message = i18next . t ( "apgames:validation.byte.ADJ_ONLY" ) ;
384+ return result ;
385+ }
380386 // can only move diagonally
381387 const [ tox , toy ] = graph . algebraic2coords ( to ) ;
382388 if ( tox % 2 === toy % 2 ) {
You can’t perform that action at this time.
0 commit comments