Check out Modern Chess, our featured variant for January, 2025.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Shogi and legal moves[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Wed, Jul 29, 2020 12:49 PM UTC in reply to wdtr2 from 08:36 AM:

It was the modification I made to how push works. The stalemated subroutine in shogi.txt was using push to create an array of legal moves instead of using the setlegal command. I guess I wrote that subroutine before I created the setlegal command. Anyway, it was putting a null character at the beginning of the legalmoves array, and that threw off the JavaScript code, which didn't know what to do with that null character. So, I made a correction to push to make sure a variable is set before moving its scalar value to the first element of an array, since unset variables have the scalar value of null.