News for hackers. Stuff that matters.
Re:2048 As A Service by fragmede on Tuesday April 01, 2014 @03:17PM (#7510951)
Not sure if I'm doing it right, but http://2048.semantics3.com/2048/ (their mvp) just returns {"message":"Please say hi..."}
Re:2048 As A Service by netvarun on Tuesday April 01, 2014 @03:53PM (#7511204)
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); }}'
Re:2048 As A Service by zaptheimpaler on Tuesday April 01, 2014 @03:27PM (#7511030)
This is actually documented in the API. Turns out the API just wants your program to be polite and say hi when calling it.

https://github.com/Semantics3/2048-as-a-service#zest-princip...

Re:2048 As A Service by HCIdivision17 on Tuesday April 01, 2014 @03:53PM (#7511207)
It is nice to see the INTERCAL way of doing things making a comeback.
Re:2048 As A Service by goldfeld on Tuesday April 01, 2014 @03:21PM (#7510978)
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.
Re:2048 As A Service by Raphael on Tuesday April 01, 2014 @03:42PM (#7511131)
What does AFJ mean?
Re:2048 As A Service by isbadawi on Tuesday April 01, 2014 @03:44PM (#7511148)
April Fools Joke, I would assume.
Re:2048 As A Service by davidm on Tuesday April 01, 2014 @03:32PM (#7511053)
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?

Re:2048 As A Service by ojbyrne on Tuesday April 01, 2014 @03:27PM (#7511026)