News for hackers. Stuff that matters.
Re:2048 in sed by xnevs on Tuesday March 25, 2014 @04:32AM (#7464590)
I think this game is a bit different than http://gabrielecirulli.github.io/2048/ Take a look at this situation:

   ___________________
  |___2|____|____|____|
  |___2|____|____|____|
  |___2|____|____|____|
  |____|____|____|____|
in the original the result of going up would be

   ___________________
  |___4|____|____|____|
  |___2|____|____|____|
  |____|____|____|____|
  |____|____|____|____|
but in this game it's

   ___________________
  |___2|____|____|____|
  |___4|____|____|____|
  |____|____|____|____|
  |____|____|____|____|
Re:2048 in sed by themattrix on Tuesday March 25, 2014 @11:03AM (#7466279)
This bug is now fixed! Thanks for pointing it out!
Re:2048 in sed by scope on Tuesday March 25, 2014 @04:57AM (#7464668)
no score too! :(

how am i suppose to know when i break my own record [i.e. 3012 - never got passed 512 on the tiles]

Re:2048 in sed by themattrix on Tuesday March 25, 2014 @11:05AM (#7466291)
I'll look into adding this. (I think I'll have to add it to the bash wrapper.)
Re:2048 in sed by themattrix on Tuesday March 25, 2014 @02:42PM (#7467890)
Score is now implemented -enjoy!
Re:2048 in sed by scope on Wednesday March 26, 2014 @01:05AM (#7471716)
thanks!

edit: you broke it :(

Re:2048 in sed by themattrix on Thursday March 27, 2014 @09:21PM (#7484690)
Fixed! The score is now calculated as the sum of all merge results (like the original game), instead of the sum of all cells (like I was doing).

As a bonus, the score calculation is now done in pure sed.

If you notice any other issues, please let me know!

Re:2048 in sed by scope on Friday March 28, 2014 @12:51AM (#7485411)
thanks
Re:2048 in sed by themattrix on Friday March 28, 2014 @11:49AM (#7487948)
One final gameplay tweak: there's now a 90% chance that a newly-spawned tile will be a "2" and a 10% chance that it will be a "4".

The gameplay should now be identical to the original 2048.

Re:2048 in sed by robinson-wall on Tuesday March 25, 2014 @05:24AM (#7464738)
> Note for OS X users: The version of sed installed has different options than the Linux one. Notably, it does not have the extended-regex option -r. I recommend building the latest version from here: http://sed.sourceforge.net/

The option is there, just different: -E (the same as grep)

Re:2048 in sed by LukeShu on Tuesday March 25, 2014 @08:06AM (#7465292)
GNU sed 4.2.0 and up also support -E for compatibility with BSD sed (though this is undocumented).
Re:2048 in sed by celebril on Tuesday March 25, 2014 @07:36AM (#7465152)
Why doesn't Apple just ship with standard GNU utils?

They are the de facto standard. Having the need to compile all these basic stuff for any scripting to be portable is a nightmare.

Re:2048 in sed by gkya on Tuesday March 25, 2014 @09:05AM (#7465566)
If your well-beloved GNU coreutils did not breach every POSIX standard and add new flags to every program, no such problem would exist. Seriously, I do not know whether Mac OS is using a custom implementation of UNIX utilities, or distributin BSD coreutils, but I know that it is a licensed, certified UNIX.
Re:2048 in sed by celebril on Tuesday March 25, 2014 @09:11AM (#7465587)
UNIX certification means nothing if the utils are intentionally outdated and incompatible with the de facto UNIX-like implementation due to petty licensing concerns.

At the end of the day, whether some script works is the issue, not a UNIX branding.

Re:2048 in sed by james2vegas on Friday March 28, 2014 @07:40PM (#7490676)
Except Mac OS X is a de jure UNIX implementation, and concern about GPLv3 is not petty.
Re:2048 in sed by Spiritus on Tuesday March 25, 2014 @08:32AM (#7465405)
I believe it's a licensing issue, could be completely wrong though.
Re:2048 in sed by 13throwaway on Tuesday March 25, 2014 @08:48AM (#7465467)
Apple has chosen not to ship any GPLv3 code.
Re:2048 in sed by codezero on Tuesday March 25, 2014 @02:53AM (#7464300)
I am so sick of the Three's, 1024, 2048 posts on Hacker News, but I upvoted this because of sed :P
Re:2048 in sed by carlesfe on Tuesday March 25, 2014 @04:12AM (#7464530)
We just need now the 2048 in assembler, and we'll be done!

Just joking, I love these and I'm unemployed. Keep'em coming!

Re:2048 in sed by Ideka on Tuesday March 25, 2014 @07:54AM (#7465226)
Well, there's this: https://github.com/Sanqui/2048-gb

It was posted on HN but didn't really take off, sadly: https://news.ycombinator.com/item?id=7434529

Re:2048 in sed by jader201 on Tuesday March 25, 2014 @09:53AM (#7465801)
I bet had they left "Show HN: " off, it would've gained more traction. I have several theories behind that:

1) It looks more like a discovery.

2) It doesn't look like a self promotion.

3) The point of the article is at the beginning. I.e. a certain percentage don't read past "Show HN".

Again, just theories. No idea if this is really the case. But I don't remember many (maybe any) of the other 2048 clones making it to the first page being "Show HN" submissions.

Re:2048 in sed by segmondy on Tuesday March 25, 2014 @04:50PM (#7468868)
The one that's done for Atari is in assembly. I made one in Prolog last weekend as an exercise since I'm learning Prolog. I figured it was a matter of time till the variation became about language implementation.
Re:2048 in sed by midas007 on Tuesday March 25, 2014 @03:52AM (#7464463)
Sed awesome.

Also, disappointed no one has blatantly embedded https://github.com/progranism/Bitcoin-JavaScript-Miner to put all this time wasting to good u$e.

Re:2048 in sed by Ellipsis753 on Tuesday March 25, 2014 @07:58AM (#7465249)
Sadly that javascript miner is stupidly slow. You could have a top Hacker News post and still only make pennies.
Re:2048 in sed by nwh on Tuesday March 25, 2014 @08:42AM (#7465441)
Not even that really. You might get a single difficulty 1 share or two, worth literally less than the maximum precision BTC allows.
Re:2048 in sed by midas007 on Wednesday March 26, 2014 @04:28PM (#7476375)
You didn't get the joke. That's okay.
Re:2048 in sed by caioariede on Tuesday March 25, 2014 @10:18AM (#7465973)
There is Sokoban in sed too.

For who is interested in other games written in sed.

http://aurelio.net/projects/sedsokoban/

Re:2048 in sed by gwu78 on Tuesday March 25, 2014 @10:35AM (#7466076)
I also like his poker hand sed script.

Best part is he uses BSD sed. No newlines as patterns.

We use tr(1) for that.

Re:2048 in sed by themattrix on Tuesday March 25, 2014 @11:10AM (#7466324)
Author here - glad you like it! I actually found the poker hand identifier more challenging to write than 2048, but I also tried to make it as compact as possible.

https://github.com/themattrix/poker_hand

Re:2048 in sed by adito on Tuesday March 25, 2014 @05:13AM (#7464707)
Have someone made Emacs version? Isn't it more easy to write it in elisp compared to sed.
Re:2048 in sed by RBerenguel on Tuesday March 25, 2014 @05:41AM (#7464790)
Well, writing in sed has essentially the "heh, look what I did in sed!" value. Elisp would be a far more simple place to build it (we already have tetris there, there's even a very old simple version of Elite in emacs lisp!)
Re:2048 in sed by calebm on Tuesday March 25, 2014 @10:49AM (#7466174)
Yep. "Real programmers write games in sed".
Re:2048 in sed by discardorama on Tuesday March 25, 2014 @07:56AM (#7465235)
I'm sure Emacs has a "unix mode" hidden in there somewhere. Inside it, I bet there's a full complement of GNU utils. Sed should be in there somewhere.
Re:2048 in sed by calebm on Tuesday March 25, 2014 @10:43AM (#7466125)
Hey Matt... I mean "Sed and Awk the great" :)
Re:2048 in sed by themattrix on Thursday March 27, 2014 @09:23PM (#7484694)
You've revealed my secret identity!