Mathober2024_Moment
Table of contents
PoemsFromDials2
PoemsFromDials2 is coded in Ruby and turns numbers into an array of their possible letters as seen on a phone below. After that it proceeds to reverse the transpose matrix of letters.
For the tenth piece for Mathober2024, We will using the 22nd prompt : Moment. In this second version of PoemsFromDails, we will be using the third moment in math known as skewedness , to have a couple of poems that are skewed in length.
Which then allows for the Two Rules of this poem framework to be mentioned:
If there is a letter the word must start or end with the letter shown
If there is a “*” instead of a letter, any word can be used but if it is “-”, that word has to be crossed out
Poem
Number = "3214782"
Number = "759" + "1245"
Output/Ruleset
f c * i s v c
e * * h r u *
d b * * q * b
* a * g p t a
s * z * c i *
r l y * * h l
q k x * b * k
p j w * a g j
Futuristic components and initialised traces, varying sonics
Emptying into the horizon, roaming under optics
Deflating hubs crazing massive questioning as beginnings
Are actualizing in groups, persons, technologies & animals
Sensing the buzz with casting images shooked
After letting years of vibes, hovering lobs
Quickly walk, flex with base, hook
Pass, jolt, wish with fish, air, glow & jobs
Interactive Version
https://www.jdoodle.com/ia/1jir
Change the numbers seen in the brackets to have your own PoemsFromDials
dailing("745" + "911")
dailing("18007932154")
Ruby Code
#two rule poetic format maker
#turn a phone a number that doesnt contain 7 or 9 into the letters of the phone
#then transpose the words , so a poem can be written out of the components
# Include matrix
require "matrix"
def dailing(digits)
#turn the number dailed to a string
digits = digits.to_s
len_dig = digits.length
count = 0
digits_array = digits.split("")
let_com = []
#phone numbercombos and to match the four letter matrix for a tranpose
#the star will represent that you have any letter and will be across different indexes
#this allows zero and one to be included
a0 = ['*','*','*','*']
a1 = ['*','*','*','*']
a2 = ['a','b','*','c']
a3 = ['*','d','e','f']
a4 = ['g','*','h','i']
a5 = ['j','k','l','*']
a6 = ['m','n','o','*']
a7 = ['p','q','r','s']
a8 = ['t','*','u','v']
a9 = ['w','x','y','z']
#hash the strings into the array
dial = { "0" => a0 , "1" => a1,"2" => a2, "3" => a3,"4" => a4,"5" => a5,"6" => a6,"7" => a7,"8" => a8,"9" => a9}
#default value for the array, when a random non number value enters
dial.default = ['-','-','-','-']
#push the array into the other via the dial index hash
while count < len_dig
let_com.push(dial[digits_array[count]])
count += 1
end
#transpose the array and then reverses the outcome
lineOfStr = let_com.transpose.reverse
counter = 0
while counter < lineOfStr.length
puts lineOfStr[counter].join(" ") #makes every subarray space out its elements
counter += 1
end
end
puts dailing("745" + "911")
puts dailing("18007932154")
Subscribe to my newsletter
Read articles from Kofi / Illestpreacha directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by