Author |
Message |
Velocity
![](http://compsci.ca/v3/uploads/user_avatars/1809397984eb9e2888e99b.jpg)
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: 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? |
|
|
|
|
![](images/spacer.gif) |
Velocity
![](http://compsci.ca/v3/uploads/user_avatars/1809397984eb9e2888e99b.jpg)
|
Posted: 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? |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: 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? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Velocity
![](http://compsci.ca/v3/uploads/user_avatars/1809397984eb9e2888e99b.jpg)
|
Posted: 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 thanks for bringing that up. hah, strange... that actually never entered my mind. |
|
|
|
|
![](images/spacer.gif) |
|