Show HN: My 70 year old grandma is learning to code and made a word game
111–120 of 160 posts
Re: Show HN: My 70 year old grandma is learning to code and made a word game
#112Re: Show HN: My 70 year old grandma is learning to code and made a word game
#113Re: Show HN: My 70 year old grandma is learning to code and made a word game
#114Earlier quoted context omitted.
> 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
What a spiteful comment over a little skepticism
Re: Show HN: My 70 year old grandma is learning to code and made a word game
#115Re: Show HN: My 70 year old grandma is learning to code and made a word game
#116Re: Show HN: My 70 year old grandma is learning to code and made a word game
#117Caution: 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…
let l = 0; let h = dictionary.length - 1; const textbox = document.querySelector("input"); while (l 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.
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!Re: Show HN: My 70 year old grandma is learning to code and made a word game
#118Re: Show HN: My 70 year old grandma is learning to code and made a word game
#119Re: Show HN: My 70 year old grandma is learning to code and made a word game
#120Earlier quoted context omitted.
> 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
What a spiteful comment over a little skepticism