"We are Number One" played 16 times but every occurrence of the words "one", "superhero", "sound", "net", and "banana" is replaced by either "net" or "banana" based on the following rules: For simplicity, let's refer to the ith word to be transformed in song iteration j as w[j][i], (using zero-based indices). Note that this index i is not the position among all the words in the lyrics, but just among the subset of words which are candidates to be replaced. For iteration j ≥ 1: Consider the substituted value at the same word index in the prior iteration and its two neighbors : these are w[j-1][i-1], w[j-1][i], and w[j-1][i+1]. (Note: If w[j-1][i-1] or w[j-1][i+1] are out-of-range (which will happen if i is 0 or 15) consider the out-of-range value to be "net".) Form a 3-digit bit string from these three word values: using 1 if the word is "banana", and 0 otherwise. For example: "banana", "net", "net" becomes "100". Take the integer represented by this bit string as a binary number, call it n. Look at the nth bit from the right in the binary string 1101110 (binary representation of the decimal number 110). If the resulting bit is a 1: then w[j][i] is replaced with "banana", otherwise if the bit is 0 then w[j][i] is replaced with "net". For iteration j = 0: Since there is no prior iteration, we define seed values as follows: all replacements use "net" except for the iteration's final "one" ( w[0][15] ) which is replaced with "banana". A two-dimensional chart representing "banana" vs. "net" values is rendered as an overlay as each replacement occurs, using a light-tinted video to represent "net" and dark-tinted video to represent "banana".
Comments (0)