Computer Science Canada

trebuchet simulator in turing

Author:  kunal445 [ 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

Author:  chipanpriest [ 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

Author:  kunal445 [ 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

Author:  chipanpriest [ 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"

Author:  kunal445 [ 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?

Author:  Dreadnought [ 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).

Author:  kunal445 [ 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?


: