top | item 7510670

2048 As A Service

179 points| netvarun | 12 years ago |github.com | reply

52 comments

order
[+] hcarvalhoalves|12 years ago|reply

    This API follows ZEST principles.

    All requests must begin with a /hi.

    Failure to do so will result in a 800 'Please say hi...' error.
Priceless!
[+] netvarun|12 years ago|reply
2048-as-a-service author here.

Do also checkout our demo showcase app built using the 2048-as-a-service API:

2048 - Startup Growth Edition (MVP) - http://2048.semantics3.com/2048.html

[+] Achshar|12 years ago|reply
It seems to flash the tiles upon movement instead of sliding them. Which is kind of annoying when I try to play it fast.
[+] ycaspirant|12 years ago|reply
Doesn't work for me. I'm using Safari on iOS 7.1.
[+] javindo|12 years ago|reply
This feels like HN satire but someone has actually gone and written the code so it's fairly elaborate...
[+] korethr|12 years ago|reply
IMO, the best April 1st jokes are both good satire and well thought out enough to actually be implemented. Consider that RFC 1149 was intended as a joke, only to actually be successfully implemented years later.
[+] jordanlev|12 years ago|reply
I get that this is a joke, but I do think a really cool concept for a game would be one where there is just an API for the "state" and that is responsible for the mechanics and rules of the game, but that you would build your own custom client for the UI. For example, some kind of spaceship battle game where you create your own interface for controlling the ship... it would be kind of a meta-game where creating the interface a certain way might give you advantages in terms of efficiency versus others.
[+] chch|12 years ago|reply
Schemaverse[1] could be considered something similar, I think, down to the "space-based strategy game", although it is controlled by raw SQL queries instead of an API.

[1] https://schemaverse.com/

[+] jackpirate|12 years ago|reply
That's exactly how FreeCiv (a clone of Sid Meier's Civilization II) is structured.
[+] saraid216|12 years ago|reply
Back when I was working on my own MUD, this was one of my intents. I'd set up the system and then define an API off it for anyone to build their own client.

This was mostly because I was pretty strongly principled against forcing a particular display on the player. I wanted them to be able to explore via a text-based interface or a graphical one.

...and as it turns out, this was not the most ridiculously ambitious part of that project. :P

[+] hatu|12 years ago|reply
I'm just worried in reality it would just mean a flood of a thousand clones in the appstore.
[+] cs702|12 years ago|reply
In hindsight, this seems... inevitable ;-)

(I can't help but wonder where and how 2048 will show up next.)

[+] keehun|12 years ago|reply
10/10 would trust a ginormous 1-line Perl script again
[+] userbinator|12 years ago|reply
Finally, 2048 is now enterprise-ready.
[+] mmanfrin|12 years ago|reply
I see no Java in this repo?
[+] pearjuice|12 years ago|reply
Are there seriously people running obfuscated Perl scripts from third parties in a terminal with root access?

You might as well open up a SSH daemon on the default port without root password.

[+] JeremyMorgan|12 years ago|reply
Yes, you see Perl is hip now. And since the hipsters barely learned how to make an alert in JS before calling themselves a "full stack dev" they really don't know any better.

Perl one liner bro - check it out.

[+] symmetricsaurus|12 years ago|reply
This is hilarious. This probably won't be, but should be the final entry in the series of 2048 clones.

I guess that you could de-servicify it and create own2048, not that I know how it would differ from the original version...

[+] OnACoffeeBreak|12 years ago|reply
A desktop application that is distributed exclusively on floppies?
[+] alttab|12 years ago|reply
Bookmarklet. Play 2048 on any website, because.
[+] fragmede|12 years ago|reply
Not sure if I'm doing it right, but http://2048.semantics3.com/2048/ (their mvp) just returns {"message":"Please say hi..."}
[+] netvarun|12 years ago|reply
2048-as-a-service author here.

Type curl -L http://2048.semantics3.com/hi/start to get started. Here is a full example on how to play it:

https://github.com/Semantics3/2048-as-a-service#full-example...

If you want a full game on the console:

    perl -e 'my $host = "http://2048.semantics3.com/hi/";my $cmd = "curl --silent -L $host"."start";my $output = `$cmd`;my $session_id = $output;$session_id=~s/.*?ID:\s(\w+).*/$1/si;my %keyMap = ( 'w' => 0, 'd' => 1, 's' => 2, 'a' => 3);print STDERR $output,"\n";while(1) { print STDERR "Input (w - up, a - left, d - right, s - down):\n"; my $userInput = <STDIN>; chomp ($userInput); if(defined($keyMap{$userInput})) { $userInput = $keyMap{$userInput}; } else { print STDERR "Invalid move.. w - up, a - left, d - right, s - down\n"; next; } my $cmd = "curl --silent $host"."state/$session_id/move/$userInput"; my $output = `$cmd`; print STDERR "\n$output\n"; if($output=~/Message:/si) { exit(0); }}'
[+] goldfeld|12 years ago|reply
I think when they say MVP they might really mean AFJ, which would make the behavior you observed more understandable. Some AFJ purists would even claim it's the right way to do it under the methodology, which is arguably one of its major differences from the MVP credo.
[+] davidm|12 years ago|reply
Drop the /2048 from the end of the url and replace it with /hi/start/json It really does appear to respond as advertised!

Is this the most elaborate April fool of the day?

[+] aspensmonster|12 years ago|reply
Edit: It's missing a snarky game over message. Something like "you pivoted too late" would be perfect for a game like this, don't you think?

"Unstoppable! You are the next Rap Genius!"

"Growth Hacker Extraordinaire! You are the next Optimizely!"

I like it more than the other offers that April Fools has provided thus far. Somewhat reminiscent of this thread: http://chan.installgentoo.com/g/thread/38087806

[+] li-ch|12 years ago|reply
And Threes!'s creators becomes more bitter and sour...
[+] malkia|12 years ago|reply
I would like to see an Excel extension with boss-mode key.
[+] BobChubby|12 years ago|reply
I remember I used to play hangman by texting letters to a phone number and it would reply with how much of the word I had figured out. It would be awesome to be able to play 2048 over SMS (but painstakingly slow to complete).
[+] servowire|12 years ago|reply
COuld be formatted on 1 line. Like this: x-x-x-x-x-x-2-4-4

Requires some 1D to 2D though.

[+] ygra|12 years ago|reply
With MMS you could get pictures back :)
[+] largote|12 years ago|reply
That "Sexy Perl one-liner" is hilarious.
[+] largote|12 years ago|reply
For reference: perl -e 'my $host = "http://2048.semantics3.com/hi/";my $cmd = "curl --silent -L $host"."start";my $output = `$cmd`;my $session_id = $output;$session_id=~s/.?ID:\s(\w+)./$1/si;my %keyMap = ( 'w' => 0, 'd' => 1, 's' => 2, 'a' => 3);print STDERR $output,"\n";while(1) { print STDERR "Input (w - up, a - left, d - right, s - down):\n"; my $userInput = <STDIN>; chomp ($userInput); if(defined($keyMap{$userInput})) { $userInput = $keyMap{$userInput}; } else { print STDERR "Invalid move.. w - up, a - left, d - right, s - down\n"; next; } my $cmd = "curl --silent $host"."state/$session_id/move/$userInput"; my $output = `$cmd`; print STDERR "\n$output\n"; if($output=~/Message:/si) { exit(0); }}'
[+] barretts|12 years ago|reply
This seems like a lot of work for a joke.