Computer Science Canada

My logic doesnt seem to make my A.I move!

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

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

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

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

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


: