Permutations
From artserver wiki
Permutations 2
2016.08.17
Shifting words
The following exercise also comes from Bryon Gysin's Permutations in the work I THINK THEREFORE I AM.
Although it is a much simpler case, with a linear placing of the last word to the start of a new sentence, and therefore not requiring recursion.
Despite its simplicity, I find striking the various meanings that emerge from this shifting of elements. From exclamations, to questions, and broken English. And the lack of punctuation allows the reader to place commas, question marks, exclamation marks, full stops where she feels adequate to convey the meaning of each sentence.
def shift(sentence): head = sentence.split(' ') #var should be given another name n =0 for i, letter in enumerate(head): if i == 0: newsentence = head else: newhead = head[0:-i] #between [0] and [i] #BCD, BC, B # B tail = head[len(head)-n:] newsentence = tail + newhead n += 1 outstr = (' ').join(newsentence) yield outstr sentence='I think therefore I am' for i in shift(sentence): print i.upper() print sentence = 'In the beginning was the Word' for i in shift(sentence): print i.upper() print sentence = 'Quem planta ventos colhe tempestades' for i in shift(sentence): print i.upper()
I THINK THEREFORE I AM I THINK THEREFORE I AM I THINK THEREFORE I AM I THINK THEREFORE I AM I IN THE BEGINNING WAS THE WORD IN THE BEGINNING WAS THE WORD IN THE BEGINNING WAS THE WORD IN THE BEGINNING WAS THE WORD IN THE BEGINNING WAS THE WORD IN QUEM PLANTA VENTOS COLHE TEMPESTADES QUEM PLANTA VENTOS COLHE TEMPESTADES QUEM PLANTA VENTOS COLHE TEMPESTADES QUEM PLANTA VENTOS COLHE TEMPESTADES QUEM
2016_08_17
Blog
... more about "Permutations"