News for hackers. Stuff that matters.
Re:2048 in Emacs by zck on Tuesday May 06, 2014 @02:20PM (#7706203)
Whoa. I'm the author of this 2048-game.el (the one in MELPA; there are many implementations), located at https://bitbucket.org/zck/2048.el. The coloring is definitely something I've wanted to add to the game, but was holding off on for the moment.

Why? Scoring. 2048 has a score that's also a number. So if you colorize only based on keywords, you'll color the score too. And that's bad.

Edit: I'd happily take patches, suggestions, or pointers to documentation on how to do the colorization properly. Email in profile.

Re:2048 in Emacs by astine on Tuesday May 06, 2014 @04:37PM (#7706930)
Re:2048 in Emacs by sachac on Wednesday May 07, 2014 @08:29PM (#7713357)
Thanks for working on this! I didn't send a patch because I have terrible colour sense and haven't bothered checking for light backgrounds. I figured you knew about defface and already had plans for that at some point. I haven't played with faces much myself, so it was more of an excuse to share what I was learning with people. =) Looking forward to the upstream-colorized version!
Re:2048 in Emacs by kjhughes on Tuesday May 06, 2014 @02:04PM (#7706091)
That's just the colorization. Here's actual elisp by Steve Sprang (ssprang):

https://github.com/sprang/emacs-2048

Correction: Steve's above code is another implementation.

Colorization is against Zachary Kanfer's (zck) implementation in MELPA, which is here:

https://bitbucket.org/zck/2048.el

And don't miss David Thompson's (davexunit) Guile version mentioned below.

I'd much prefer to see these core code packages in the spotlight over the OP's mere colorization link.

Re:2048 in Emacs by davexunit on Tuesday May 06, 2014 @02:10PM (#7706127)
I read the source code to this a few weeks ago and got inspired to write my own 2048 clone in my Lisp of choice: Guile Scheme. It was a fun little hack.

Here's a screenshot after I mashed the arrow keys until I lost: http://media.dthompson.us/mgoblin_media/media_entries/3/Scre...

And the source (warning, messy): https://gitorious.org/guile-2d/guile-2d/source/a316893a68ae4...

Re:2048 in Emacs by 616c on Tuesday May 06, 2014 @03:34PM (#7706610)
Please keep it up. I go through the motions of reading about many different languages and technologies, and seeing your HN comments about your Guile work keep me coming back.
Re:2048 in Emacs by davexunit on Tuesday May 06, 2014 @03:50PM (#7706701)
Thanks for the encouragement!
Re:2048 in Emacs by naa42 on Tuesday May 06, 2014 @09:31PM (#7708160)
You've inspired me to publish my own version of 2048 for PalmOS, that I've written several weeks ago. It is also in Scheme. https://github.com/naa/2048-palm
Re:2048 in Emacs by davexunit on Wednesday May 07, 2014 @08:49AM (#7709821)
This is awesome. The source code is very short and concise. Thanks for sharing.
Re:2048 in Emacs by derengel on Tuesday May 06, 2014 @05:48PM (#7707292)
did you use gtk bindings?
Re:2048 in Emacs by davexunit on Tuesday May 06, 2014 @05:49PM (#7707294)
No, I used my work-in-progress game engine that uses an SDL and OpenGL.
Re:2048 in Emacs by ssprang on Tuesday May 06, 2014 @02:14PM (#7706161)
Actually, the one on MELPA appears to be a different implementation. There was some discussion about it on reddit: http://www.reddit.com/r/emacs/comments/21mklt/2048_puzzle_in...
Re:2048 in Emacs by dang on Tuesday May 06, 2014 @04:33PM (#7706912)
Since [1] was just adding colors, it seemed fair to change the url to the underlying implementation, so we did that.

[1] http://sachachua.com/blog/2014/05/2048-emacs-colours/

Re:2048 in Emacs by qdot76367 on Tuesday May 06, 2014 @04:44PM (#7706976)
Yeah, I should've dug a bit more into it, just saw Sacha's post on my RSS and went with that since I hadn't heard of Emacs 2048 at all yet. Thanks for the update.
Re:2048 in Emacs by swah on Tuesday May 06, 2014 @02:55PM (#7706388)