I’m personally always up for programming discussion in the forums, but just want to make sure you’re aware of the tools at your disposal. Web dev has been extensively discussed on the web (of course ) which means tools like search engines and LLMs work really well in these domains. LLM do especially well for questions of “best practice” since they are just doing a bunch of pattern matching.
I asked Gemini “Is package.json autogenerated?” and “Should I add X to git?” and I think it responded about as well as any human could have answered:
One of the features that i think should be standard in all SGF editors but isn’t is the ability to slide stones, like in GoWrite, as per this thread: Sliding Stones Analysis Tool
And I’ve started adding that feature into my SGF editor!! Very grainy demo of shift-click+drag to move a stone:
Link to longer, higher-res demo: kosumi-demo-2024-11-19.webm - Google Drive
Right now it can only move one stone at a time, so I have to implement some way to visually select multiple stones and move them, but I might do that next. I still have to implement the more fundamental things like clicking on the board to add a new variation tho
I read your post just now, and it’s kind of blowing my mind because (I swear this is all true!) I woke up this morning from a dream where I’d been playing 36 games simultaneously of a game I designed (an abstract strategy game called Thrive that’s played on a 6x6 grid – hence 36 games). In the dream, it was much like Super Tic-Tac-Toe, where the move I played (specifically, which space I moved my piece to) would dictate which of the 36 games my opponent got to play on next.
Earlier in the dream, I’d had the idea to play 7 games of Garden Nation at the same time. If you haven’t seen it, Garden Nation is a game that essentially takes the basic premise of Super Tic-Tac-Toe and extrapolates them to a hex3 grid. (The board is 7 hexagons with 7 spaces in each.) I recommend it if you haven’t seen it before. It’s playable on BGA.
I felt like I just had to write this all up because…
And I’m super interested in Super Tic-Tac-Go!!! I don’t know when I’ll get a chance to play it, but I want to try it out now ASAP. I have a Go Variants file/list, and I’m adding this to it. I’d be super interested in hearing what other variants were played (or invented?!) at the Baduk House.
It came highly recommended from a couple folks and I’ve been finding it to be really great for filling in some vital gaps in my understanding of what’s going on with JS, and the exercises are fun little puzzles.
I want to implement a means of saving settings and SGF’s on my webapp though so it looks like I’m gonna have to learn something other than just JS to make that happen. I don’t know anything about backends or databases but hopefully this will be fun to learn as well!
Pshhh you can use JS on the backend as well I think you are already acquainted with Node.js since you used npm to install/run tests. govariants.com is using Node for the server side as well. OGS does a hybrid - some JS some Python.
If you you are okay with very simple saves, you can use localStorage in the browser. OGS uses localStorage for many settings.
Okay, I have spent hours trying to get Jest working, gave up, spent hours trying to get Mocha working, and now I give up again.
Why are testing suites so complicated to work with when all they do is compare expected output of a function to the actual output given a particular input? It seems to me like it would be far faster and easier to just write my own testing functions. Is there a reason to not just do that?
I will say… you can do that. The reason testing frameworks are nice is that:
the output is a lot clearer than if you were to write this all from scratch.
in event of success, it will say something like “5/5 test suites, 85 tests ran successfully!”
In event of failure: “Test ‘blah blah blah’ failed. Expected: 42, Actual: -42”
A framework will invoke parallelism that would be complicated to implement yourself. Given that most computers are multicore these days, its something like 8x speedup even on standard laptops.
There are a ton of utilities that come with a framework. So it’s easy to test things like expect(x).isNear(12.345) instead of x == 12.345
Is your GitHub repo up to date? I could submit a PR to set up a framework with a basic unit test just to show what it might look like…
it is not, but i would really appreciate that very much i will try and push my changes in an hour or so. the webapp itself will be completely nonfunctional for awhile since i’m rewriting pretty much everything, but that’s fine :p
edit: i do not love how it autocorrects the :p emoticon to the slurpy emoji
Another thing they do is produce output data in a format that you can then link up on continuous integration servers so you can get nice reports of browsing all the tests, drill down into failures, get charts of coverage and pass rates over time etc. So you are reusing effort of other developers (and users and testers ironing out all the bugs and edge cases you didn’t consider) to deliver those features, rather than roll-your-own.
You can even get plugins that take that output and gamify it, awarding points to developers for adding new tests, fixing broken ones, increasing code coverage etc to make a leaderboard which can be fun and encourage good testing behaviour in a team. Though I once rather cheated in winning one month because I turned off one of the lint rules we decided was too strict, thereby removing thousands of warnings across the entire codebase .
Okay it has been substantially longer than an hour since I overestimated my abilities to make my parsing functions actually run, after taking such a long break from it. But it’s up now!
The webapp itself definitely isn’t gonna work for awhile. The functions I specifically want to test right now are those in parse-sgf.js, and eventually those in sgfProperties.js, both in the /sgf/ directory.
The Uberdude lore we’re getting in this thread is giving me life first the keylogger, now this, what will we learn next?
No problem! And glad the sgfUtils change was okay - i always feel so lazy when i name something “utils”
“Normal” is really dependent on project. I’ve been on teams that write no tests (they usually invest more in manual testing/QA).
I’m on the testier side of the spectrum, where I try to capture each “requirement” with a test. So it’s common to have more than one test per function.
You’ll find what works for you - I think whatever allows you to move quickly with confidence in stability and design is best!