Live data from Hacker News

2048 As A Service

github.com

21–30 of 54 posts

Re: 2048 As A Service

#21
post #19

That "Sexy Perl one-liner" is hilarious.

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

#23

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.

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

Re: 2048 As A Service

#24

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.

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.

Re: 2048 As A Service

#29
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

Post reply on HN