Live data from Hacker News

2048 As A Service

github.com

11–20 of 54 posts

Re: 2048 As A Service

#13
post #2

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

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 = ; 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

#14
post #2

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

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

It is nice to see the INTERCAL way of doing things making a comeback.

Re: 2048 As A Service

#15

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

A desktop application that is distributed exclusively on floppies?

Re: 2048 As A Service

#16
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).

Re: 2048 As A Service

#17
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.

Re: 2048 As A Service

#20

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).

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

Requires some 1D to 2D though.

Post reply on HN