Thanks for all of the advice. I decided to go with the method Kerm shows. However, even after I added detection for it hitting a wall, it is getting the domain error when all it is doing is putting a space at where the enemy was so that it doesn't leave a trail.
Here is new code after a couple hours of hitting it with a hammer, and it still not working
.
Code:
Repeat G=45
getKey->G
randInt(1,10)->L
If L<5
Then
randInt(1,4)->Z
If Z=1 and (G-1>1)
Then
// Move up
Output(G,H," "
G-1->G
Output(G,H,"+
End
If Z=2 and (G+1<10)
Then
// Move down
Output(G,H," "
G+1->G
Output(G,H,"+
End
If Z=3 and (H+1<26)
Then
// Move right
Output(G,H," "
H+1->H
Output(G,H,"+
End
If Z=4 and (H-1>1)
Then
// Move left
Output(G,H," "
H-1->H
Output(G,H,"+
End
If G=45
Output(D,C,"*
If G=24
Then
Output(D,C,"
C-1->C
Output(D,C,"*
End
If G=25
Then
Output(D,C,"
D-1->D
Output(D,C,"*
End
If G=26
Then
Output(D,C,"
C+1->C
Output(D,C,"*
End
If G=34
Then
Output(D,C,"
D+1->D
Output(D,C,"*
End