NOTE:
This is on a Ti84+ce, so the screen resolution is 26x10, unlike the monochrome calculators.
I am trying to get a simple AI to work like this:
go forward
if wall
turn left
⌊ENGNX and ⌊ENGNY are the x and y positions.
⌊ENGND is the direction it is facing.
[A] is a 26x10 array storing the map (0 = air, 1 = wall etc.)
When I start the program, it sets the direction list to {1, 1}, the X list to {1, 3}, and the Y list to {1, 6}, but as soon as run the program, and the code below is executed, it becomes {2, 2} and {2, 2} while the directions are still {1, 1}
(Just the AI bit):
For(A,1,dim(⌊ENGNX))
⌊ENGNX(A)→E
⌊ENGNY(A)→F
⌊ENGND(A)→D
Output(F,E,"
((E+(D=1)) and E≠27)+((E-(D=3)) and E≠0)→E
((F+(D=2)) and F≠11)+((F-(D=4)) and F≠11)→F
If [A](E,F)≠1:Then
E→⌊ENGNX(A
F→⌊ENGNY(A
End
If [A](E,F)=1:Then
D+1→D
If D=5
1→D
D→⌊ENGND(A
End
Output(⌊ENGNY(A),⌊ENGNX(A),"V
If ⌊ENGNX(A)=X and ⌊ENGNY(A)=Y
Goto QT
End
Also how does the double posting rule work? Is it just within "pages" like "Forum » Programming & Design / TI-83/84 Programming » AI not working" that I shouldn't post twice in a row, or like the whole site (Like if I wanted to share a life story right after posting this)?