Show HN: Play Othello in your web browser (made with Mithril)
jawj.github.io
jawj.github.io
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.
I did this same thing with Othello back in 1994 and have been wondering why it never caught on.
I used a CGI program to generate the board. Playable squares were links so the pointer would change. The script made your move, figured out the AI move and spit out the board with a timed reload feeding its own move in. Totally stateless other than the URL.
This one is prettier, but a little less smart. Nicely done!
It would be more reasonable to map the 'undo' button to backspace and a visible button, and keep the browser back button semantics unsurprising. One can also have a string in the window with the current game state for sharing/linking.
That's precisely why it works: it presents an alternative to the liminality requirements of maintaining the Ballmer Peak (which is is too NP-hard to reproduce) by tapping into the underdeveloped PFCs in young developers everywhere and making them productive by psyop-hacking their sense of adventure into the pursuit of complexity.
It's honestly sad, but a nonetheless really interesting study in emergent psychological dynamics.
"React is built to appeal to young developers. By being complicated, internally consistent, and "selling itself", it keeps them working long hours on boring business tasks. Practically, it's not the right tool, but it keeps 'em happy and grinding away."
Words misused (all of them):
- liminal = transitional, "between worlds", arguable, but more "flow"
- ballmer peak = coding capability stemming from mild inebriation, not from an old man sense of duty
- NP-hard = difficulty comes from combinatorial explosion, not from the impossibility of making people love spreadsheets
As a used-to-be baby dev, I'd argue the appeal of web frameworks is 2-fold. Structured ways to do complicated stuff, and internal consistency.
I was probably already dealing with the quirky subtle delirium I get with onset head colds/flus when I wrote that yesterday (I'm now past it and at the sniffle stage lol). That's my excuse for the "u ok?" word salad there :P
Some clarifications following this feedback:
- ballmer peak: yep, pretty much - the latter interpretation is new to me
- liminality: the defocused focus referred to in the above, but specifically referring to the need to drink to make it work
- NP-hard: I was trying to make a joke about it being impossible to achieve the effects of the ballmer peak without drinking lol
The playing engine is based on a tiny C engine which I de-obfuscated and translated to Javascript.
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.
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.
EDIT: ah, I guess it’s because it gives the corner to your opponent.
I got a corner after like 5-6 moves.
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.
Does anyone know of something similar for go?
Using these tips alone should help you (easily?) beat the AI here, as it does a lot of mistakes.
Using these tips alone should help you (easily?) beat the AI here, as it does a lot of mistakes.
It's not nearly as polished but I had a lot of fun making it. It uses React and the now-no-longer-maintained https://boardgame.io/.