Check out Grant Acedrex, our featured variant for April, 2024.


[ 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 ]

Comments/Ratings for a Single Item

Earlier Reverse Order Later
Shogi and legal moves[Subject Thread] [Add Response]
wdtr2 wrote on Wed, Jul 29, 2020 08:36 AM UTC:

I think there was a tweak somewhere. Shogi is not showing legal moves, nor does it allow you to move via mouse clicks.


🕸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.


2 comments displayed

Earlier Reverse Order Later

Permalink to the exact comments currently displayed.