Computer Science Canada

How to edit files that you open onto a turing run window (text files)

Author:  efan41 [ Wed Oct 21, 2009 1:31 pm ]
Post subject:  How to edit files that you open onto a turing run window (text files)

What is it you are trying to achieve?
I am trying to edit text files that are opened onto a run window. I am trying to create microsoft word for a class project, to put you all in context, so think of it as an open file extention that would appear in the file option in the menu.


What is the problem you are having?
I can open the files fine using a GUI.CreateTextBoxFull, but unable to modify the text that appears.


Describe what you have tried to solve this problem
I am stuck, I tried to use the GUI.OpenFileFull before finding out in these forums that it is just a filler, and because Holt's is no longer in operation, it's never going to be of use.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
N/A, but if you can think of anything I can use please include in answer


Please specify what version of Turing you are using
4.0.5

Author:  Kharybdis [ Wed Oct 21, 2009 2:11 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

Making even a bad copy of some of the functions of Microsoft Word is extremely hard on Turing.

To start, i would suggest looking into the Open, Get, Close, Seek, and all the statements that would go into File Input/Output.

Don't use Turing's GUI. There's very little you can do to customize it and it limits your options when doing a project.

Author:  efan41 [ Thu Oct 22, 2009 1:04 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

So are you saying that by using those input/output files I should be able to modify text that appears on my screen? And do you have any suggestions on how I can write it into the program?

Author:  BigBear [ Thu Oct 22, 2009 4:31 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

You do not need to use a GUI text field to get input from the user in fact you do not need to use any GUI commands to make a text editor such as microsoft word.

you can use

"get"

to accept input from the user

once you have gotten information you will need to write it or "put"it to the file

while in Turing press F10 to open help and search for "get", "put" and "open"

Author:  efan41 [ Fri Oct 23, 2009 1:06 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

BigBear I don't think you understand what I'm trying to say.

Picture a microsoft word screen. Now picture that screen opening a file. I can do that with my turing program, but I can't figure out how to edit the text that has appeared on the screen.

If any of you would like to see what I have so far let me know and I can send you the program via e-mail, and if you have any suggestions don't hesitate to mention them.

Author:  Zren [ Fri Oct 23, 2009 3:09 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

View.Set("text")

This line will allow normal put "" output to be selectable and copyable. However, you still can't edit it.

For a small implementation. You could create a string, that you might modify after every keypress in a loop.

Take a look at string manipulation and advanced input from this thread for help with getting input. I suggest the chr() and ord() functions mixed with the Input.KeyDown() method of input in order to determine what to add to the string. If the backspace flag was pressed, you can take the last character out of the string.

Author:  saltpro15 [ Fri Oct 23, 2009 3:51 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

Look in the Turing examples folder, there's a netchat program that has exactly what you're looking for.

Author:  efan41 [ Fri Oct 23, 2009 8:30 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

Well Zren, as a matter of fact I have been using the chr () but I'm having difficulty with the ord() Confused Is that normal? And For the backspace it was a big pain because of the fact that I have to re-arrange the x and y parameters for my locate, but anyways, thanks for the advice.

Author:  efan41 [ Fri Oct 23, 2009 8:39 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

thanks for the tip Saltpro15,

but how does this program relate to opening a pre-saved text and then modifying that text?

I don't see the relation, but I'm really tired and not exactly what you would call an expert with Turing. If you wouldn't mind pointing out what in the netchat program would help me, I would really be greatfull.

Author:  efan41 [ Wed Nov 04, 2009 2:54 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

K well I figured it out on my own. Thanks for all the replies! Very Happy

Author:  Kharybdis [ Wed Nov 04, 2009 3:18 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

Post what you have. I'm just curious as to what you have done.

Author:  Superskull85 [ Wed Nov 04, 2009 9:31 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

efan41 @ Fri Oct 23, 2009 8:30 pm wrote:
...And For the backspace it was a big pain because of the fact that I have to re-arrange the x and y parameters for my locate, but anyways, thanks for the advice.

If you are using a string to store the document text in you do not need to worry about positioning the cursor. Instead just delete the character directly before the current cursor position within the string.

I created a similar program a while back where I stored the document in a "TextString" class I created that allowed me to store as much characters as I wanted, and at the same time allowed me to modify the contents of the TextString object using methods. I used a flexible array of characters as the main storage (could of used a linked list or similar), and manipulated the array to change the text of the document.

I was able to visually keep track of where the cursor was by inserting a "|" into the TextString object where the cursor currently lied within the document. For navigation I used the arrow keys to move back and forth between characters, and used a grid approach to move the cursor up or down relative to its previous position. For example, if the length of two rows A and B were 5 and 9 characters long respectively, the grid would be 5x2. If the previous cursor position was 3 on row B, than I would move it up to position 3 on row A. If the position was 7 on row B, I would move the cursor to position 5 on row A.

The length of each row was determined by searching for the new line character (\n) relative to where the cursor lied. For example, if a section of the document contained:

"\nThis is an example row.\nThis is another example row which is longer.\n"

Row A would be, "This is an example row." and row B would be, "This is another example row which is longer."

Anyways it took me a bit to figure out and create, and I only created it to prove that a text editor created using Turing was possible.

Author:  efan41 [ Thu Nov 05, 2009 2:08 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

Well what I have so far isn't perfect, it's a semester-long project that isn't due until january, so I still have things to do to it. And it's kind of long to put on here, so I'll have it as an attachment.

As for the backspace, I am doing it in a string, but I'm not sure I understand how you got the backspace to work, and I would like it if you could explain how you managed to save as many charatcers as you want, seeing as Turing will only let you save something like 250 per variable..

Author:  Superskull85 [ Thu Nov 05, 2009 4:50 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

For the storage of the text I used a flexible array of characters. Every time I wanted to add more text I would extend the array and add the text/characters in. I could of used a linked list (each link would contain a char attribute) or similar, but I thought of using a flexible array first so I stuck with it.

Anyways, for the backspace say the cursor is at the end of the text (which I will refer to as length). The backspace button in a text editor deletes the character directly before it. So by pressing the backspace you would delete the character at position (length - 1). For example if you had the text, "This is an example", and the cursor was at the end of the text you would delete the character "e" from the end when the backspace button is pressed.

To delete a character from the end of a string:

Turing:
MyString = MyString (1 .. * - 1)

Where MyString is any string variable (var MyString : string).

You can check for the backspace key (including all other keys) using Turing's Input module.

Author:  efan41 [ Fri Nov 06, 2009 2:20 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

Well Superskull that would have solved my problem if I were using a variable for all my characters that I type onto the screen, however that isn't quite the case.

Turing:


if chars ('z') then                     %If the user hits the "z" key         
  if chars (KEY_SHIFT) then      %If the user hits the "z" key while holding the shift button
      put "Z" ..                          %Obviously, put a capital "z" on the screen                       
      characteres := "Z"             %Used to save the file     
      backspace                        %Procedure called that changes the value of y. (y:= y + 1)                   
   else                                    %If the user dosen't hold the shift key while pressing "z"       
      put "z" ..                          %Puts a "z"               
      characteres := "z"            %Used to save the file             
      backspace                        %Procedure called that changes the value of y. (y:= y + 1)           
   end if
end if


This is an example of what would happen if the "z" key was pressed. My teacher told me I couldn't just use a get because it'd be to easy...So because I'm not using a variable for the caracters, I can't use your method.

Here's what I have so far for the backspace procedure from earlier:

Turing:

proc backspace   
   if y < 125 then                     %If y is smaller than 125Because a "y" value in a locate cannot excede 125       
      y := y + 1                        %Add 1 to "y"'s value
   else                                    %If "y" is = or superior to 125
      y := 1                              %Reset's "y"       
      x := x + 1                        %Add's 1 to "x"'s value, so it'll change rows when it locates
   end if
end backspace


The character that is supposed to be erassed is erassed, but the cursor seems to be corresponding with the else part of that last procedure, even though y is smaller than 125.. Confused Mad Any thoughts?

Author:  Superskull85 [ Fri Nov 06, 2009 5:19 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

I think your main problem is that you are outputting the characters instantly after they are pressed. What I think you should do instead is use the variable "text_file" and output the contents of that each iteration of your main loop.

Every time a character is processed you call the "backspace" procedure which locates the cursor one column to the right, and adds the character to "text_file." Instead of doing something like:

Turing:
loop
    Input.Pause
    Input.KeyDown (chars)
    if chars ('a') then
        if chars (KEY_SHIFT) then
            put "A" ..
            characteres := "A"
            backspace
        else
            put "a" ..
            characteres := "a"
            backspace
        end if
    end if
    ...
end loop

You could do something like:

Turing:
loop
    Draw.Box (0, 0, maxx, maxy - 20, white) %Used instead of cls () so that your menu bar is not cleared
    locatexy (0, maxy - 32) %Same as locate, except it excepts coordinates instead of rows and columns
    put text_file .. %Ouput the entire file at once
    Input.Pause
    Input.KeyDown (chars)
    if chars ('a') then
        if chars (KEY_SHIFT) then
            characteres := "A"
        else
            characteres := "a"
        end if
        text
    end if
    ...
end loop

Using something like that you would be able to delete a character simply by using the code:

Turing:
text_file := text_file (1 .. * - 1)

I think that would be a better way of outputting content. Also you should look into using dynamic (flexible) arrays of characters instead of a string variable as it would allow for as many characters as you want. The declaration of a dynamic char array is:

Turing:
var MyArray : flexible array 1 .. 1 of char %You can use an upper bound greater than 1 if you want

When you want to add a new element to that array you would use:

Turing:
new MyArray, upper (MyArray) + 1

You can find a tutorial about arrays (of all kind) here: http://compsci.ca/v3/viewtopic.php?t=14333

You can also use these escape characters to indicate the following:

    \n - Newline
    \t - Tab

Each of them acts as a character so you could still use "text_file := text_file (1 .. * - 1)" to delete a tab or newline if you use them instead of spaces and relocation.

If you are not allowed to use this method than you could simply use "y := y - 1" to make the cursor go back one space. You also need to call "locate (x, y)" within your loop, instead of outside of it. Smile

Author:  efan41 [ Tue Nov 10, 2009 3:07 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

I don't understand how just doing MyArray + 1 would remember the inputed letters though Confused Is that all I need or..

By the way, my teacher openely admited to me that I know more about Turing than she does. Her knowlege only goes up to GUI's and procedures... So you guys are my only chance of understanding any of this... lmao.

Author:  efan41 [ Fri Nov 13, 2009 2:43 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

Superskull87 I tried using your dinamic arrays theorie and it works fine until I actually need to save, that's when it tells me that my variable has no value... Mad Here's what I have:
code:

 if chars ('f') then                     %If the f key was pressed
            if chars (KEY_SHIFT) then           %If the shift key was also pressed
                character (t) := "F"            %character (for whatever value of t) is now a capital F
                backspace                       %Used to re-arrange x,y coordinates
            else                                %Otherwise
                character (t) := "f"            %Character (for whatever value of t) is now a normal f
                backspace                       %Used to re-arrange x,y coordinates   
            end if
end if


That repaeats itself for every key on the keyboard, now at the end of this procedure, I have:

code:

put character (t)                       %Puts the letter for the current value of t
        t := t + 1                              %Adds one to t so it dosen't save over the last letter
        new character, t                 %Frees up character for the new value of t


And when I save I have:

code:

get DestFile
        DestFile += Extension
        FileDir += DestFile
        if File.Exists (DestFile) then
            cls
            put "A file already exists under that name. Hit 1 to overwrite"
            get Choice
            if Choice = 1 then
                open : stream, DestFile, put
                for c : 1 .. t
                    put : stream, character (c)
                end for
                close : stream
                exit
            else
                exit
            end if
        else
            cls
            put "No file was found under that name, therefore this document will be saved under the name previously entered."
            DestFile += Extension
            FileDir += DestFile
            open : stream, DestFile, put
            for c : 1 .. t
                put : stream, character (c)
            end for
            close : stream
        end if


Can you tell me what I'm doing wrong because I keep getting a variable has no value for my character (c) when saving... Confused Mad

Author:  Superskull85 [ Fri Nov 13, 2009 4:59 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

It is because the character at index t (the maximum index in the array) will always be empty (not having a value) until you assign it a value, which you would not if nothing else was entered. You are currently iterating between 1 and t. Instead if you iterate between 1 and (t - 1) than you should be able to save with no problems.

So for your loop. Instead of:

Turing:
for c : 1 .. t
    put : stream, character (c)
end for

Have:

Turing:
for c : 1 .. t - 1
    put : stream, character (c)
end for

I attached the program I created a while ago. I did not provide the source code, as I used some modules I had created for large amounts of text, and input, that I don't want to release. Press the escape key to exit the program.

Author:  efan41 [ Mon Nov 16, 2009 2:15 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

Wow I can actually save now!!! Very Happy thanks Superskull. Now I have to write the code to be able to open those dynamic array files lmao.

I tried your text editor btw, why can't I hit the same key twice in a row? Maybe a little bug to work out.

Author:  efan41 [ Mon Nov 16, 2009 2:28 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

And this is just something that has nothing to do with the subject but is there a code I can use to delete the very first screen that appears when I run the program? I don't know if you've ever noticed it when you ran my program but I don't want it to show up when I generate a stand alone program out of this...

Author:  Superskull85 [ Mon Nov 16, 2009 6:26 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

To solve the two windows opening remove the "cls" line from your "debut" procedure. When you draw anything it is sent to the default window (the other window you see) unless you created a window and activated it (which you did do, but you did it after calling "cls").

In effect by calling "cls" Turing automatically opened a window for you, and you than opened a new window in your actual program. Smile

Also for some reason when I compile my text editor editor it will not allow the user to enter the same character in a row, but not when I run the program directly from source code. I don't know why this happening, so sorry about that.

If you're wondering, I limited my editor to non-repeating (holding the button down) characters as I used my own input method (I did not use Input.Pause ()), and because it was just a proof-of-concept (POC) I didn't want to waste time getting the "wait" times worked out. I know it's possible as I did a similar thing for a different program, I just did not bother adding it in, as I had no practical use for the POC text editor I created). Using a simple delay would make the input too slow or too fast, so I didn't bother with it.

Smile

Author:  efan41 [ Thu Nov 19, 2009 2:05 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

Well thanks for all the help with the program, but I think I'm going to mark this as answered now, even if more than the original question have been answered! And btw, you were right about the cls. I removed it and the program works fine now! Very Happy I'll be sure to post my project into the turing submissions when I hand it in to my teacher.

Author:  efan41 [ Thu Nov 19, 2009 2:44 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

Ok I'm going to unmark this as answered...

Why is it that before I turned my normal string variable into a dynamic array I could open the files fine but now that I have an array I can't?

I think it's because the program isn't saving correctly, I get the error code uknown error #0, and the error code can only be obtained in my program when the file doesn't exsist...

When I look into my memory card where it should be saving, the file isn't there, so it obviously can't load something that hasn't saved.

This is what I have for saving:


Turing:

winIDsave := Window.Open ("position;0:620,graphics:1000;660")
    Window.SetActive (winIDsave)
    loop
        put "Entrer le nom sous lequel vous voulez enregistrer le fichier."
        get DestFile                             %gets the name of the file they want to save under
        DestFile += Extension                    %Gives the name an extension, in this case .t
        FileDir += DestFile                      %Gives the file a directory, which is E:/
        if File.Exists (DestFile) then           %If the file exists
            cls
            put "Un fichier exist deja sous se nom la. Voulez-vous le remplacer avec ce fichier? 1 = oui" %Do you want to overwrite this file
            get Choice
            if Choice = 1 then
                open : stream, DestFile, put
                for c : 1 .. t
                    get : stream, character (c)
                    put : stream, character (c)
                end for
                close : stream
                exit
            else
                exit
            end if
        else                                       
            cls                                %If there isn't a file under that name
            put "Aucun fichier a ete trouver sous ce nom. Le fichier sera enregistrer sous le nom inscris."
            DestFile += Extension              %Gives the name an extension, in this case .t
            FileDir += DestFile                %Gives the file a directory, which is E:/
            open : stream, DestFile, put
            assert stream > 0
            for c : 1 .. t - 1
                put : stream, character (c) ..
            end for
            close : stream
        end if
        exit
    end loop
    delay (4000)
    Window.Close (winIDsave)
    Window.SetActive (winIDmain)



I'm really frustrated lol, it used to work and now it dosen't... Mad

Author:  Superskull85 [ Thu Nov 19, 2009 10:21 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

Well the only part that I see wrong with the code you provided is in this section:

Turing:
open : stream, DestFile, put
for c : 1 .. t
    get : stream, character (c)
    put : stream, character (c)
end for
close : stream

Turing should spit out an error when it reaches your get statement as you have not added a "get" flag to your open statement (ie. instead of "open : stream, DestFile, put" it should be "open : stream, DestFile, put, get". Also I believe that whenever you open a file with "put" the files contents will be deleted.

Also in that same section you are going from 1 to t (I am assuming t is the upper bound of your array). Instead to prevent iterating to the upper bound (the element that does not have a value) you would have to iterate from 1 to (t - 1). You did this in this section:

Turing:
open : stream, DestFile, put
assert stream > 0
for c : 1 .. t - 1
    put : stream, character (c) ..
end for
close : stream

I could help more if you wouldn't mind providing your code. PM it to me if you do not want to post it. Smile

Author:  mirhagk [ Fri Nov 20, 2009 9:55 am ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

One thing, why do you have this
if chars ('a') then
if chars (KEY_SHIFT) then
characteres := "A"
else
characteres := "a"
end if
text
end if
If you just have chars add to the characteres then it will be capitalized if it has to

Author:  efan41 [ Fri Nov 20, 2009 2:17 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

ok well the t-1 was just something I forgot.

And as for (stream, DestFile, put, get), I tried it and I still get the same error. But like I said, It can only give me an error code if the file I'm trying to open dosen't exist, so I can deduce that the file hasn't been saved, although I had tried to previously. So, there has to be something wrong in the code I copied in my last post, but I can't see what it could be. Mad

Author:  Kharybdis [ Fri Nov 20, 2009 2:56 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

Well, just do a simple error check.

if the file you're trying to open isn't there, make the computer say that it's not there, instead of just guessing.

If the error is something different than from a missing file, then post again.

Author:  efan41 [ Fri Nov 20, 2009 3:05 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

ok now I'm back to my get attempted on incompatible stream number 3 is back, and I don't know why... I have t-1 and everything.

And would you mind quickly explaining why you use t-1, my teacher dosen't seem to know why, and I can't explain it to her

thanks in advance

Author:  Superskull85 [ Fri Nov 20, 2009 9:32 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

Well consider the following piece of code:

Turing:
%Declare a flexible array to hold our text in
var Characters : flexible array 1 .. 1 of char
%Used to keep track of the upper bound of our array
var t : int := 1

%Takes in a character, adds it to our array,
%and adds one to the upper bound of our array
%so that we can add more characters
proc AddChar (InputChar : char)
    Characters (t) := InputChar
    t += 1
    new Characters, t
end AddChar

%Retrieve the character at the given index
function GetChar (Index : int) : char
    result Characters (Index)
end GetChar

%Displys each character in our array one by one
proc PrintChars ()
    for i : 1 .. t - 1
        put GetChar (i) ..
    end for
end PrintChars

%Add the characters A-Z to our array
for i : 0 .. 25
    AddChar (chr (65 + i))
end for

%Output our array to the screen
PrintChars ()

Because you are using a flexible array to store your text in you always have to add one to the array in order to add more characters. Using this method, the upper most bound is never given a value. Thus when you try to access that element Turing will spit out an error saying that it has no value (because it doesn't). To avoid think you have to iterate to the upper bound minus 1 (t - 1) instead of the upper bound (t).

I would do what Kharybdis suggested to help solve your problem. Posting your full code (or you can send me a PM with the code if you do not want to post it) would help determine the problem.

Author:  efan41 [ Mon Nov 23, 2009 2:58 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

By the way it's a EOF attempted on incompatible stream number 3, not a Get attempted... lol

Author:  belarussian [ Mon Nov 23, 2009 9:02 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

ok look you have to change thge text in the file its self and just add the file into turing thats it easy

Author:  belarussian [ Mon Nov 23, 2009 9:03 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

and if you need to include a turing file look at something like "include"

Author:  efan41 [ Tue Nov 24, 2009 2:03 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

I don't understand.. Confused What exactly do you mean I have to change the text in the file itself, please be more specific..

Author:  efan41 [ Tue Nov 24, 2009 2:59 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

And btw Superskull I noticed that if I load a file with my program (I can do that now Smile ), I can save without getting the EOF attempted on incompatible stream number 3 error.. Confused? I don't know if that'll help but I figured I might point it out.

Author:  Superskull85 [ Tue Nov 24, 2009 6:15 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

What belarussian is trying to say is that if you change the contents of a file, and than load that file in, the contents on the screen will change. However, what you are doing is getting input from the user and outputting it to the screen (also some saving and loading, but that is a little different than what he mentioned).

I got your PM, but I don't have a lot of time to go over it right now. Probably tomorrow though. If you give me a date that you need the program done by I can do my best to help you out by then. Smile

Author:  efan41 [ Wed Nov 25, 2009 2:01 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

Project is due in less than a month, the 19th of december I believe...

Author:  efan41 [ Fri Dec 04, 2009 2:43 pm ]
Post subject:  Re: How to edit files that you open onto a turing run window (text files)

lol yeah btw I just remembered that my backspace isn't working. I'm trying to use something like this:


code:


number_of_keys_hit:= number_of_keys_hit- 1
My_array (number_of_keys_hit) := My_array (number_of_keys_hit) (1..*1)



Which is what Superskull suggested, but it won't erase the letter from the screen, although it seems to be erasing the last key hit from My_array (number_of_keys_hit)'s memory, which is good. Any thoughts?

Author:  Superskull85 [ Fri Dec 04, 2009 7:33 pm ]
Post subject:  RE:How to edit files that you open onto a turing run window (text files)

Well the problem is that with your current code you are never outputting the text every iteration of a loop. Instead you are outputting the character when the key is pressed. What you want to do is to somehow integrate this code:

Turing:
for i : 1 .. t - 1
     put character (t)
end for

So that it is continuously called and updating the screen. I can't see any immediate solution, and I'm afraid I won't have anymore time to help you before your due date, but hopefully you are able to finish. Smile


: