User talk:SD0001/Archive 8
![]() | This is an archive of past discussions with User:SD0001. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 5 | Archive 6 | Archive 7 | Archive 8 |
Heron's formula calculator
When you simplified the formula in the calculator on Heron's formula, you replaced the formula from the section of the article on numerical stability with a simpler formula that is not numerically stable, causing your version to produce very inaccurate results for some inputs. I restored the stable formula with a long comment explaining why it needs to be used. —David Eppstein (talk) 21:43, 15 January 2025 (UTC)
modules chessboard and pgn
hi.
i just now noticed your addition to module and template chessboard, to support pgn (back in 2022...)
i happen to be the author of the latter, and contributed a bit to the former (i actually the original "founder", but it grew a lot, and in reality i can only claim responsibility for a tiny part of current module - i started it as "chessboard from fen", which i wrote as my first exercise in lua/scribuntu).
i do have a comment/critique of your integration of "from pgn" into chessboard: the line fen = moves[#moves]
limits the functionality and usability of this mode, as it "hardcodes" displaying the very last board of said pgn.
i suggest adding a "ply/move/some_better_name" parameter to specify the actual move, and let the template display any desired board from a given game. this should not break anything if you default to #moves when no such param is passed, so this line would be something like fen = moves[ply or #moves]
it would be even nicer if the editor could use notation like
ply = 12d
or
ply = 21l
instead of straight number (with straight number, for ply 17 for white the editor has to say ply=33 and for ply 12 for black "ply=24" - not very intuitive), like Module:Chess from pgn does (this module is meant for displaying multiple positions from the same game). you could relatively easily take and modify moveToIndex() from said module such that when "match" fails, it returns false instead of -1, and then the line i quoted above becomes something like
fen = moves[moveToIndex(ply) or #moves]
peace.
קיפודנחש (aka kipod) (talk) 18:16, 21 January 2025 (UTC)
- Hi @קיפודנחש. Since the Chessboard module only shows a single position, I am not sure what's the point of including the PGN of the full game if an intermediate position is to be shown. The PGN up to that point could be passed instead. A ply would be useful in an interactive chessboard template instead, on which some work is ongoing. – SD0001 (talk) 04:49, 3 February 2025 (UTC)
- if there is a point to the whole "pgn" thing (wasn't it you who added this functionality?), it would be when multiple plys of the same game are desired - it's convenient to provide the pgn (either via template or just copy/paste) and then say "please show ply this, please show ply that" etc.. As it is, it's not very useful indeed. Peace - קיפודנחש (aka kipod) (talk) 03:09, 4 February 2025 (UTC)