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

Username:   Password: 
 RegisterRegister   
 trebuchet simulator in turing
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
kunal445




PostPosted: Wed Dec 21, 2011 6:50 pm   Post subject: trebuchet simulator in turing

ok so i am trying to make a trebuchet simulator with Turing . i have attached a copy of what i have done so far however i need help of getting the graphic and for it to loop.

there are 3 error in it
1. it wont let me put g as a constant
2. it wont let me close brackets
3. it wont let me use sine and cosine function

plz help



sim.t
 Description:

Download
 Filename:  sim.t
 Filesize:  277 Bytes
 Downloaded:  107 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
chipanpriest




PostPosted: Wed Dec 21, 2011 7:08 pm   Post subject: Re: trebuchet simulator in turing

okay first of all, your variable have to be real numbers if you are dividing and using sine or cosine

eg.
Turing:
var Mc,g,h,PE,e,KE,v,Mp,o,Vx,Vy,t,d : real


as opposed to what you have which is:
Turing:
var Mc,g,h,PE,e,KE,v,Mp,o,Vx,Vy,t,d : int


secondly, when you are using sine or cosine the syntax would be:
Turing:
Vx := v* cos (o)
Vy := v* sin (o)


instead of what you have which is:
Turing:
Vx := v*cos o
Vy := v*sin o



also, when you have:
Turing:
KE:= e*PE

thats not going to work because neither e nor PE have a value to them so the function wont happen
kunal445




PostPosted: Wed Dec 21, 2011 7:22 pm   Post subject: Re: trebuchet simulator in turing

so when multiplying things in turing u have to keep space after *? btw e is 0.5J
chipanpriest




PostPosted: Wed Dec 21, 2011 7:50 pm   Post subject: RE:trebuchet simulator in turing

you dont need a space but you need the () around the angle which in your case, is "o"
kunal445




PostPosted: Wed Dec 21, 2011 9:17 pm   Post subject: Re: trebuchet simulator in turing

would Turing automatically turn my degrees into radians or is there a code for that?
Dreadnought




PostPosted: Wed Dec 21, 2011 9:25 pm   Post subject: Re: trebuchet simulator in turing

You could use sind, cosd, and all the other trig functions that use degrees. Or you could write your own function to convert (its not very hard).
kunal445




PostPosted: Wed Dec 21, 2011 9:28 pm   Post subject: Re: trebuchet simulator in turing

and also this makes a parabolic graph and i wish to include that as well in this could you plz help?
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  [ 7 Posts ]
Jump to:   


Style:  
Search: