Author |
Message |
ahmhum
|
Posted: Mon Mar 10, 2008 1:39 pm Post subject: text repetition |
|
|
can anyone help me with a text repetion
thnx
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
OneOffDriveByPoster
|
Posted: Mon Mar 10, 2008 1:51 pm Post subject: Re: text repetition |
|
|
Describe what text repetition is... echoing back?
|
|
|
|
|
|
richcash
|
Posted: 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.
|
|
|
|
|
|
A.J
|
Posted: 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
|
|
|
|
|
|
ahmhum
|
Posted: 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
|
|
|
|
|
|
A.J
|
Posted: 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!!!!!
|
|
|
|
|
|
ahmhum
|
Posted: Mon Mar 10, 2008 11:57 pm Post subject: Re: text repetition |
|
|
this is what i have now
Description: |
|
Download |
Filename: |
Forloop.java |
Filesize: |
1.39 KB |
Downloaded: |
90 Time(s) |
|
|
|
|
|
|
A.J
|
Posted: Tue Mar 11, 2008 9:44 am Post subject: Re: text repetition |
|
|
It looks good
so what is the problem with it?
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
ahmhum
|
Posted: 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
|
|
|
|
|
|
ahmhum
|
Posted: Tue Mar 11, 2008 3:31 pm Post subject: Re: text repetition |
|
|
this is what happens
Description: |
|
Download |
Filename: |
Forloop.java |
Filesize: |
2.21 KB |
Downloaded: |
79 Time(s) |
Description: |
|
Download |
Filename: |
Forloop.java |
Filesize: |
2.21 KB |
Downloaded: |
107 Time(s) |
|
|
|
|
|
|
A.J
|
Posted: 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...
|
|
|
|
|
|
|
Nick
|
Posted: Tue Mar 11, 2008 5:35 pm Post subject: RE:text repetition |
|
|
wouldn't \n also work?
|
|
|
|
|
|
A.J
|
Posted: Tue Mar 11, 2008 6:14 pm Post subject: Re: text repetition |
|
|
sure (way to go by finding a better method )
|
|
|
|
|
|
ahmhum
|
Posted: 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
|
|
|
|
|
|
|