Computer Science Canada

text repetition

Author:  ahmhum [ Mon Mar 10, 2008 1:39 pm ]
Post subject:  text repetition

can anyone help me with a text repetion
thnx Smile

Author:  OneOffDriveByPoster [ Mon Mar 10, 2008 1:51 pm ]
Post subject:  Re: text repetition

Describe what text repetition is... echoing back?

Author:  richcash [ Mon Mar 10, 2008 2:45 pm ]
Post subject:  RE:text repetition

Maybe he means creating a string by using a repeating substring, such as the repeat function in turing.

I don't know any predefined method to do that in java, but you could use a for loop and/or define your own method. Using StringBuffer and then converting to String at the end might be more efficient.

Author:  A.J [ Mon Mar 10, 2008 5:54 pm ]
Post subject:  Re: text repetition

richcash wrote:

Maybe he means creating a string by using a repeating substring, such as the repeat function in turing.

I don't know any predefined method to do that in java, but you could use a for loop and/or define your own method. Using StringBuffer and then converting to String at the end might be more efficient.

yup, richcash is right.
using string buffer and then converting it to string at the end IS INDEED more efficient!
But elaborate on 'text repetition' please,ahmhum, so then we can see your code or whatever it is and help you out Very Happy

Author:  ahmhum [ Mon Mar 10, 2008 9:35 pm ]
Post subject:  RE:text repetition

i am trying to make the numbers repeat
just like from the movie matrix

Author:  A.J [ Mon Mar 10, 2008 10:49 pm ]
Post subject:  Re: text repetition

In that case I have a PERFECT example in turing.
but the main idea is that you have a string for random digits (say '1031234874...' for example),
then you just keep outputting that string in a cool color in a cool background!!!!!

Author:  ahmhum [ Mon Mar 10, 2008 11:57 pm ]
Post subject:  Re: text repetition

this is what i have now

Author:  A.J [ Tue Mar 11, 2008 9:44 am ]
Post subject:  Re: text repetition

It looks good Very Happy
so what is the problem with it?

Author:  ahmhum [ Tue Mar 11, 2008 3:22 pm ]
Post subject:  RE:text repetition

i can't put another text on top of it cuz the numbers cover it up

Author:  ahmhum [ Tue Mar 11, 2008 3:31 pm ]
Post subject:  Re: text repetition

this is what happens

Author:  A.J [ Tue Mar 11, 2008 3:46 pm ]
Post subject:  Re: text repetition

when you add the second line of numbers, just add a line of space before it! doesn't that work?
for example:
code:

add -> "1031234234432..."
add -> "                         "
           "1031234234432..."
add -> "                         "
           "                         "
           "1031234234432..."
etc...

so the output should look like:
code:

1031234234432...
1031234234432...
1031234234432...
etc...

Author:  Nick [ Tue Mar 11, 2008 5:35 pm ]
Post subject:  RE:text repetition

wouldn't \n also work?

Author:  A.J [ Tue Mar 11, 2008 6:14 pm ]
Post subject:  Re: text repetition

sure (way to go by finding a better method Evil or Very Mad )

Author:  ahmhum [ Tue Mar 11, 2008 11:34 pm ]
Post subject:  RE:text repetition

the problem can be solved by moving the string text
but i don't know how to do that
so can anyone tell me how to move an object


: