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

Username:   Password: 
 RegisterRegister   
 My logic doesnt seem to make my A.I move!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Velocity




PostPosted: Mon Dec 19, 2011 8:42 pm   Post subject: My logic doesnt seem to make my A.I move!

What is it you are trying to achieve?
Making my A.I (the computer) move left and right

What is the problem you are having?
I cant seem to make him move

Describe what you have tried to solve this problem
I used my logic to find the answer. I don't know if i am anticipating this correclty or if i just ain't doing it the right way.

Turing:


if x1_1 >= maxx div 2 and x2_2 >= maxx div 2 + 105 then
            x1_1 += 10
            x2_2 += 10
end if
if x1_1 <= maxx - 150 and x2_2 <= maxx - 30 then
            x1_1 -= 10
            x2_2 -= 10
end if
% This is the main movement focus, why doesnt it move?



Please specify what version of Turing you are using
4.1.1a
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Mon Dec 19, 2011 9:09 pm   Post subject: RE:My logic doesnt seem to make my A.I move!

If both if statements are true, will it move?
Can you think of a scenario where both cases return true?
Velocity




PostPosted: Mon Dec 19, 2011 9:14 pm   Post subject: RE:My logic doesnt seem to make my A.I move!

when the paddle is in the middle of the screen both cases return true

so are you telling me to reword them or to add = true at the end of each?

I think your telling me to reword them?
Tony




PostPosted: Mon Dec 19, 2011 9:17 pm   Post subject: RE:My logic doesnt seem to make my A.I move!

I think that you should think about what _should_ happen in situations when both of those statements are true. Should the AI move? If so, in which direction?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Velocity




PostPosted: Mon Dec 19, 2011 9:36 pm   Post subject: RE:My logic doesnt seem to make my A.I move!

hm never thought about the elsif's Smile thanks for bringing that up. hah, strange... that actually never entered my mind.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: