Pyscript Chess Match Viewer (Demo)

Thought I’d share a basic chess match viewer that i put together in PyScript: https://about.nmstoker.com/chess.html

It’s standing on the shoulders of giants, thanks to both PyScript and the excellent Python Chess package

I’ll add a few features and may find a way to make it a bit more PyScript-y as i learn more :+1:

It was pretty straightforward to put together. In fact most of my time was spent faffing with the Bootstrap layout (which could still be better!!)

6 Likes

Neil,

Now that is a nice demo.

2 Likes

I’ve added another example, here: Another quick example: Emoji in PyScript

2 Likes

Pretty cool example!
Thank you @neil, we’re soon going to be adding an area to have community contributions to pyscript and we’d love to have your example there.

2 Likes

Thanks! I’d be honoured to include it :slight_smile:

I’ve enhanced it a little further recently, so you can interact with the board (adds an event listener on the SVG to figure out which piece you clicked). I’ll post that version soon.

When things are ready. let me know what I need to do to submit it

2 Likes

Sure!
I’ll keep you posted.

1 Like

Here’s an updated version. I need to clean up the code a bit but it works reasonably well now.

https://about.nmstoker.com/chess2.html

New features are:

  • Watch/pause toggle
  • Selection of matches
  • Clicking on pieces shows their attack

The attack feature is nice because it demonstrates interacting with SVG: it figures out which piece was clicked and redraws the board with the attack detail added

2 Likes

Have created a repo for it here: GitHub - nmstoker/ChessMatchViewer: View chess matches in your browser

1 Like