Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: An Open Source Number Game (zachschnell.com)
36 points by zsch on May 23, 2013 | hide | past | favorite | 32 comments


Getting a sum of 21 the first time gets you a score, and the second time (since you've already used that sum) it gets you a loss. I think it should make you lose the first time!

Also, cool game thanks for sharing.


The rules seem to be that it checks if it's an available multiple of 7 first and then if it's invalid. I initially thought the rules would work the way you have described, but if that was the case, would all multiples of 7 and 3 be off limits?


That's how it initially was. But I have now made it so that, as you say, it first checks to see if it's a multiple of 7. If it's a multiple of both 7 and 3 (regardless of whether or not you have played it before), then you will no longer be penalized.


I think I understand why you decided to do that, but it might be worth an explanation modification. I tested my understanding of the rules by trying 21, and was surprised. Not that it's a big deal!


I would recommend removing "7" from the board at all. The easiest opening move is to just start clicking all the 7s (since that guarantees you all multiples of 7 until you run out of 7s).

This strategy requires 0-thinking and is a bit tedious. If the board has no 7's on it, you're required to add from the get-go.

EDIT: Also, very fun little game. Thanks for sharing!


That only works until you hit 21, thats a multiple of 3 and you lose.


I hit three 7s and scored 21 points. Then four and got 28 points.


Looks like the cells are randomly populated, so my first attempt, I only had three '7's. I had a ton of '9's so I used the 10-10-9-9-9-9.... strategy to safely get me to a higher score, and then did a little math from there to hit each multiple of 7 on the way up.

Definitely a fun little distraction, I should be working though.


I need some social validation here, I could be at this all day, but unless I know that I was better than somebody else it feels like a waste of time.

not /s


Decent game. How is this HTML5 though? The gameplay happens within an HTML table and some simple javascript to turns that table into an interactive game. Seems like something that could have been done with HTML 1.


That is pretty cool. It would be handy if I can see the multiples of 7 that I have used already. That way I can figure out what to work towards next.


That's a great idea! The trick will be finding a place to display it. Maybe I'll add a button next to the score, and clicking it will reveal an overlay with played numbers.


A button would be good, but it would be even better if it showed up as soon as you played it. It would reduce the number of unnecessary clicks then and become more intuitive to play.


You could just display the smallest multiple of seven that hasn't been used yet.


@zsch I refactored your code using OOP and the factory design pattern. In this form it is much easier to alter the logic of the game. https://github.com/deckar01/mod7/tree/refactor and https://github.com/deckar01/mod7/tree/penalty-fives


This is fantastic. My only suggestion would be a stronger visual indication of when something gets added to the sum or the score. It probably sounds cosmetic, but visual feedback is helpful for reinforcing text explanations (at least for me, being a more hands-on learner).


That makes complete sense. I originally considered making a small noise when the sum was added to the score, though I'm leaning more towards flashing the updated score with a different color. Thank you for the feedback.


You should polish this up and release it on the app store! It has that perfect mix of fun and challenge to keep you entertained when you're waiting for something and its conveniently easy to pick up and play also.


This game is really great. My only complaint is it doesn't make sense that clicking 7 doesn't net you any points, but clicking 3 loses you the game. I'd say 7 should count as a score.


I agree. Just updated.


The grid doesn't appear properly in Firefox for me. clear your floats in the scoreboard.

Other than that, looks pretty cool.

EDIT: actually it also seems to not work in Firefox in general after refreshing the page


I confirm. Broken in Firefox.


Yep. The table needs a clear.


"You can only get credit for each multiple of 7 once…"

That carries across games; should it?

(Using Chrome 26.0.1410.65)

EDIT: I looked at the source; you do not reset sumslist.


Thank you for pointing that out. No it should be on a game by game basis. It should be fixed now.


Nice game. I would suggest a "subtraction" option. If you click on a number and the sum is neither a multiple of 7 or 3, then how bout you allow the user to click on a selected number again to deselect it and subtract its value from the sum.


Also, why is sum=3 not a fail case?


It is in his repo, it just isn't in the hosted version yet.


aah, okay


nice game. got up to 833 before I realized i'd been playing it way too long :)


Wats the max score that you have achieved? I am on 1470 and still playing


Really needs an indicator that tells you how many moves you have in a given turn, which goes down as you click.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: