News for hackers. Stuff that matters.
Re:Show HN: I AI-coded a tower defense game and documented t... by mmastrac on Friday July 04, 2025 @12:07PM (#44465709)
I have a reasonably good solution for this project of mine you might find useful:

https://grack.com/demos/adventure/

The trick for me was just using a hidden input and updating the state of an in game input box. The code is ancient by today's standards but uses a reasonably simple technique to get the selection bounds of the text.

It works with auto complete on phones and has been stable for a decade.

Re:Show HN: I AI-coded a tower defense game and documented t... by stavros on Friday July 04, 2025 @12:22PM (#44465824)
That's promising, thank you! I'll ask the LLM to implement it.
Re:Show HN: I AI-coded a tower defense game and documented t... by adelineJoOs on Saturday July 05, 2025 @09:14AM (#44472594)
hidden input box is something I heard before from some hacker-ish old collegues - seems to be a powerful and reliable approach to store state & enable communication between components!
Re:Show HN: I AI-coded a tower defense game and documented t... by mmastrac on Sunday July 06, 2025 @07:36AM (#44479819)
Oops, I worded my comment poorly -- it's not a hidden input, but rather a "hidden textbox input". Hidden inputs are useful but something completely different.
Re:Show HN: I AI-coded a tower defense game and documented t... by adelineJoOs on Sunday July 06, 2025 @08:50AM (#44480373)
Gotcha, thank you for the clarification!