News for hackers. Stuff that matters.
Re:Show HN: 5 minute word game by pcmaffey on Tuesday October 31, 2017 @08:07AM (#15592587)
Built this game in React in ~ 20 hrs. Thought I'd share a few things I learned:

1. You can disable React Dev Tools in Prod, by including this script before React loads. Because this game is 100% client side, fiddling with component state made cheating much too easy.

` if (typeof window.__REACT_DEVTOOLS_GLOBAL_HOOK__ === 'object') { __REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function() {}; } `

2. A good dictionary of English words is not easy to come by. I first tried a 25k word list, and then when I play tested for the first time, half the words I spelled weren't in there. Looking around, larger lists were in the 300k range. Eventually I found one at 70k words... I'm hashing it for easy search of words, though it makes for a slightly heftier initial load (I was hoping for 40-50k words), and it still doesn't include plurals.

I'd thought about using a spell-check API, but wanted the game to be playable offline...especially if I make it into a mobile app (not sure yet).

3. There's a fun little bonus round you unlock if you score enough points. This wasn't at all part of my initial concept, but I realized it'd be neat to use the words spelled during the game to create something (it still needs work, but as they say, constraint is the mother of creativity).

Re:Show HN: 5 minute word game by sushid on Tuesday October 31, 2017 @03:10PM (#15595736)
Regarding #2, shouldn't you be using a prefix tree? And even if you're using a hash, you can remove the s suffix and check to see if it's a word (i.e. check if it's a word first, if not, remove the 's' and check again). There are edge cases of course, but at this point it's probably better to have a few false positives than a bunch of false negatives.
Re:Show HN: 5 minute word game by pcmaffey on Tuesday October 31, 2017 @03:26PM (#15595832)
[searches "prefix tree"] Sweet! Thanks for the tip, that does indeed look like what I should be using.

As for plurals, that's not a bad idea. But I think the # of false positives would be > false negatives.

Re:Show HN: 5 minute word game by sushid on Tuesday October 31, 2017 @06:32PM (#15597202)
Quite possible. How about importing the Scrabble dictionary? Looks like there are implementation on Github that's easily <1 MB.

Loved the game, btw.

Re:Show HN: 5 minute word game by averagebear on Tuesday October 31, 2017 @02:52PM (#15595600)
Pretty fun.

5 minutes is a bit long - I think I would have the hang of it and wouldn't have gotten tired of it in a 3 minute session. Also, plurals generally (but not always) don't work.

Good job!

Re:Show HN: 5 minute word game by giza182 on Wednesday November 01, 2017 @05:26AM (#15599761)
+1 After 3 mins it gets a bit tedious. Love everything else abut it tho!
Re:Show HN: 5 minute word game by pcmaffey on Tuesday October 31, 2017 @03:15PM (#15595771)
Point noted about the time. You may be right. Will play test that a bit. Thanks!
Re:Show HN: 5 minute word game by pcmaffey on Thursday November 02, 2017 @12:21AM (#15607810)
Hey all, a few updates:

1. You can now check out the top 100 poems (as you can see, these are all in good fun): https://www.pcmaffey.com/01100111011000010110110101100101/po...

2. I updated the dictionary. So it now should fully support plurals and conjugations. Happy word-smithing!

Re:Show HN: 5 minute word game by aldo712 on Wednesday November 01, 2017 @08:53AM (#15600676)
Umm..

  She piss bed, pussy busy red!
  Men run cab, nun sip pill, deer led
  pig hit lip, tie tin cap!
  Dig mud ball, fin gig!
Re:Show HN: 5 minute word game by ganashaw on Tuesday October 31, 2017 @09:18PM (#15598228)
My bonus round poem:

  Wise goat lay
  rat wash paw
  rise air bee! Soar!
  Laws lag
  slay
  lust
  bash.
Re:Show HN: 5 minute word game by JakDrako on Wednesday November 01, 2017 @07:46AM (#15600333)
Here's my Pulitzer winner:

    Miner toe jam
    pure crime mam
Re:Show HN: 5 minute word game by s369610 on Wednesday November 01, 2017 @03:31AM (#15599408)
Nice one! Poem: fat rat sad, get vet dad, fast... lag.... dead