
-----------------------------------
turinggirl
Sun May 20, 2012 6:28 pm

Turing
-----------------------------------
What is it you are trying to achieve?



What is the problem you are having?

Can someone tell me what's wrong with my program? like what does it leave a red line behind the word?
var font : int
font := Font.New ("serif:36")

delay (100)
for x : 0 .. maxx - 450

    Draw.Text ("HI", 50 + x, 30 + x, font, red)

end for



Describe what you have tried to solve this problem



Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)








Please specify what version of Turing you are using


-----------------------------------
Tony
Sun May 20, 2012 7:32 pm

RE:Turing
-----------------------------------
would it help you figure out what that "line" is, if you use
[code]
for x : 0 .. maxx - 450 by 5
[/code]
instead?

-----------------------------------
crossley7
Sun May 20, 2012 8:38 pm

RE:Turing
-----------------------------------
look at what your loop is doing.  every time it goes through the loop it draws your text 1 pixel further over.

possibly since the program is so short, out a delay(5) in to see what happens every time it goes through the for loop at a pace that your mind can register.

-----------------------------------
turinggirl
Sun May 20, 2012 10:05 pm

Re: Turing
-----------------------------------
I have tried using cls but i don't know why it doesn't work

-----------------------------------
crossley7
Sun May 20, 2012 10:41 pm

RE:Turing
-----------------------------------
what are you trying to do?  Just get rid of writing it many times?  That line is actually the text written on top of itself many times if you want to know what your problem really is.  Now you should be able to come up with a few ideas on how to proceed to fix your problem

-----------------------------------
turinggirl
Sun May 20, 2012 10:43 pm

Re: Turing
-----------------------------------
I want to move the text diagonally across the screen :S

-----------------------------------
evildaddy911
Mon May 21, 2012 12:21 pm

RE:Turing
-----------------------------------
add in the "by" that tony mentioned,  put a delay (10 would work) and a cls right before the "end for"

"by X": will skip every X numbers, moving the text quicker.
"delay (X)" will make is so the program doesn't finish seemingly instantaneously
cls will remove the last "HI", thereby removing any red lines

-----------------------------------
Raknarg
Mon May 21, 2012 2:59 pm

RE:Turing
-----------------------------------
a better explanation:

in a for loop, by will skip a number of iterations based on the number next to the by:

for i : 1 .. 5 by 2

In this case, the loop will instead of going 1, 2, 3, 4, 5, will go 1 ,3, 5.

delay (x) will pause the program for x milliseconds

cls clears everything from the screen (text or graphics)

-----------------------------------
Tony
Mon May 21, 2012 3:13 pm

RE:Turing
-----------------------------------
The reason I was suggesting the use of "by" is to make it really obvious that the trailing colour is from previously drawn text, not some arbitrary "line".
