Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannycallaghan/27412f02b3d27240ab315266363f09c3 to your computer and use it in GitHub Desktop.
Save dannycallaghan/27412f02b3d27240ab315266363f09c3 to your computer and use it in GitHub Desktop.
Case 502 - A delicate matter - stage 2
/*
Officer: 8018788
CaseNum: 502-1-27755867-8018788
Case 502 - A delicate matter - stage 2
We’re hot on the trail kid, and another document has come my way.
It’s a little more tricky to decipher but I know you can do it.
In setup, fill in the redactedText String variable by replacing the redacted words
with references to the two arrays containing the missing pieces.
you can do this by indexing the appropriate items from the respective arrays.
There are many possible ways of completing this task,
but you should ONLY use the following commands:
" + Array[index].property + "
*/
// you dont need to change these
var missingWords;
var redactedText;
// arrays containing the names needed to fill in the paragraph
var AListing = [
{Detail0: "she has", Detail1: "a donation", Detail2: "rejoice"},
{Detail0: "consider", Detail1: "clip", Detail2: "clip"},
{Detail0: "bake", Detail1: "hurry", Detail2: "start"},
{Detail0: "radiate", Detail1: "charge", Detail2: "romantic"},
{Detail0: "delicate", Detail1: "charge", Detail2: "sneeze"},
{Detail0: "sneeze", Detail1: "protect", Detail2: "sail"},
{Detail0: "Edsger", Detail1: "sail", Detail2: "fence"},
{Detail0: "capital", Detail1: "tug", Detail2: "COBOL"},
{Detail0: "smile", Detail1: "mend", Detail2: "smile"},
{Detail0: "start", Detail1: "clip", Detail2: "rejoice"}
];
var BListing = [
{Detail0: "charge", Detail1: "charge", Detail2: "sail"},
{Detail0: "charge", Detail1: "clip", Detail2: "mend"},
{Detail0: "fence", Detail1: "play", Detail2: "succeed"},
{Detail0: "charge", Detail1: "start", Detail2: "clip"},
{Detail0: "hurry", Detail1: "meddle", Detail2: "hurry"},
{Detail0: "bake", Detail1: "Hopper’s", Detail2: "tug"},
{Detail0: "clip", Detail1: "protect", Detail2: "sail"},
{Detail0: "play", Detail1: "sail", Detail2: "succeed"},
{Detail0: "radiate", Detail1: "charge", Detail2: "hurry"},
{Detail0: "Governor Zuckerberg", Detail1: "plug", Detail2: "syndicate"}
];
var myFont;
var backgroundImg;
function preload() {
myFont = loadFont('SpecialElite.ttf');
backgroundImg = loadImage("Background.png");
}
function setup()
{
createCanvas(1280,800);
// replace all redacted words with the correct values from the data structures above
missingWords = "Edsger, Hopper’s, she has, romantic, COBOL, syndicate, delicate, capital, a donation, Governor Zuckerberg";
var newArray = [AListing[6].Detail0, BListing[5].Detail1, AListing[0].Detail0, AListing[3].Detail2, AListing[7].Detail2, BListing[9].Detail2, AListing[4].Detail0, AListing[7].Detail0, AListing[0].Detail1, BListing[9].Detail0];
redactedText = "My dearest " + newArray[0] + ", Please don’t doubt my sincerity when I say that I hadn’t the faintest idea about " + newArray[1] + " intervention. I suspect that " + newArray[2] + " a " + newArray[3] + " interest at the " + newArray[4] + ". I and the " + newArray[5] + " appreciate your many contributions over the years. However, this is a most " + newArray[6] + " matter which would require significant " + newArray[7] + " for me to deal with it satisfactorily. I would not be so crude as to suggest a sum but perhaps " + newArray[8] + " to my forthcoming campaign would help. Yours sincerely, " + newArray[9];
}
function draw()
{
// you don't need to change this
image(backgroundImg, 0, 0);
stroke(0);
strokeWeight(3);
line(width/2, 10, width/2, height - 10);
noStroke();
textFont(myFont);
textSize(14);
text(redactedText, 30, 100, 580, 600);
text(missingWords, 670, 100, 580, 600);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment