// T H E
// ░░░ ░░░ ░░░ ░░░░░░░ ░░░░░░░░ ░░░░░ ░░░
// ░░ ░░░░ ░░░░ ░░ ░░ ░░ ░░ ░░
// ░░ ░░ ░░░░ ░░ ░░░░░ ░░ ░░░░░░░ ░░
// ░░ ░░ ░░ ░░ ░░ ░░ ░░ ░░ ░░
// ░░░ ░░ ░░ ░░░░░░░ ░░ ░░ ░░ ░░░
// ______________________________________________________
// | |
// | ! I N S T R U C T I O N S #6 |
// |______________________________________________________|
// | |
// | This OBJKT DOES NOT take its description metadata |
// | to execute it as code to render its output. |
// | But if it did, this GIF is what it would look like. |
// |______________________________________________________|
// | |
// ################ START OF INSTRUCTIONS ################
background(pieceColors[0]) // -------- Set background color
// ---------------------- Split the instructions into lines
let string = instructions.match(/[^\\r\\n]+/g) // ---------
// -------------------------------- Set the text appearance
textFont('Courier') // ---------------------------- Courier
textSize(height/44) // ---------------------- Relative size
fill(pieceColors[1]) // -------------- Either Light or Dark
// -------------------------- Set a rolling starting index
let start = frameCount%string.length // ------------------
// ----- While rendering each line of the instructions for
for(let i=0;i<string.length;i++){ // ---------- each frame
let line = string[(start+i)%string.length] // ------------
// -------- Replace the characters when the lines match up
for(let j=1;j<6;j++){if (i == floor(32/2-3)+j){ // -------
if(line===string[j]){line = line.replaceAll("░","▓") // --
} else {line = string[j]}}} // ---------------------------
text(line,2,-2+(i*(height/32))) }// -------Render the line
// ################# END OF INSTRUCTIONS #################
// |______________________________________________________|
// | |
// | Clicking anywhere doesn't do anything. |
// | It's a GIF. |
// | |
// | Made in p5js |
// |______________________________________________________|
// | |
// | 6 Aug 2021 @Yazid |
// |______________________________________________________|