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

Username:   Password: 
 RegisterRegister   
 Is this a turing limitation?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
richcash




PostPosted: Mon May 01, 2006 5:58 pm   Post subject: Is this a turing limitation?

I tried to get a start to 3D effect but my computer can't handle the various commands and restarts every time I try the following :

setscreen ("offscreenonly")
var x, y := 200
var d := 50
var chars : array char of boolean
loop
Input.KeyDown (chars)
if chars (chr (200)) then
d += 1
elsif chars (chr (208)) then
d -= 1
end if
drawfilloval (x - d, y - d, x + 100 + d, y + 100 + d, 12)
View.Update
cls
end loop

Sorry for the lack of indentation. I don't advise you to copy and paste this because your computer might be like mine and restart!
I appreciate anyone's thoughts or help.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon May 01, 2006 6:06 pm   Post subject: (No subject)

the code runs fine on my end. I don't think this has anything to do with Turing, but just for the fun of it, why don't you try to insulate the test case for the crash?

test case being the smallest sniplet out of that code, where if anything more was to be removed, the computer will no longer restart.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
HellblazerX




PostPosted: Mon May 01, 2006 6:43 pm   Post subject: (No subject)

Tony wrote:
why don't you try to insulate the test case for the crash?


Lol, that would take a long time with all the restarting. I think the best way is to get your computer checked, cuz from what I can seem about it your, its quite simple, and there shouldn't be any reason why your computer can't handle it.
Tony




PostPosted: Mon May 01, 2006 6:53 pm   Post subject: (No subject)

HellblazerX wrote:
Lol, that would take a long time with all the restarting.

nonsense, work the other way

start with an empty file and keep on adding one line at a time until you get something that crashes
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
HellblazerX




PostPosted: Mon May 01, 2006 7:00 pm   Post subject: (No subject)

wow, did not think of that at all. Then again, I don't think much. That's really nice..... Man, I wish i was as smart as you....
GlobeTrotter




PostPosted: Mon May 01, 2006 7:04 pm   Post subject: (No subject)

I have a feeling that this may be caused by the lack of delay in that code. For example, in turing, if I run this program:

loop
end loop

then my computer slows down a lot and I may have to use the task manager. So right underneath the loop, write
delay(10) and see if it still crashes. If it does, I'm stumped.
HellblazerX




PostPosted: Mon May 01, 2006 7:08 pm   Post subject: (No subject)

There is also the possibility that it is the setscreen command. The setscreen ("offscreenonly") command draws to an offscreen buffer, and then draws onto the screen to reduce animation flickering. It could be that your computer can't handle that buffer.
richcash




PostPosted: Mon May 01, 2006 7:14 pm   Post subject: (No subject)

thanks for the advice.
I tested and it turned out my computer crashed and restarted everytime I added the d variable to the x or y co-ordinate. I know now it was my computer's inabilities and not Turing.
P.S. using delay works, good idea. I avoided this originally because I like maximum speed when I'm making a program.
Tony




PostPosted: Mon May 01, 2006 8:02 pm   Post subject: (No subject)

[wtd accent]premature optimization is Bad
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Delos




PostPosted: Mon May 01, 2006 9:18 pm   Post subject: (No subject)

wtd has an accent Shocked. I wanna hear!
wtd




PostPosted: Tue May 02, 2006 3:18 am   Post subject: (No subject)

I have an Upstate/Western/Central New York accent. Though I was once told my voice has a British quality to it. I have heard this a few times, actually, but I can't detect it at all myself.

I sometimes have a notable accent when I really know what I'm doing while speaking spanish.
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  [ 11 Posts ]
Jump to:   


Style:  
Search: