// T H E
// ____ __ ____
// /\ \ /'_/'\ /\ _ /__ \
// \ \ / /\ \ \ \ ,\ __ //\ \
// \ \ \ \ \ __\ \ /''\ \ / /''\ \ \ \
// \ \ _ \ \ _/\ /\ /\ \ _/\ \L._ _\ \
// \ _\ \ _\ _\ _\ _\ _/._\ /_
// // // //// ////// //
// ______________________________________________________
// | |
// | ! I N S T R U C T I O N S #3 |
// ||
// | |
// | 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])
// 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
// For each line of the instructions...
for(let i=0;i<string.length;i++){
// Take each line...
let line = string[(start+i)%string.length]
let textReplacement = ''; // Prepare a variable...
// Decide on a random set of characters...
for(let j=0;j<i;j++){ // Loop by the line number
// Multiply the length of the set by the current line number
textReplacement += random().toString(36).substr(2, 1)}
// Replace '//' and '| 's in the line with the random character set
line = line.replace("//",textReplacement)
line = line.replace("| ",textReplacement)
// Render the line
text(line,2,-2+(i*(height/35)))}
// ######## END OF INSTRUCTIONS ########
// ||
// | |
// | Clicking anywhere doesn't do anything. |
// | It's a GIF. |
// | |
// | Made in p5js |
// ||
// | |
// | 4 Aug 2021 @Yazid |
// |______________________________________________________|