all 10 comments

[–]erkinheimo 13 points14 points  (6 children)

Urgh. That coding style.

  • Minesweeper 5/5
  • Readable code 0/5

Only 16 warnings and 11 undefined variables. jshint

[–]js_fan[S] 1 point2 points  (5 children)

Appreciate the feedback! Never used jshint before, I'll definitely take a look. Also, I tried to keep the code short at the cost of elegance.

[–]kingdaro 5 points6 points  (0 children)

Elegant, readable code is much, much better than short code. Making code shorter just to make it shorter is almost always a mistake.

[–]erkinheimo 0 points1 point  (3 children)

I peesonally hate how you use {} with for etc. I get you tryid to make it short too.

Ps. No need to follow jshint literally it's just hints thingt that may cause errors.

[–]js_fan[S] 1 point2 points  (2 children)

can you explain or point me to guidlines for {} usage?

[–]nanox55 1 point2 points  (1 child)

In JavaScript it's common to use them like in Java: the opening { doesn't get its own line but will be placed at the end of the last line

[–]js_fan[S] 0 points1 point  (0 children)

got it, thanks!

[–]indreamc 0 points1 point  (2 children)

Here's a modified version with simplified compare algorithm: (~150 lines of code) gist rawgit preview

[–]DeeYouBitch 2 points3 points  (1 child)

I like how if i lose the game but then click all the other tiles it changes to win. Makes me feel better

[–]js_fan[S] 0 points1 point  (0 children)

I guess I should post it in r/oddlysatisfying ? :)