

2048 in Emacs - qdot76367
https://bitbucket.org/zck/2048.el

======
zck
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](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.

~~~
astine
Just use `font-lock-unfontify-region'

[https://www.gnu.org/software/emacs/manual/html_node/elisp/Ot...](https://www.gnu.org/software/emacs/manual/html_node/elisp/Other-
Font-Lock-Variables.html)

------
kjhughes
That's just the colorization. Here's actual elisp by Steve Sprang (ssprang):

[https://github.com/sprang/emacs-2048](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](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.

~~~
davexunit
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...](http://media.dthompson.us/mgoblin_media/media_entries/3/Screenshot_from_2014-03-31_163501.png)

And the source (warning, messy):
[https://gitorious.org/guile-2d/guile-2d/source/a316893a68ae4...](https://gitorious.org/guile-2d/guile-2d/source/a316893a68ae44a100d6dc5be34bf2c7d582e9ca:examples/guile-2048/guile-2048.scm)

~~~
616c
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.

~~~
davexunit
Thanks for the encouragement!

------
dang
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/](http://sachachua.com/blog/2014/05/2048-emacs-colours/)

~~~
qdot76367
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.

------
swah
Atom version
[https://atom.io/packages/atom-2048](https://atom.io/packages/atom-2048)

