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

Username:   Password: 
 RegisterRegister   
 Problem with turing
Index -> Programming, Turing -> Turing Help
Goto page 1, 2, 3, 4, 5, 6  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
krishon




PostPosted: Sat Nov 23, 2002 2:27 pm   Post subject: Problem with turing

hi, i just have a slight problem. I wuz just makin a program and then a message sayin "Implementation restriction - Block nesting too deep." I got a bit angry afta it kept on popping up. How can i fix it??

Any help will be greatly appreciated. It would be good if a reponse can come today or latest 2moro. thx Smile
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Nov 23, 2002 3:40 pm   Post subject: (No subject)

my guess is that there's a problem with your nesting of something... posting your code would be helpful.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
krishon




PostPosted: Sat Nov 23, 2002 3:54 pm   Post subject: (No subject)

cls
exit when hitpointsamazon <= 0
elsif fightrunchoice = "run" then
randint (runawaychoice, 1, 2)
if runawaychoice = 1 then
Pic.ScreenLoad ("char-amazon.bmp", 1, 1, picCopy)
put "You have gotten away"
delay (2000)

this is around lines 783 to 791 of 1243. It says that message on the line:

elsif fightrunchoice = "run" then

if u need to, i could be able to send the actual file, but it requires the new version of turing, turing 4.04b
Tony




PostPosted: Sat Nov 23, 2002 4:50 pm   Post subject: (No subject)

well it could be the line before that too...

You don't put "exit when" inside an if statement... just put "exit" if you need to get out of the loop.

If that is not the problem, try drawing a diagram of all your loops... maybe there's a logical mistake there.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
krishon




PostPosted: Sat Nov 23, 2002 6:55 pm   Post subject: (No subject)

i'm pretty sure it is not related to the loops, cuz i have like 9 of them. I may still have some problems to ask you, but i need my program to start working first, lol. Maybe i should send my file to u so that u can suggest what i should do. But it only works in turing 4.04b, and i dunno if u want the bmp's and the mp3.
Tony




PostPosted: Sat Nov 23, 2002 8:58 pm   Post subject: (No subject)

don't have 4.04 nor will I get it...

If you've got many loops, make sure you indent properly. If you screw up with endings of loops, you might get in shit.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
krishon




PostPosted: Sat Nov 23, 2002 11:07 pm   Post subject: (No subject)

#####

Edited by Tony

Don't post stuff like that over here plz.

and I wouldn't want it ether... I got my reasons
krishon




PostPosted: Sun Nov 24, 2002 12:44 am   Post subject: (No subject)

k, sry
Sponsor
Sponsor
Sponsor
sponsor
krishon




PostPosted: Mon Nov 25, 2002 10:07 pm   Post subject: (No subject)

Another problem. It used to work before, but when i asked it to exit when ........., it wuz supposed to go to a menu. however, it went somewhere else. Wut can i do to fix it??
Tony




PostPosted: Mon Nov 25, 2002 10:11 pm   Post subject: (No subject)

if you put exit when inside a netsted loop, it will exit only that single loop. That might cause a problem.

here's an alternative solution if thats the case:

code:
var flag:boolean := false

loop
loop
if ExitCondition then
flag := true
exit
end if
end loop

if flag = true then
exit
end if
end loop


basically you set up a flag boolean variable to keep track of when you need to exit
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
krishon




PostPosted: Mon Nov 25, 2002 10:17 pm   Post subject: (No subject)

i get it, but i found out i added an extra loop,lol. But thanx for the advice. You've really helped me. I really appreciate it.
krishon




PostPosted: Mon Nov 25, 2002 10:28 pm   Post subject: (No subject)

oh and one more thing. I saw the little message about the saving the variables. However, it wuz pretty confusing and it didn't really work. Could u help explain it??
Tony




PostPosted: Tue Nov 26, 2002 8:20 pm   Post subject: (No subject)

what do you mean saving variables? Like assigning new value as in

variable := newValue or to external file? In that case check out a tutorial on I/O in tutorial section.

If its none of above, please specify your question.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
krishon




PostPosted: Tue Nov 26, 2002 9:10 pm   Post subject: (No subject)

actually, nm bout it, i got it to work Wink

but i have another problem. I want to make a character in a game grow a level after it gets a certain number of experience points. How can i make it do that?? I've tried several things like dividing the number of experience points by a certain number and see if it was an integer. However, they did not work. Confused Wut should i do??????????????

thx, kris
Dan




PostPosted: Tue Nov 26, 2002 10:31 pm   Post subject: hummm

there are server things you coude do for this, the eisted whode to make a txt file with like 100 numse wich will repersent the number of ex points needed to lvl up for each level and have the prgame read the file. the progblem with thiss is that it can get repetive and you may whot to have your person be able to lvl up as much as they whont.

a nother sugestion is to use the flowing code, althoght this may not wrok right all the time it is able to some times cover a rela num to an int.

code:

var rnum : real := 5 div 2
var inum : int
var snum : string

snum := realstr (rnum,1)
inum := strint (snum,10)

put inum


this coude shode rownd the number up if itis not a wole number but becucale using it.

the onlyother way i can think of making an real to an int whode be using some completed code and the cheat fuction wich few poeopl know about, but becuse if you us it wrong you can mess over a lot of stuff i will not get in to that.

hope that helps.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
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 6  [ 82 Posts ]
Goto page 1, 2, 3, 4, 5, 6  Next
Jump to:   


Style:  
Search: