hcarvalhoalves 12 years ago
    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

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

  • ycaspirant 12 years ago

    Doesn't work for me. I'm using Safari on iOS 7.1.

    • zachlatta 12 years ago

      Doesn't work for me either. Latest version of Chrome on Android.

  • Achshar 12 years ago

    It seems to flash the tiles upon movement instead of sliding them. Which is kind of annoying when I try to play it fast.

javindo 12 years ago

This feels like HN satire but someone has actually gone and written the code so it's fairly elaborate...

  • korethr 12 years ago

    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

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.

  • hatu 12 years ago

    I'm just worried in reality it would just mean a flood of a thousand clones in the appstore.

    • edraferi 12 years ago

      Sure, but maybe that could be a good thing. For example, you could provide an API for Chess that ranks players across apps. You could use a Facebook ID or similar to merge identities across applications. Then players could choose the chess app they prefer and still be engaged with the larger community.

      • alttab 12 years ago

        You actually have something here.

  • chch 12 years ago

    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/

    • jordanlev 12 years ago

      Wow, that's really cool -- thanks!

  • saraid216 12 years ago

    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

    • claudius 12 years ago

      Building your own mudlib is always the most ridiculously amibitious part of any project of which it is a part :P

      But don’t most MUD clients follow these principles? Playing with tf5 does give you quite a few advantages over playing with plain telnet.

  • jackpirate 12 years ago

    That's exactly how FreeCiv (a clone of Sid Meier's Civilization II) is structured.

cs702 12 years ago

In hindsight, this seems... inevitable ;-)

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

keehun 12 years ago

10/10 would trust a ginormous 1-line Perl script again

userbinator 12 years ago

Finally, 2048 is now enterprise-ready.

  • mmanfrin 12 years ago

    I see no Java in this repo?

    • zwegner 12 years ago

      And where are the unit tests?!?!

      • alttab 12 years ago

        Unit tests? You mean functional api level load testing?

pearjuice 12 years ago

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

    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

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

    A desktop application that is distributed exclusively on floppies?

    • ekianjo 12 years ago

      We are still missing the C64 version.

  • alttab 12 years ago

    Bookmarklet. Play 2048 on any website, because.

fragmede 12 years ago

Not sure if I'm doing it right, but http://2048.semantics3.com/2048/ (their mvp) just returns {"message":"Please say hi..."}

  • goldfeld 12 years ago

    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.

    • Raphael 12 years ago

      What does AFJ mean?

      • isbadawi 12 years ago

        April Fools Joke, I would assume.

  • davidm 12 years ago

    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?

  • netvarun 12 years ago

    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); }}'
aspensmonster 12 years ago

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

And Threes!'s creators becomes more bitter and sour...

malkia 12 years ago

I would like to see an Excel extension with boss-mode key.

BobChubby 12 years ago

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

    COuld be formatted on 1 line. Like this: x-x-x-x-x-x-2-4-4

    Requires some 1D to 2D though.

    • matchu 12 years ago

      SMS seems to support newlines on my phone. Not sure how widely supported that is, though.

  • ygra 12 years ago

    With MMS you could get pictures back :)

largote 12 years ago

That "Sexy Perl one-liner" is hilarious.

  • largote 12 years ago

    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); }}'

    • netvarun 12 years ago

      HN formatting screws up the code :(

      This will work:

          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); }}'
      • eCa 12 years ago

        More readable:

            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

This seems like a lot of work for a joke.