diff --git a/README.md b/README.md index 6ad7f9b..d36c28c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,12 @@ this in Bacon, but my Bacon is pretty raw. At best, I could propertize the cards to create a new card (i.e. a new state) every time a ball came in, but that seemed a little overwrought. -I'm sad that it requires underscore, but Node's native reduce doesn't -support object iteration, only arrays. - It was nice to have an opportunity to hack Coffee and Node again. + +I don't know that I trust Yahoo's server. At least once I got back a +"you lost" signal from the server. Since this client includes full +playback of every game, I could see that I had clearly won. +Unfortunately, my initial code assumed "lost" as the default state, so +I couldn't see if maybe the 'won' signal was lost before receiving the +disconnect. I've changed that to 'playing,' so we can see that +condition now. diff --git a/bingo.coffee b/bingo.coffee index f73c37b..ee7a9fd 100644 --- a/bingo.coffee +++ b/bingo.coffee @@ -4,7 +4,7 @@ io = require "socket.io-client" bingo = ["B", "I", "N", "G", "O"] coors = [0..4] -state = "lost" +state = "playing" snum = (n) -> if n < 10 then " #{n}" else "#{n}" fnum = (j) -> if j.found then "[#{snum(j.n)}]" else " #{snum(j.n)} "