Re: Creating a replacement cypher with triple-quoted strings
Wait, I shouldn't use triple quoted strings as the desired output?
That's what my original question was asking:
How can I get an input of 'cab' to
X 0 X X X 0 X X 0 0 X X
0 X 0 X 0 X 0 X 0 X 0 X
0 X X X 0 0 0 X 0 0 X X
0 X 0 X 0 X 0 X 0 X 0 X
X 0 X X 0 X 0 X 0 0 X X
Re: Creating a replacement cypher with triple-quoted strings
The only way I could come up with is to have the program print four letters (one row), and then start a new line. Print the next four, start a new line, etc.
The problem with that is they wouldn't form next to each other like a word, they would be stacked like the for c in word: print(c) did, wouldn't it?
To fix that, I would have to "scrape off" the top layer of each word, print it as a concatenation, then strip out the next line, print it, and so forth.
Is it possible to pull only part of a string, or would I have to make a list with five lines for each letter?
Well, even if I did that, how would I tell it where to find it's information? I don't think there's a fairly simple way to have it read 1.1, then skip to 2.1 five strings away, then come back to 1.2.
I'm afraid I have no idea where you're trying to lead me, Gribouillis.
Re: Creating a replacement cypher with triple-quoted strings
I'm afraid I'm going to have to throw my hands up on this one. My brain is leaking out of my ears.
I get what we're trying to do, but I don't know how to tell the computer itself. I'm brand-spanking new to Python and can't find what I need in the documentation.
find the ideogram x corresponding to c / append x to our list L
I know what this means, but I can't for the life of me figure out how to do it. I'm trying to read Greek and speak Russian!
The biggest problem I'm having with it is that I can't figure out how to get the system to read them as a group of letters, rather than X's and 0's.
Wait, would I want to use a list and slice it? But then how would it know which position is correct?
Last edited by Warkthogus; Sep 3rd, 2009 at 4:23 pm.
Re: Creating a replacement cypher with triple-quoted strings
I for one am not sure what you are trying to do. It is something like this? If not, please post some input and desired output examples. Also, if joining, remember that each triple quoted string is one string and not a list.
Re: Creating a replacement cypher with triple-quoted strings
Woooee, I'm not sure how else to explain it. I laid out my thought process earlier, and don't know any other way to show it.
Quote ...
How can I get an input of 'cab' to
X 0 X X X 0 X X 0 0 X X
0 X 0 X 0 X 0 X 0 X 0 X
0 X X X 0 0 0 X 0 0 X X
0 X 0 X 0 X 0 X 0 X 0 X
X 0 X X 0 X 0 X 0 0 X X
I want the letters to be converted into the ascii "art" of letters. I'm trying to make a program to output a blueprint for making letters with cups in chain link fences.
Re: Creating a replacement cypher with triple-quoted strings
My attempt. Once again, if not correct, post back with more info. The trick (I think) is to split each string on the "\n" to create individual rows, and is similiar to Gribouillis' solution but doesn't use list comprehension (which is an amazing tool). It instead uses a dictionary with row number as the key, in this case 0 through 4, and appends each row to the corresponding key. Finally, the joined rows are spaced and printed. Hopefully, using a dictionary with the row number is easy to understand.
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.