You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to understand the code in onDragStart Preven Drag. I specifically want to ask what does piece.search(/^w/) mean? Is there any document that I can read? I am right now having a bug that when the player is in check, he cannot make any move. atthattime game.turn() === 'w' and piece.search(/^w/) === 0. Below is my onDragStart function. Could you please help me understanding this? Thank you so much!
"I specifically want to ask what does piece.search(/^w/) mean? "
It checks every string which starts with "w". That's mean It checks whether It was a white piece or not, for example wK, w,Q, wN, wB, wR, wP,
Hi, I am trying to understand the code in onDragStart Preven Drag. I specifically want to ask what does
piece.search(/^w/)
mean? Is there any document that I can read? I am right now having a bug that when the player is in check, he cannot make any move. atthattimegame.turn() === 'w'
andpiece.search(/^w/) === 0
. Below is my onDragStart function. Could you please help me understanding this? Thank you so much!The text was updated successfully, but these errors were encountered: