Re:Writing a Polyglot Script
by SeekingMeaning on Saturday January 25, 2020 @04:04PM
(#22148604)
Behold my masterpiece
with inspiration from https://stackoverflow.com/q/6223285 and https://stackoverflow.com/a/2475931
[ Parent
| on HN ]
Re:Writing a Polyglot Script
by anonsivalley652 on Sunday January 26, 2020 @03:00AM
(#22151030)
Almost since doesn't quite work in Ruby:
Evaluating:
p='"%s"';r="'%s'";_='p=%s;r=%s;_=%s;print(_%%((0and[r%%p,p%%r,r%%_])or(tuple([r%%p,p%%r,r%%_]))))';print(_%((0and[r%p,p%r,r%_])or(tuple([r%p,p%r,r%_]))))
becomes: p='"%s"';r="'%s'";_='p=%s;r=%s;_=%s;print(_%%((0and[r%%p,p%%r,r%%_])or(tuple([r%%p,p%%r,r%%_]))))'%_]))))
Too many '%'s in some places
Re:Writing a Polyglot Script
by SeekingMeaning on Sunday January 26, 2020 @03:04PM
(#22154377)
Wait, it doesn’t? What’s your setup?