I was playing with
To me it seems not difficult to implement this interface in Tiddlywiki!
Using button, CSS, and SVG and some scripts behind!
I like to know if there are such games implemented in Tiddlywiki, specially Chess!
I was playing with
To me it seems not difficult to implement this interface in Tiddlywiki!
Using button, CSS, and SVG and some scripts behind!
I like to know if there are such games implemented in Tiddlywiki, specially Chess!
Yes
https://Telumire.github.io/TiddlyTweaks/index.html#:[[Chess]]
I just copy/pasted the code from 1K Javascript Tiny Chess by Ăscar Toledo G. ©2010 in an iframe on my wiki. His code is so tiny, itâs incredible âŠ
Chess.tid (1.4 KB)
@telumire interesting implementation, provisioning scripts inside an iFrame, I see the bulk comes from the inclusion of the tiny_chess_1.html. I assume a copy of which could be stored along side a single file wiki?
I am interested in being able to publish other javascript in tiddlywiki even if it remains sandboxed in an iframe.
Perhaps at most we may copy and paste results into the wiki can you provide any generic guidance? In a new thread if necessary. Only if you have the time of course.
Back on August 16th: Just a goofy thought: a way to get javascript into a Tiddler
Really easy.
Slap HTML and javascript into a tiddler, and feed the content of that tiddler as ifameâs srcdoc parameter value .
As a fun project for somebody having the time, the chess game could definitely be developed with native TiddlyWiki + HTML + CSS.
And that would be very cool.
I have nothing more to add beyond what @Charlie_Veniot said
The proper way would be to create a wikitext or javascript macro but I just wanted to share this amazing little snippet of js. I donât understand how it works (yet), so I probably wont be the one adapting it the âtiddlywikiâ way ⊠but Iâd love to see it !
Hmm, doesnât seem to understand castling.
EDIT: Or en passant.
Yes he had to remove these features to met the challenge of writing a chess engine under 1Ko :
I had news of the contest in August 8 and came to my mind the challenge of writing a chess in 1K of Javascript, so based on my 2.2K Javascript chess in six hours I managed to crunch it to 1K. I had to remove castling, en passant and limit promotion to queen, leaving a simple chessboard with letters for chessmen, click in origin square and target square to move pieces.
I think this is the 2.2K version heâs talking about :
https://nanochess.org/archive/toledo_javascript_chess_3.html
Full article : Toledo Javascript Chess Game
PS: hereâs the license, for those of you whoâd like to make a proper port to tiddlywiki :
License terms for your Javascript chess?
It is free for non-commercial use, this includes all the forks, even those under the GPL as legally Iâm the original author.
Please cite my name and website in any derivative source code or webpage where it is used. I would be glad to receive an e-mail telling me where you used it.
If you want to do commercial usage, just write me and we can reach a reasonable agreement.
In abstract terms, some of Cadburyâs APL folk managed it in a single line of vector rules in 1980, albeit with no strategy constraints, so the answer must be yes.
Sound interesting, what do you mean by that ? Can you provide a link to a paper or article explaining that concept/showcasing it ?
It is certainly possible. I havenât seen it or done it but I made the small interactive fiction game which had rules about as complex as chess.
I have been working on a movable grid macro in tiddlywiki that I am planning on using as a menu or alternate to the story river layout, but it could be used for chess once it is cleaned up a bit more and the logic for the rules is put into it.
As it is the thing I made uses just core widgets and some css and you can build a checkers or chess board with it, but there isnât any rules checking so you can move pieces however you want.
I think that the host I use for my demo wikis is having caching problems or something like that so the example wiki isnât showing up, I will post here when I figure out how to fix it.
I have seen a chess plugin before. Not much logic but you can play against it, and possibly win. I will share If I find it.
It is an interesting idea. TBH Iâd benefit not so much by live gaming as live illustration of Kasparovâs moves âŠ
Just a comment
TT
My hosting thing decided that it would work again, so here is the site with the demo.
This is great Jed, the eventcatcher/table combo has a lot of possibilities for games and Iâve noticed with some experiments of my own that, when hosted on Bob, it allows multi-player connections. i.e 2 players can move pieces on the same game from different machines on the same network. (At least on my local network, I havenât tried it on an internet exposed wiki).
There is a lot to study and learn from in your macro. Thanks a lot. Not everything works for me yet on mobile/tablet (canât drag the pucks on an ipad or android, but can drag the icons in the example below it). It might be the âmouse up/downâ that the touch screen doesnât like, Iâm not sure. I have had success with âon clickâ with eventcatcher in my own experiments but I donât have the ability to implement drag and drop and my mobile doesnât like it anyway.
If youâre interested the experiment is here.
https://wattaged.github.io/popmap/#Popmap
Try it on a tablet or mobile and tap the first button on the âdashâ - set active pin to 1, close and tap the screen to move the pin about.
Itâs not a game but Itâs another example of game-like action using eventcatcher with a table. I guarantee that you are much better equiped to develop these possibilities. As you will see my âcodeâ is a mess and I am currently stuck on fixing pin positions relative to different screen sizes. Progress has stalled. I will study your methods and maybe try and take it further.
Best wishes
Apologies for necroposting, I found the thread by searching on Google. While Iâm not interested to play chess in TiddlyWiki, a TidlyWiki alternative to a chess database like scid is certainly something Iâd be very tempted to use. A TiddlyWiki that could do stuff like:
That sounds quite doable, integrating tools like chessjs and chessboard.js Annotations might be awkward if theyâre not just to be folded into the PGN but if they can be kept separate, it would be useful. (âFischer said this about that game. Here was Spasskyâs take. And years later, Kasparov analyzed it to find this variant. My own analysis (with a little help from Stockfish) looks like this.â All pointing to the same PGN tiddler.)
The big difficulty is that I would expect a good chess database to be able to search positions. So this might be able to answer that, âyes, this position was reached in Tal-Korchnoi, 1992 (id #1234567), move 39.â That would mean that importing a PNG would also involve searching through the game, and finding the FEN for every move, and probably have tiddlers that tied positions to game move numbers (or plies):
title: gp/8675309
tags: GamePosition
game: game/12345
ply: 40
position: pos/98765
title: game/12345
tags: Game
white: Adolf Anderssen
black: Lionel Kieseritzky
date: 1851
pgn: 1. e4 e5 2. f4 exf4 3. Bc4 Qh4+ 4. Kf1 b5 5. Bxb5 Nf6 6. Nf3 Qh6 7. d3 Nh5 8. Nh4 Qg5 9. Nf5 c6 10. g4 Nf6 11. Rg1 cxb5 12. h4 Qg6 13. h5 Qg5 14. Qf3 Ng8 15. Bxf4 Qf6 16. Nc3 Bc5 17. Nd5 Qxb2 18. Bd6 Qxa1+ 19. Ke2 Bxg1 20. e5 Na6 21. Nxg7+ Kd8 22. Qf6+ Nxf6 23. Be7# 1-0
This is widely known as The Immortal Game...
title: pos/98765
tags: Position
fen: r1b1k1nr/p2p1ppp/n2B4/1p1NPN1P/6P1/3P1Q2/P1P1K3/q5b1 w kq - 1 21
It sounds interesting, and I wish I had time to work on it!
That sounds quite doable, integrating tools like chessboard.js
Iâm no JavaScript programmer, but curiousity took over and I had a quick look at the source code. To me it looks like it does:
Since being able to use this as parametrized TiddlyWiki JavaScript macro for only drawing a static board from a FEN string as input data only requires 1. and 2., hypothetically, what would have to be done to be able to use chessboard.js as TiddlyWiki JavaScript module? Some kind of heavy source code surgery to either decouple the part that does 3. and 4., or just extract everything related to 1. and 2. as new TiddlyWiki compatible module?