Anonymous
Not logged in
Talk
Contributions
Log in
Request account
Rest of What I Know
Search
Editing
Blog/2025-01-05/Mahjong Spreadsheets
From Rest of What I Know
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[File:{{#setmainimage:Screenshot - Mahjong Scoring Sheet.png}}|thumb|As you can see, I'm not doing too well on this particular game. It's still only East Wind prevalent, though. Lots of time. Lots of time.]] My friends and I play Mahjong quite often. We use [http://mahjong.wikidot.com/rules:chinese-official-scoring these rules for scoring] but the annoying part with using chips is that you always have to do the math and pass them around and avoid knocking them and stuff like that. And the worst of all is that you have to somehow retain state because games of mahjong can go on forever and we can usually only find an hour at a time to play. This seemed like a good opportunity to use an LLM to generate some useful spreadsheet so we can just use Google Sheets to write everything. This would seem like the perfect opportunity for Gemini to shine, considering it's literally their LLM in their spreadsheet app, but unfortunately for me Google doesn't quite have the story together. You can't ask Gemini to add a column or a row. You can't ask it to generate a formula for a cell in the sheet it's looking at. It really can't do anything. In the end, I used Claude and then wrote a bug in the code anyway. It is now fixed, so I'll explain it simply in case anyone else wants a quick way to do it. It's not complicated. You can see the schema in the screenshot. The only thing that matters is the formulae in the cells: <syntaxhighlight lang="text"> =IF($G4=0, 0, IF($F4=B$1, IF($H4="All", ($G4+8)*3, $G4+3*8), IF(OR($H4=B$1, AND($H4="All", $F4<>B$1)), -$G4-8, -8))) </syntaxhighlight> With Google Sheets's new "Tables" feature you can easily set drop-downs on various columns (which I have set to their names). Then we just select a Winner, a Loser, and type in the score and the annoying bookkeeping is recorded here. [[Category:Blog]]
Summary:
Please note that all contributions to Rest of What I Know are considered to be released under the Creative Commons Attribution-ShareAlike (see
Rest of What I Know:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Wiki tools
Wiki tools
Special pages
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs