NPCpaths$ = "" NPCchoices = 0 moveup$ = "moveup " movedown$ = "movedown " moveleft$ = "moveleft " moveright$ = "moveright " IF gridY < NPCgridY THEN NPCpaths$ = NPCpaths$ + moveup$ NPCchoices = NPCchoices + 1 END IF IF gridY > NPCgridY THEN NPCpaths$ = NPCpaths$ + movedown$ NPCchoices = NPCchoices + 1 END IF IF gridX < NPCgridX THEN NPCpaths$ = NPCpaths$ + moveleft$ NPCchoices = NPCchoices + 1 END IF IF gridX > NPCgridX THEN NPCpaths$ = NPCpaths$ + moveright$ NPCchoices = NPCchoices + 1 END IF NPCpickchoice = RANDOM NPCchoices NPCaction$ = WORD$ NPCpaths$ NPCpickchoice