Skip to content

Instantly share code, notes, and snippets.

@stoivo
Created July 10, 2018 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stoivo/e7fd992e234c5da6c33c78a6922a4005 to your computer and use it in GitHub Desktop.
Save stoivo/e7fd992e234c5da6c33c78a6922a4005 to your computer and use it in GitHub Desktop.
# oneline
a=[self].unshift 'secret';a.unshift 33;a.unshift :unlock;s=%w[se nd].join'';m=self.prison.method s.to_sym;m.to_proc[*a]
# mulltiline
a=[self].unshift 'secret';
a.unshift 33;
a.unshift :unlock;
s=%w[se nd].join'';
m=self.prison.method s.to_sym;
m.to_proc[*a]
@matz
Copy link

matz commented Jul 10, 2018

Here's my 85 char version:

class PrisonBreak::Prison;public:unlock;end;a=[22]|["secret"]|[self];prison.unlock *a

You need one more big trick to shorten to 53.

@stoivo
Copy link
Author

stoivo commented Jul 10, 2018

With the nolage I can shorten it to 93
s=%w[se nd].join'';m=self.prison.method s.to_sym;m.to_proc[*[:unlock]|[33]|['secret']|[self]]

@agvald
Copy link

agvald commented Jul 12, 2018

Here's my 64 char solution

s=prison.method methods[42];s[*[:unlock]|[22]|["secret"]|[self]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment