![]() |
|
QBJS - Chess API - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: QBJS, BAM, and Other BASICs (https://qb64phoenix.com/forum/forumdisplay.php?fid=50) +--- Thread: QBJS - Chess API (/showthread.php?tid=4453) |
RE: QBJS - Chess API - TempodiBasic - 02-09-2026 More feedback the issue is related to checkmate ![]() ----------------------- about interface: 6. it is not clear how to change the move that you are doing... only with an attempt I got that if a type a wrong input endmove the program let me choose another start move. 7. it needed a list of moves made, better if a list in two columns 8. Takeback is not available Good Job, expert level is stimulating also if the waiting time is a bit hypnotic. (In this it remembers me the waiting time of BattleChess.) RE: QBJS - Chess API - TempodiBasic - 02-09-2026 @Bplus Mark that work has been a joyful experience nevertheless the IA Engine . A good experience to translate a previous code made for console output in a graphic interface with mouse support, adaptable interface to view side, of player, the setup of a specific position of game, and let working IA engine for both sides. Do you remember how well it danced tango when it played against itself? :-) LOL RE: QBJS - Chess API - dbox - 02-09-2026 (02-09-2026, 01:17 AM)TempodiBasic Wrote: More feedbackThanks for all the great feedback! Looks like I didn't test the win condition enough. I've made some updates to fix this and provide a clearer game over message. I've posted an update to the chess API to add the following methods: RemovePiece Removes a piece from the board at the specified location. Code: (Select All)
SetPiece Sets a piece at the specified board location. Code: (Select All)
These methods make it a lot easier to test out different scenarios and end states. History Returns a listing of all moves from the current game. Code: (Select All)
Here's the latest version with the changes: As far as all of the other UI suggestions, I thought they were great. Feel free to use this as a starting point. I'd love to see a @TempodiBasic version. RE: QBJS - Chess API - dbox - 02-10-2026 I created a consolidated programming reference for the Chess API here: https://github.com/boxgaming/qbjs-lib/blob/main/chess/js-chess-engine.md RE: QBJS - Chess API - bplus - 02-10-2026 lunch and a win for desert! RE: QBJS - Chess API - dbox - 02-10-2026 (02-10-2026, 05:53 PM)bplus Wrote: lunch and a win for desert!Well played! I think you’re ready for level 2. RE: QBJS - Chess API - bplus - 02-10-2026 LOL only at lunch time! +1 I really like this Chess connection one of these days I will workup a proper interface with mouse, if someone else doesn't get there first. I wonder if we can even work out an Undo, we can probably replay a game up to the previous last move. I was wondering about an Undo when I started to move one piece but saw a better move, possibly, with another piece; though I won anyway. RE: QBJS - Chess API - dbox - 02-11-2026 (02-10-2026, 11:14 PM)bplus Wrote: +1 I really like this Chess connection one of these days I will workup a proper interface with mouse, if someone else doesn't get there first.I'd love to see a bplus version! RE: QBJS - Chess API - bplus - 02-11-2026 me too! RE: QBJS - Chess API - bplus - 02-12-2026 @dbox once again QBJS does not like something that works perfectly in QB64. Code: (Select All) Function GetMove$ BTW I had to Dim all my variables in the function GetMove$ to get it accepted by QBJS. I thought you fixed all that! After adding the above routine I commented out the input line in chess program and used GetMove$ to accept mouse clicks or keypresses. Here is test GetMove$ for QB64, I sim the screen QBJS writes looks like screen 0 as not screen statements say otherwise is that the problem? QBJS has no screen 0. BTW _MouseX and _MouseY in screen 0 of QB64 does char cells not pixels, same with QBJS. Otherwise I dont know why the codes perfectly in QB64 but not QBJS???? Code: (Select All) ' test qbjs get move for chess ' b+ 2026-02-12Note: it does takes the keypresses from the GetMove$ function but you have to Edit above, add () to GetMove function. But the point of all my labors today was todo mouse clicks! ![]() |