[HN Gopher] Play Othello in your web browser (made with Mithril)
___________________________________________________________________
Play Othello in your web browser (made with Mithril)
Author : gmac
Score : 30 points
Date : 2023-12-13 20:48 UTC (2 hours ago)
(HTM) web link (jawj.github.io)
(TXT) w3m dump (jawj.github.io)
| ranting-moth wrote:
| Nice! If the dev is here, could we have the option of faster
| animation please.
| gmac wrote:
| Hmm, should be a simple CSS tweak, so I guess so.
| tromp wrote:
| Looking good! The AI player is just a simple 2-ply lookahead, so
| should be beatable by the better Othello players (not me).
| gmac wrote:
| Indeed! I basically programmed it to do roughly what I (a total
| novice) do when I play. Mainly for when my kids want to play
| and I don't (or am not around).
| smithcoin wrote:
| Darn I was impressed when I pulled off this: https://jawj.git
| hub.io/fliptiles/#!/4/52222224222222f222222d.... But now not
| so much. The key is to work to the edge and out.
| bewaretheirs wrote:
| For Othello, picking the positionally best square (corners very
| good, adjacent to corners very bad, 2 squares from corner good,
| etc.) beats lookahead, likely because having unflippable pieces
| in good positions leads to large swings in score in the endgame
| that a short lookahead won't see.
|
| I play almost purely positionally with no conscious lookahead
| and I beat it soundly every time, playing as both black and
| white, frequently with the AI having to pass because it had no
| legal moves.
|
| A "don't yield a corner" heuristic to never move in the three
| squares around a corner unless there are no other legal moves
| would likely significantly strengthen its play.
| kqr wrote:
| This is really smooth and polished. My othello skills are bottom
| of barrel so I got whooped by the AI, but had fun anyway.
|
| Does anyone know of something similar for go?
| smithcoin wrote:
| There are a lot of options out there. I've used this:
| https://www.cosumi.net/en/
| MrJohz wrote:
| Very nice! I like how the state of the game is directly available
| in the URL - I could send a game directly to another person and
| have them see the history of the moves I've played, if I
| understand that correctly.
|
| That said, when I want to go back to the previous page, I now
| need to click back through the game's history to get there -
| using `replaceState` from the History API would allow you to keep
| on using the URL as state, but without clobbering the user's
| browser history.
| kqr wrote:
| On the other hand, I liked that I could back out of a mistake
| with my browser back button!
| fidotron wrote:
| I did one of these a few months ago.
| https://www.luduxia.com/reversi
|
| The AI was based on ideas from https://archive.org/details/byte-
| magazine-1980-07/page/n57/m... and it was an end to end test of
| my WebGL code.
|
| One of the life lessons of mine is that your UI is probably a
| much better direction. There is a sort of upper limit beyond
| which the whole graphical side of things is an absolute
| distraction to everyone. My gut feeling is the whole Wordle style
| end of things will be where a lot more future growth occurs.
| gmac wrote:
| You may be right, but your one is seriously impressive. Good
| work!
| pier25 wrote:
| This is cool but the AI is not very good :)
|
| I got a corner after like 5-6 moves.
| gmac wrote:
| Agreed. :)
|
| I made it mainly for pass-and-play, but perhaps one of these
| days I should try to implement an AI vaguely worthy of the
| name.
| ilrwbwrkhv wrote:
| This is great. And love to see Mithril. One of the best
| JavaScript frameworks before the whole madness started.
| LVB wrote:
| Indeed! Still my go-to for smaller personal projects.
| lordgroff wrote:
| I agree. Mithril hits the sweet spot.
___________________________________________________________________
(page generated 2023-12-13 23:00 UTC)