Skip to content

Instantly share code, notes, and snippets.

@jacobrosenthal
Created November 13, 2017 05:24
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 jacobrosenthal/cf9d5ce5f15db817feb966970c33b007 to your computer and use it in GitHub Desktop.
Save jacobrosenthal/cf9d5ce5f15db817feb966970c33b007 to your computer and use it in GitHub Desktop.
Hackaday Superconference Badge 2017 manifesto puzzle
var manifesto =
["all... after all, we're all alike.",
"individual, but you can't stop us",
"manifesto. You may stop this",
"I am a hacker, and this is my",
"me for.",
"something that you will never forgive",
"crime is that of outsmarting you,",
"think, not what they look like. My",
"judging people by what they say and",
"of curiosity. My crime is that of",
"Yes, I am a criminal. My crime is that",
"yet we're the criminals.",
"make us believe it's for our own good,",
"murder, cheat, and lie to us and try to",
"atomic bombs, you wage wars, you",
"and you call us criminals. You build",
"nationality, without religious bias...",
"We exist without skin color, without",
"knowledge... and you call us criminals.",
"you call us criminals. We seek after",
"call us criminals. We explore... and",
"run by profiteering gluttons, and you",
"what could be dirt-cheap if it wasn't",
"already existing without paying for",
"of the baud. We make use of a service",
"the electron and the switch, the beauty",
"This is our world now... the world of"
]
.reverse() //the strings dump has this in reverse order
var nums =
[
-4,
-21,
-18,
9,
-1,
-12,
-3,
-7,
-21,
7,
-6,
4,
-9,
-20,
-23,
-1,
0,
-8,
8,
-1,
-1,
-18,
9,
3,
-6,
-10,
-21]
var padded = manifesto.map((line) => Array(24).join(' ') + line);
var rows = [];
for (let [index, value] of padded.entries()) {
var offset = nums[index];
if (offset < 0) {
rows.push(value.slice(offset * -1));
continue;
}
if (offset > 0) {
var padding = Array(offset + 1).join(' ');
rows.push(padding + value);
continue;
}
rows.push(value);
}
console.log(rows.join('\n'))
var columns = []
for (i=0; i < 100; i++){
var str = ""
for (row of rows) {
if(row[i] && row[i].trim()) {
str += row[i]
}
}
columns.push(str)
}
console.log(columns)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment