Re: Newbie needs help, what's the most efficient (or easiest) way to do this?
Charles Joseph Christie II <
sonicbhoc@...>
2007-01-04 20:40:05 GMT
YOU'RE AWESOME!!!!! Thank you, I was trying to figure out how to do it,
and after a while thought my idea was completely wrong... I owe you
one, I'll go and try this right now!
Well, actually, after I finish all of the homework that's due tomorrow.
After I get this down, I just have to get the combo timer system thing
up... But I'll ask about that a little later. Thank you!
On Thu, 4 Jan 2007 15:24:46 -0500
Brandon N <kordova@...> wrote:
> I will not give you the code since you have stated this in an
> assignment, but hopefully I can help.
>
> You are correct that you will need an array, or a list in Python, to
> store the strings. I would be more concerned with ease of
> programming than efficiency, as this is a pretty straightforward and
> non- demanding application.
>
> So, with that said, you will want your Textsprite class to take a
> list of strings instead of just a string. You can do this by saying:
>
> a = Textsprite(["test string1", "another test!", "can you type
> this?"])
>
> Now, in your textsprite class, you have a variable that stores the
> index of the current letter. You will also have to store the index
> of the current string, and replace all references of self.text with
> it, as in self.text[self.current_string]. Now, when the user
> completes a string, you can increment self.current_string and reset
(Continue reading)