Hi, i am a newb trying to learn how to make websites and i'm having troubles with a chess board i'm trying to make.
The point is that i want to be able to create lessons with it for children, as in make a specific setup and have one (or more, if possible)
specific move(s) give a different result (like a popup-box or something) then a wrong move. I copied a drag and drop chessboard from the inet
which i got figured out. But don't know how to create a "good move" and a "bad move". Here is some of the code:
this is only the first field this goes on with b8 c8 etc... </tr> <tr> a7 b7 etc...
as u can see i am using html5 drag and drop for the piece-moving and a table to create the field, is it possible to create a if...else statement inside the drop functon
to make only a specific piece able to accually be dropped (but maintain the ability to drag the other pieces)
See this old pages chess.htm or ChesNew.htm which work only with IE but who allow to copy to paste parties and to try to resolve problems.... They are to translate and redo completly... Good Look !
I modified the page chess.htm which work now with Mozillia FireFox and other modern browsers and allow (with a little of patience for loading) to play many games...
Thank you for indicating me the possible bugs !
There is not a very good script. It gathers not homogeneous pieces and probably redundant variables...
One remarks : It is useless to use a two dimensional array or a table to represent the game, an unidimensional array (and calculations with the quotients and the rest of the division of integers if necessary) with margins an border case (theBord[i]='OO' in the script) allow to avoid multiple tests.
The use of well chosen objects should allow to build a better script...
Bookmarks