File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -334,16 +334,20 @@ snakeEx.isClosure = function(token)
334
334
{
335
335
return token . type == this . TOK_SPECIAL && ( token . token == '*' || token . token == '?' || token . token == '+' || token . token == '%' ) ;
336
336
}
337
+
338
+ /// true if the specified string describes a direction or set of directions
337
339
snakeEx . isDirection = function ( str )
338
340
{
339
341
for ( var c = 0 ; c < str . length ; c ++ )
340
342
{
341
343
var ch = str . charAt ( c ) ;
342
- if ( ch !== 'R' && ch !== 'L' && ch != 'F' && ch != 'B' && ch != 'P' && ch != 'T' )
344
+ if ( ch !== 'R' && ch !== 'L' && ch != 'F' && ch != 'B' && ch != 'P' && ch != 'T' && ch != 'X' )
343
345
return false
344
346
}
345
347
return true ;
346
348
}
349
+
350
+ /// true if the specified special character describes a direction
347
351
snakeEx . isSpecialDirection = function ( str )
348
352
{
349
353
return str == '*' || str == '+' || str == '.' || str == '!' ;
You can’t perform that action at this time.
0 commit comments