???gs2, 3 bytes, cracked by feersum
e|h
(Posts must be at least 30 characters, so here's some padding.) In gs2
:
e
or\x65
isproduct
on lists (such as the empty list of characters representing STDIN), so it pushes an int1
.|
or\x7c
ispower-of-2
, which changes it into 21 = 2.h
or\x68
ishello
, which is a ridiculous command. The story goes as follows: when designinggs2
, I set out to beat every code golf language on shinh's golf server, butgoruby
has an easter egg commandh
that printsHello, world!
(note the lowercase w), allowing it to claim the #1 spot on the hello world challenge's leaderboards. I wanted to one-up goruby, so I added my own easter egg commandh
that pushesHello, world!
to the stack, but allows you to customize the capitalization and punctuation by pushing an integer before it:elif t == '\x68': #= hello x = 0 if len(self.stack) >= 1 and is_num(self.stack[-1]): x = self.stack.pop() x = (range(0, 11) + [100, 1000, 16, 64, 256]).index(x) s1 = 'h' if x & 1 else 'H' s2 = 'W' if x & 2 else 'w' s3 = ['!', '', '.', '...'][((x & 4) >> 2) | ((x & 16) >> 3)] s4 = '' if x & 8 else ',' f = '%sello%s %sorld%s' % (s1, s4, s2, s3) self.stack.append(to_gs(f))
As you can see by looking at the
s2 =
line, if there's a number2
at the top of the stack, it'll get replaced with the uppercase-W variation:Hello, World!
.