Saturday, November 28, 2020

Fan Tan!

My family has often played a very simple, silly game at family gatherings. We call it 'fan tan,' although it's clear that has a history as a very different kind of game. Our game is a card game where players take turns plaing sequential cards in suit, starting with 7's and moving up and down. The goal is to get rid of all your cards. There's very little strategy, although there's a little bit in terms of when you play what cards, and how to try to force others to play the cards you need. My family can't be together this year, so I went ahead and programmed a version of this game on my website. It's pretty clunky, but it works, and it recreates the experience of the game pretty well. We all played it via Zoom yesterday. It's written entirely in PHP and Javascript, and it makes use of AJAX http calls to make and record moves. Not a thing of beauty, but still pretty cool.
It's not well-documented, but it's here: http://planktongames.com/fantan Anybody who goes to the website can start a game (hit "Reset All" if one is in process and you want to start a new one), and anybody else who's visiting the site can take part simultaneously. Note: The response to moves is a little slow - it takes about a second for moves to register.

No comments:

Post a Comment