Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Running Turing Code Through NotePad++ or Another Third Party Code Editor
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Linkxgl




PostPosted: Sun Dec 11, 2011 6:25 pm   Post subject: Running Turing Code Through NotePad++ or Another Third Party Code Editor

Recently I've been using Turing for a computer science course I'm taking. I've programmed in Python, C++ and C# before so I know how to get around Turing relatively easily. The biggest problem I've been having, however, is actually getting to run Turing Code on a different code editor. I hate using Turing's default one. It's incredibly annoying to use. What I am trying to achieve is a way to type up the code in, for say, NotePad++ and run it off there.

I was able to import the code into NotePad++ (of course because it opens any Text file), but I can't find where to run the program off. I've tried setting up NotePad++ to run the Turing executable, but all that does is open the Turing editor.

Is it possible to run Turing code off a third party editor? Or am I out of luck?

The version of Turing I'm using is the latest: 4.1.1

Thanks for the help, I hope I'm not forgetting anything, I'm new to the forum, so I wouldn't know.

For whomever it may concern:
The reason I don't like the Turing editor is because I don't know how to reference lines on my code because it doesn't indicate them and every time I click stop on the run window the editor automatically skips to the bottom of the code. This is incredibly annoying when you have over 400 lines of code because you always need to find what you were editing from before. This is even more annoying when you're testing out values on an initial variable, every time you test the code you need to find the variable again, and if you don't like how the code ran, you need to look for it again!
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Dec 11, 2011 6:30 pm   Post subject: RE:Running Turing Code Through NotePad++ or Another Third Party Code Editor

still some issues https://github.com/Open-Turing-Project/OpenTuring/issues/11 but you can try OpenTuring
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
mirhagk




PostPosted: Sun Dec 11, 2011 7:55 pm   Post subject: RE:Running Turing Code Through NotePad++ or Another Third Party Code Editor

Also for your last issue, try using Window.Open (or Window.New forget which) which works the same as setscreen, but returns an int that you can use in later functions, namely Window.Close() to close the window. This will not jump to the last line like it normally does.
Linkxgl




PostPosted: Sun Dec 11, 2011 11:47 pm   Post subject: RE:Running Turing Code Through NotePad++ or Another Third Party Code Editor

@Tony, is OpenTuring just a user made version of Turing that is open source? What's the point of using it? I read about it and it seems it's just a little bit faster... What is the solution with working with this?

@Mirhagk, can show an example of what you mean?

I'm talking about when the program closes on itself, I'm talking about when it's in an infinite loop and I click stop in the Turing Run. I don't think I understood you right?
Tony




PostPosted: Sun Dec 11, 2011 11:50 pm   Post subject: RE:Running Turing Code Through NotePad++ or Another Third Party Code Editor

you can start OpenTuring from command-line, meaning you can hook it up with any editor of choice.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
mirhagk




PostPosted: Mon Dec 12, 2011 8:48 am   Post subject: RE:Running Turing Code Through NotePad++ or Another Third Party Code Editor

Turing:

var window:=Window.Open("graphics:800;600")
for i:1..50
put i
end for
Window.Close(window)


Now when Turing gets to the final line, it will close the window, and exit without problems. If you let turing exit naturally like this (making an exit condition instead of just hitting stop) then it won't jump to the last line executed
Dan




PostPosted: Mon Dec 12, 2011 3:39 pm   Post subject: Re: RE:Running Turing Code Through NotePad++ or Another Third Party Code Editor

Tony @ 11th December 2011, 11:50 pm wrote:
you can start OpenTuring from command-line, meaning you can hook it up with any editor of choice.


It is also possible to make a batch script that will run clasic turing (at least turing 4.x) in test mode and pass it a file to run. This avoids the open issue with OpenTuring and also makes it possible to get some of the stanard i/o but can end in some odd results. This is how we are doing it for DWITE now.

If any one is really intrested I could make a generic batch script that would work from the turing dir. The current DWITE one (summon_cthulhu.bat) has some directoires hard coded.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Linkxgl




PostPosted: Mon Dec 12, 2011 4:54 pm   Post subject: RE:Running Turing Code Through NotePad++ or Another Third Party Code Editor

Thanks to all of you, Dan, it would be great if you could make a batch file for running Turing please! Very Happy
Sponsor
Sponsor
Sponsor
sponsor
trishume




PostPosted: Mon Dec 12, 2011 6:54 pm   Post subject: Re: Running Turing Code Through NotePad++ or Another Third Party Code Editor

@Dan

The interesting thing is that in my efforts to fix the bug I found that the -testsuite option also seems to terminate before the suite finishes running.

I don't see how -testsuite could work for you.

The -run bug seems to me to be a Windows behaviour that GUI programs are spawned and then the command terminates. Without waiting for program completion.
Dan




PostPosted: Tue Dec 13, 2011 10:33 am   Post subject: Re: Running Turing Code Through NotePad++ or Another Third Party Code Editor

trishume @ 12th December 2011, 6:54 pm wrote:
@Dan

The interesting thing is that in my efforts to fix the bug I found that the -testsuite option also seems to terminate before the suite finishes running.

I don't see how -testsuite could work for you.

The -run bug seems to me to be a Windows behaviour that GUI programs are spawned and then the command terminates. Without waiting for program completion.


It has worked fine for me and worked fine for a whole DWITE round. Maybe you underestimate cthulhu Razz

Spolier: Try running OpenTuring in a batch script with -run or if you dislike batch scripts try putting START /WAIT infront of the command on the command line. Also if you want a new bug, try using get to input somthing from the keyboard while in testsuite or run mode.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Dan




PostPosted: Tue Dec 13, 2011 10:58 am   Post subject: Re: RE:Running Turing Code Through NotePad++ or Another Third Party Code Editor

Linkxgl @ 12th December 2011, 4:54 pm wrote:
Thanks to all of you, Dan, it would be great if you could make a batch file for running Turing please! Very Happy


Here is the script:

code:

@ECHO OFF
ECHO #execdir %CD% > "%CD%/_index.txt"
ECHO B %~1 >> "%CD%/_index.txt"
turing.exe -testsuite "%CD%"


turing.exe needs to be on the path or you may put the path to turing.exe infront of "turing.exe" in the script. Turing gets a bit odd when run like this, for example get will not work correctly when inputting from the keyboard. Also for some reason it will not work in some current directories, to lazy to find out why.

It should take the path to a turing file as an arugment. It creates the testsuite dir in the current directory.

Edit: Note i only tested that script on XP. It is possible you may need to make some changes or other windows OS. If the script exits right away you may need a "START /WAIT" in there.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
jcordiner




PostPosted: Wed Feb 15, 2012 6:06 pm   Post subject: RE:Running Turing Code Through NotePad++ or Another Third Party Code Editor

Hi Dan,

I was wondering how does this specify a file for input and output? For instance when you feed test data and capture the output?

I tried this with my version of Turing and it ran but didn't create the testsuite directory...
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: