[HN Gopher] Show HN: My 70 year old grandma is learning to code ...
___________________________________________________________________
Show HN: My 70 year old grandma is learning to code and made a word
game
Author : lowercarbon
Score : 281 points
Date : 2024-08-11 16:01 UTC (6 hours ago)
(HTM) web link (grandmasword.com)
(TXT) w3m dump (grandmasword.com)
| codingdave wrote:
| That is cool - it is nice and simple, but fun. The code is
| clearly from a beginner, but the saved game bit shows that she is
| a clever beginner - such a pragmatic way to continue a game. I
| hope she keeps learning and building more.
| interludead wrote:
| Fun is the key
| edvards wrote:
| Great game! I would love a hint function though, as I honestly
| got stuck.
| jayemar wrote:
| Or even a "give up" button because I'm definitely stumped
| Hnrobert42 wrote:
| Once you get it, you are going to erupt!
| theginger wrote:
| I got completely stuck, tries various word solvers, but they
| seemed to be for cross words or anagrams, but they were no
| help. But an actual dictionary / word list unlocked it. Not
| sure if using a dictionary goes against the spirit of the game
| or is expected. Without it it seems incredibly difficult.
| horttemppa wrote:
| Cool! 10 guesses got me there. Thought it was gonna be
| impossible.
| erikig wrote:
| Took me 13 guesses but it is a great game for a few reasons:
|
| - It can work for multiple age ranges by varying word lengths -
| It has good replay-ability - It can be adapted for offline play
| - It can be adapted for learners of new languages as well
| sphars wrote:
| I like it, pretty simple concept, good execution. I have to admit
| though, narrowing down a word purely by alphabetization can take
| a good while. Perhaps letting the player know the length of the
| target word would help.
|
| Congrats to your grandma for making a game!
| ValleZ wrote:
| It doesn't work on phone, sigh
| doytch wrote:
| Looks like the developer is aware there may be limitations.
|
| > <!-- When the player pressed Enter it should start the
| guessWord. Need to test on phone --
|
| Hopefully a new version will be released free of charge for
| current customers.
| ValleZ wrote:
| Oh, there is a readable JavaScript inside!
| icambron wrote:
| FWIW, it worked fine on my phone. Brave on an iPhone
| ValleZ wrote:
| Yep, likely my iPhone to blame
| thrdbndndn wrote:
| Is this a bug? https://i.imgur.com/b5HqHeA.png
|
| Vodka should not be below voice.
| Fannon wrote:
| Is it always the same word?
|
| My word is between Vodka and Vomit :D
| icambron wrote:
| It's like wordle: different word every day and everyone gets
| it. At least that's what the text says once you get it.
| nso wrote:
| At least for the next 13 days, when gma will learn about
| null pointers
| AndrewOMartin wrote:
| Did you guess a word which was already excluded? Maybe the
| arrangement of words assumed only "valid" guesses
| geor9e wrote:
| It means you guessed "vodka" after she already told you the
| word was after "voice"
| shepmaster wrote:
| I hope Grandma has some analytics hooked up to see all the
| traffic coming in!
|
| A small bug report: the "Share score" button on macOS Safari
| doesn't offer "copy" as an option for some reason. The same
| functionality on guess the game[0] has the same limitation, but
| it _also_ copies to the clipboard automatically. Wordle[1] seems
| to just copy to the clipboard only.
|
| [0]: https://guessthe.game
|
| [1]: https://www.nytimes.com/games/wordle/index.html
| Retr0id wrote:
| Grandma is a Cloudflare Analytics user, apparently.
| midnitewarrior wrote:
| Good gameplay! The one strong suggestion I have is to limit the
| word list to a category that uses common words. I had to resort
| to look at the word list dictionary in the console to see the
| possible words, and many of the words were extremely obscure.
|
| I would come up with categories of increasing difficulty.
| "Colors", "Advanced Colors", "Common Fruit", "All Fruit", etc.
|
| The game mechanic is great and worked flawlessly though!
| doytch wrote:
| Reading the code is a joy. I love seeing different approaches to
| what we all take as givens, such as design.css rather than
| style.css, or the usage of an `else if (1 == 1)` compared to
| `else` or even `else if (true)`.
|
| (So I guess, thanks for not teaching her about bundlers and
| minifiers yet :))
| seeknotfind wrote:
| One reason programmers do this is so that they can make a one
| character change, e.g. "else if (1 === 1)" -> "else if (1 ===
| 2)" in order to change the logic there. For C programers you
| see a lot of '#if 0' '#if 1' for this same purpose. Though,
| given that it's used everywhere, I'm not sure if it's really
| for that purpose.
| xandrius wrote:
| [flagged]
| kragen wrote:
| spoiler warning! don't look at the source if you're going to
| play the game because the number of possible valid words is
| short
| geor9e wrote:
| I see 279496 valid words in dictionary.js
|
| ...ooooh I see the 20 secretWords now
| dan_manges wrote:
| I don't understand why any of that indicates that a 70 year old
| couldn't have created this, unless you think 70 year old people
| aren't capable of doing that.
| wwilim wrote:
| My dad is 64 and he can still use AutoCAD like he's playing
| piano
| Retr0id wrote:
| The age isn't really the inconsistency, it's the "only just
| learning to code" aspect. My first ever webpage was certainly
| not hosted behind Cloudflare. (I'd also expect beginner
| resources to point to something like GitHub Pages instead)
| Kiro wrote:
| > About the game: somewhat fun but if you don't know the word,
| that's it. No really any way to figure out in a rewarding way.
|
| What does this mean? You could say the same thing about Wordle.
| tarl0s wrote:
| I guessed many words I didn't know on Wordle (not a native
| English speaker), if you are able to reduce enough the
| letters search space there's going to be only a few options
| that e.g. make sense phonetically.
| Kiro wrote:
| I actually misread the original comment but I guess my
| question is still somewhat relevant so leaving it as it is.
| You're right that it's easier to just bruteforce it in
| Wordle.
| sverhagen wrote:
| This was my problem too. If there was a scoring system, it
| might make sense to buy letters against your score, to help
| you forward once you're stuck. I got stuck. What the heck
| goes between Volatile and Vole?
| lupire wrote:
| Hint: it is a common word that is NOT on this list of
| 10000 words!
|
| https://www.mit.edu/~ecprice/wordlist.10000
|
| It is on this list of 20000 words:
|
| https://gist.github.com/eyturner/3d56f6a194f411af9f29df4c
| 9d4...
| geor9e wrote:
| Pasting the <script src one-liner code for page analytics was
| one of the first things I did when coding my first angelfire
| website as a 10 year old. I loved seeing the graph of how many
| daily visitors I got.
| klyrs wrote:
| > Not to be negative or anything but [pure shade]
|
| I'm gonna bet that my mom has had a website since before you
| were born*. She was taking fortran classes in the 60s. Your
| ageist attitude is pretty gross. So _what_ if she had help?
| Another bet, you can 't program without the help of online
| resources and/or a chatbot either.
|
| * given the dates on your resume, there's a very good chance
| I'm correct in this
| sweeter wrote:
| you are being just as rude as the other person, if not more,
| buddy. There is a much better and constructive way to make
| this point. Also, the title says that she is "learning to
| code" so its not unreasonable to say that she probably isn't
| handling the website stuff... Also, the commenter is making a
| conjecture about the veracity of OP, not the mother per se.
| eltoxo wrote:
| I am old myself. It is not ability to learn with age that
| is suspicious it is wanting to share it like this and it
| would be a clever marketing move.
|
| I will learn new things until the day I can't. I am
| currently learning the Stan language but I am not going to
| write a medium article "What happens when an old man
| attempts to learn Stan?"
| klyrs wrote:
| I bet you could write that article, regardless of
| programming experience, and tell a compelling story.
| Different people share different parts of themselves
| online, and I think that's okay.
| rfl890 wrote:
| What a spiteful comment over a little skepticism
| klyrs wrote:
| I'd characterize the original comment as a cynical
| accusation of shilling, so I'm quite curious what you read
| as "spite" in mine. Must I point out that I, too, use
| external resources whilst programming?
| martin293 wrote:
| > > Not to be negative or anything but [absolutely justified
| skepticism based on how much various publicity stunts have
| been done]
|
| Your comment is also much much ruder than the one you're
| replying to.
| junon wrote:
| Aside from the other comments, it could be the case she's using
| a deployment tool that does this for her.
| poopsmithe wrote:
| Please footnote the mentioned reddit post
| xandrius wrote:
| Can't edit anymore: https://old.reddit.com/r/programming/comm
| ents/1enuhw5/my_70_...
| martin293 wrote:
| Yeah that would be helpful as I can't find it at all. Both
| lowercarbon and xandrius have 0 posts and comments for me.
| yosefk wrote:
| It's subjective how rewarding it is but you can definitely
| guess the word if you know, well, words, by doing a binary
| search and narrowing down the first letters. I have an uneasy
| relationship with puzzles and I'm not a native speaker but this
| to me is about as fun and about as infuriating as Wordle or
| Semantle (try the latter if you didn't already!)
| layer8 wrote:
| There is some bug in the sorting, because it sorted "vol" after
| "volatile" for me. It seems to depend on some previous state,
| though, because I couldn't reproduce it in a new window.
|
| Edit: See also https://news.ycombinator.com/item?id=41217457.
| TheJoeMan wrote:
| It seems the previous guess is always placed either one up or
| one down from the entry box. So if you're guessing "V" words,
| then type "apple", then "apple" will show after "vodka". So the
| list is not getting re-alphabatized.
| matt_morgan wrote:
| Right. My word was before "wizard," and later I guessed
| "yesterday," which is after wizard. It put yesterday adjacent
| to the entry box, before wizard. Same is true for words
| before the word. Basically, if I make bad guesses, it doesn't
| list them in alpha order.
| rossdavidh wrote:
| Grandma's First Bug report
| boxed wrote:
| I had a similar issue. Void sorted before Vogue. Breaks the
| game totally as far as I can tell.
| FergusArgyll wrote:
| Great game! looks nice too...
|
| I got reeeealy close (and then asked an llm....)
| geor9e wrote:
| time to LLM a binary search import requests
| url = 'https://grandmasword.com/dictionary.js' response =
| requests.get(url) lines = response.text.split('\n')[2:]
| exec('\n'.join(lines)) def binary_search(dictionary):
| while len(dictionary) > 1: mid_index =
| len(dictionary) // 2 mid_word = dictionary[mid_index]
| print(f"Guess this middle word: {mid_word}")
| user_input = input("Did grandma say her word is before or after?
| (type b or a)").strip().lower() dictionary =
| dictionary[:mid_index] if user_input == "b" else
| dictionary[mid_index + 1:] print(f"Grannys word:
| {dictionary[0]}" if dictionary else "No words left in the
| dictionary.") binary_search(dictionary)
|
| Solved in 18 guesses! Share score Thank you for visiting my
| website. There'll be a new word everyday just like Wordle. Kind
| regards, Eleanor
| tills13 wrote:
| I mean that's literally how to play this game whether you
| intend to or not
| another-dave wrote:
| I thought my manual binary search off the top of my head in 16
| guesses was probably poor but if it beats a coded version, I'm
| happier now lol
| robertclaus wrote:
| Classic LLM hijinks or hacker goofing off on HN? Either might
| throw `exec('\n'.join(lines))` in a script running on a
| publicly downloaded file rather than parsing it more directly.
| jessekv wrote:
| Nevertheless, it is somewhat curious that "dictionary.js" is
| nearly valid python.
| jessekv wrote:
| So you didn't want to have fun playing the game, but also
| didn't want to have fun coding a solver? I understand the
| former, but not the latter... :D
| geor9e wrote:
| Going from knowing exactly what I want, to it materializing
| from just from a 60 second conversation in the sidebar of my
| browser, does give me a bit of a buzz
| jessekv wrote:
| Fair enough! But I am curious, was it you or the LLM that
| decided to exec a .js file as python?
| FergusArgyll wrote:
| SPOILER
|
| view-source gives away the answer for the next 20 days....
| geor9e wrote:
| It's okay, according to the source comments the only player is
| her friend Caroline
| mouse_ wrote:
| This game is somehow so compelling
| cornstalks wrote:
| In the spirit of helping a fellow programmer debug some things:
|
| If you guess a word that isn't in the dictionary, the text box
| looks like it's cleared but my phone's (iPhone) keyboard's
| autocomplete either didn't pick that up or there's still some
| hidden content in the box.
|
| It would be nice if the list was always sorted in totality.
| exogeny wrote:
| This was fun. Good job, Eleanor!
| bbarn wrote:
| I read the domain name as Grandma Sword. Maybe her next project
| :)
| wongogue wrote:
| A refreshing new fantasy RPG.
| ivanjermakov wrote:
| My first entered word was "sword" so I read it same as you
| MrDresden wrote:
| Very cool.
|
| My own 74 year old surviving parent would never be able to get
| them selves to even try, as they have spent most of their lives
| telling reiterating a mantra about how little they know about
| technology.
|
| It has been a guiding principle of mine to never do that with
| anything, after seeing the effect it has had on her.
| nyjah wrote:
| My mom is the same way. She's really capable and smart, but she
| will also stop herself from plugging something in because she's
| unsure.
|
| I convinced her that she can figure out any remote and they are
| designed to be figured out. I told her at most there's gonna be
| 5 buttons she doesn't understand and it won't break anything to
| hit them. Most of the buttons are numbers or volume and channel
| up down, power.
|
| She got that. When her mom was sick and had different tvs
| because of different circumstances my mom would be like, "I did
| figure out the remote tho and was able to get the television
| working."
|
| I was with my 3 year old niece the other day and she turned on
| the receiver and then the television and I said , "wow, I'm
| impressed you figured that out." And she said , "yeah when
| grandma watches me she doesn't know how". . .
| mattmaroon wrote:
| Ever since I was a little kid, teaching the other little kids
| how to do math, I've believed that most people who think they
| aren't able to do something aren't able to do it because they
| think they can't.
|
| And I tell myself that every day as I try to learn guitar in my
| 40's.
| NavinF wrote:
| This website was likely not made by a 70 year old grandma
| judging by how it was promoted on reddit.
|
| https://www.reddit.com/r/programming/comments/1enuhw5/my_70_...
|
| https://www.reddit.com/user/Ruth_Ellaer
|
| https://www.reddit.com/user/puzzledpenguins
| saintradon wrote:
| If that's the case then what's the endgame of this promotion?
| Strange.
| Retr0id wrote:
| Testing the waters, I guess.
|
| "it's my birthday today [AI generated image of Grandma with
| birthday cake]" is a viable business model on Facebook
| these days: https://www.404media.co/where-facebooks-ai-
| slop-comes-from/
|
| If they get enough clicks they could put profitable ads on
| the page, or even sell it (like what happened with Wordle).
| serial_dev wrote:
| Go viral and show ads?
|
| Get the chatter going, get "press", clicks, visitors and
| players, then potentially ads, or selling the site (for
| someone else to put even more ads on it), or using it as
| marketing reference (I made a game viral by lying about
| it).
| BearOso wrote:
| The source fits the pattern of something generated by LLM and
| even includes comments that were probably part of the prompt.
|
| Doesn't anyone else remember being a beginner? This isn't
| something I would have made. It has too many extra little
| nuances. The dictionary is a big clue.
| atopal wrote:
| It's called learned helplessness and is a good indicator for
| pessimism. There is a book I enjoyed that discusses the issue
| in depth, called: Learned Optimism, by Martin Seligman. The
| second half of the book is about how to become less of a
| pessimist, by addressing learned helplessness.
| TheJoeMan wrote:
| Would adding an indicator of how many letters I've gotten correct
| / "locked in" be fun? I don't know if I'm supposed to be trying a
| new 2nd or 3rd letter after V.
| junon wrote:
| "voi-" was sorted before "vog-" by the way!
| dvh wrote:
| I found Grandma's Word in 25 guesses
|
| https://grandmasword.com
|
| It was volcano but I only discovered it after finding that
| Android autocorrect can suggest a word for me.
| tartakovsky wrote:
| spoiler alert -- no need to share the answer, it takes the fun
| away for others
| jtokoph wrote:
| Hopefully they just don't realize that the word is the same
| for everyone each day.
| sahmeepee wrote:
| I was just relieved when it wasn't vulva
| firesteelrain wrote:
| Go grandma! Great job!
| zakm wrote:
| I found Grandma's Word in 16 guesses
|
| https://grandmasword.com
| agiacalone wrote:
| This is neat! Kudos to your grandma.
|
| Edit: I got it in 18 guesses
| anoncow wrote:
| Amazing game. I felt in some scenarios the alphabetical order was
| incorrect (in my example I got Victory before Very), but very
| enjoyable!
| ErikAugust wrote:
| Only took me 6 guesses. This is pretty good, no?
| BubbleRings wrote:
| Why not delete your spoiler message until tomorrow please?
| yreg wrote:
| I got it in 5, but it's pure luck based, right?
|
| The optimal strategy would be to do a binary search which would
| take longer than 5.
| lupire wrote:
| A much needed reboot of Joon Pahk's defunct "Guess My Word".
| 101008 wrote:
| The view-source shows the comments on the code and it's really
| cute. Congratulations to your grandma (and to you, if you have
| anything to do with it!)
| interludead wrote:
| That's awesome! It's inspiring to see her having fun with
| technology.
| susam wrote:
| Caution: Spoilers in this comment!
|
| Arriving a bit late to the party, but I couldn't resist crafting
| a quick binary search solution in Python. from
| urllib.request import urlopen, Request DICT_URL =
| "https://grandmasword.com/dictionary.js" response =
| urlopen(Request(DICT_URL, headers={"User-Agent": "Mozilla/5.0"}))
| words = [w.strip('"[];\n') for w in
| response.read().decode().split("[")[1].split(",")] lo, hi,
| answer = 0, len(words) - 1, "" while answer != "d":
| mid = lo + (hi - lo) // 2 print(words[mid])
| answer = input("after/before/done? [abd] ") if answer
| == "a": lo = mid + 1 elif answer == "b":
| hi = mid - 1
|
| Took a total of 17 guesses to find the solution:
| MALPIGHIAS after/before/done? [abd] a RUBIFIES
| after/before/done? [abd] a TEARERS after/before/done?
| [abd] a UNMANLIEST after/before/done? [abd] a
| VORTICES after/before/done? [abd] b UTOPIANIZING
| after/before/done? [abd] a VERTICILLASTERS
| after/before/done? [abd] a VIROSE after/before/done?
| [abd] a VIZARD after/before/done? [abd] a
| VOLCANISE after/before/done? [abd] a VOLUMIZER
| after/before/done? [abd] b VOLPINOS
| after/before/done? [abd] b VOLITATE
| after/before/done? [abd] b VOLCANOLOGICAL
| after/before/done? [abd] b VOLCANIZATION
| after/before/done? [abd] a VOLCANIZES
| after/before/done? [abd] a VOLCANO after/before/done?
| [abd] d
|
| Thanks for sharing this nice game on a fine Sunday evening! It
| was fun to play both manually as well as programmatically!
| yismail wrote:
| let l = 0; let h = dictionary.length - 1;
|
| const textbox = document.querySelector("input");
|
| while (l <= h) { const m = Math.floor((l + h) / 2); const guess
| = dictionary[m]; const textbox =
| document.querySelector("input"); console.log("Guessing:",
| guess); textbox.value = guess;
| guessWord(); if (document.querySelector(".correct"))
| { console.log("Found the word:", guess); break;
| } else if (textbox.placeholder.includes("after")) { l =
| m + 1; } else { h = m - 1; }
|
| }
|
| Here's mine in JavaScript, you can paste it in the console.
| susam wrote:
| Thanks! I should have realised that a solution for this could
| be implemented in JavaScript as well, allowing it to run
| directly in the web browser. Here is my translation of my
| earlier Python program to JavaScript: let lo
| = 0, hi = dictionary.length - 1 const answer =
| document.getElementById('guess') while
| (document.getElementsByClassName('correct').length === 0) {
| const mid = Math.floor(lo + (hi - lo) / 2)
| answer.value = dictionary[mid] guessWord() if
| (answer.placeholder.indexOf('after') !== -1) { lo =
| mid + 1 } else { hi = mid - 1 }
| }
|
| This solution is quite similar to yours. Thanks for this nice
| idea!
| kwhitefoot wrote:
| I wish that your grandmother had been on the team I worked with.
| It's rare to see clear code with meaningful comments.
| sweca wrote:
| Got the word in 7 guesses! This is fun
| liberix wrote:
| Very nice game!
|
| If you like this, check out https://betweenle.com.
|
| Betweenle is based on the same game logic, but gives you very
| useful visual clues along the way.
| kcrwfrd_ wrote:
| Please for the love of God add an "I give up" button T_T
| m4tthumphrey wrote:
| My 8 year old nephew did it in 3. Absolutely crazy odds!
| nsxwolf wrote:
| Not fun. Feels like I just get closer and closer to some
| asymptote.
| ErikAugust wrote:
| Prompt: "You are a 70 year old grandmother learning
| JavaScript..."
| phil294 wrote:
| I like it, it's surprisingly fun to play. When played in groups
| (with changing words), this game would be well suited for non-
| natives learning English.
| awinter-py wrote:
| grandma sword
| enos_feedler wrote:
| painful to play this game manually. I narrowed it down to what i
| thought i could guess but ended up just console.log(secretWord).
| eezing wrote:
| Got it in 11
| sir0010010 wrote:
| This was fun, I found the word manually in 12 guesses. I have
| been a SWE for over a decade now, but have not done enough
| frontend to know how to make this!
| iKlsR wrote:
| The javascript is pretty clean and well commented
| jdeisenberg wrote:
| This is perfectly wonderful!!!
___________________________________________________________________
(page generated 2024-08-11 23:00 UTC)