Anything wrong with the code? Very much appreciated! Also very urgent

The following code is for the vex robot self-driving on a grid mat. 99 is where the robot start, 1 is the spot that has already obtained and the robot needs to prevent driving on it. 2 is the goal position. When the code runs, it turns out as “memory permission error! 03803840”. Can somebody help me what’s wrong with the code? This is for my PLTW 2.1.4 computer essential class.

when(PRINTLCD){
Brain.Screen.clearScreen();
Brain.Screen.setCursor(1,1);
CurrentRow=0;
while((CurrentRow<Height)){
CurrentCol=0;
while((CurrentCol<Width)){
if((myArray1[CurrentRow][CurrentCol]==99)){
Brain.Screen.print(“S”);
sdvCol=CurrentCol;
sdvRow=CurrentRow;
}
if((myArray1[CurrentRow][CurrentCol]==2)){
Brain.Screen.print(“G”);
goalCol=CurrentCol;
goalRow=CurrentRow;
}
if((myArray1[CurrentRow][CurrentCol]==1)){
Brain.Screen.print(“X”);
}
if((myArray1[CurrentRow][CurrentCol]==0)){
Brain.Screen.print(“0”);
}
if((myArray1[CurrentRow][CurrentCol]==98)){
Brain.Screen.print("*");
}
if(((myArray1[CurrentRow][CurrentCol]>2) and (myArray1[CurrentRow][CurrentCol]<98))){
Brain.Screen.print(myArray1[CurrentRow][CurrentCol]);
Brain.Screen.print(" “);
if((myArray1[CurrentRow][CurrentCol]<10)){
Brain.Screen.print(” ");
}
}
CurrentCol=(CurrentCol+1);
}
Brain.Screen.newLine();
CurrentRow=(CurrentRow+1);
}
}​

when(COMPLETE){
if((goalCol==sdvCol)){
if((goalRow==sdvRow)){
atGoal=true;
wait(5,seconds);
Brain.Screen.print(“Path Complete!”);
}
}
}​

when(STARTED){
broadcastAndWait(INITIALIZE);
broadcastAndWait(PRINTLCD);
wait(1,seconds);
broadcastAndWait(BUILDWF);
wait(1,seconds);
broadcastAndWait(PATHFINDER);
}​

when(INITIALIZE){
CurrentCol=0;
CurrentRow=0;
Width=5;
Height=5;
myArray1=[[0,0,0,0,0],
[0,1,99,1,0],
[1,1,1,1,0],
[0,0,0,0,0],
[0,0,2,0,0]
];
CurrentWave=2;
ElementCount=(Height*Width);
goalCol=0;
goalRow=0;
sdvCol=0;
sdvRow=0;
atGoal=false;
South=98;
East=98;
West=98;
North=98;
directionToTravel=0;
facing=0;
}​

when(FINDDIRECTION){
if(sdvRow>0){
North=myArray1[sdvRow-1][sdvCol];
if(North==1){
North=98;
}
}else{
North=98;
}
if(sdvRow<Height-1){
South=myArray1[sdvRow+1][sdvCol];
if(South==1){
South=98;
}
}else{
South=98;
}
if(sdvCol>0){
West=myArray1[sdvRow][sdvCol-1];
if(West==1){
West=98;
}
}else{
West=98;
}
if(sdvCol<Width-1){
East=myArray1[sdvRow][sdvCol+1];
if(East==1){
East=98;
}
}else{
East=98;
}
if(North<=East){
if(North<=South){
if(North<=West){
directionToTravel=0;
}else{
directionToTravel=3;
}
}else{
if(South<=West){
directionToTravel=2;
}else{
directionToTravel=3;
}
}
}else{
if(East<=South){
if(East<=West){
directionToTravel=1;
}else{
directionToTravel=3;
}
}else{
if(South<=West){
directionToTravel=2;
}else{
directionToTravel=3;
}
}
broadcastAndWait(PRINTLCD);
}
}​

when(PATHFINDER){
broadcastAndWait(COMPLETE);
while((not atGoal)){
broadcastAndWait(FINDDIRECTION);
if((directionToTravel==0)){
if((facing==0)){
broadcastAndWait(FORWARD);
}
if((facing==1)){
broadcastAndWait(LEFT);
broadcastAndWait(FORWARD);
}
if((facing==2)){
broadcastAndWait(LEFT);
broadcastAndWait(LEFT);
broadcastAndWait(FORWARD);
}
if((facing==3)){
broadcastAndWait(RIGHT);
broadcastAndWait(FORWARD);
}
myArray1[sdvRow][sdvCol]=98;
sdvRow=(sdvRow-1);
myArray1[sdvRow][sdvCol]=99;
facing=0;
}
if((directionToTravel==1)){
if((facing==1)){
broadcastAndWait(FORWARD);
}
if((facing==0)){
broadcastAndWait(RIGHT);
broadcastAndWait(FORWARD);
}
if((facing==3)){
broadcastAndWait(LEFT);
broadcastAndWait(LEFT);
broadcastAndWait(FORWARD);
}
if((facing==2)){
broadcastAndWait(LEFT);
broadcastAndWait(FORWARD);
}
myArray1[sdvRow][sdvCol]=98;
sdvCol=(sdvCol+1);
myArray1[sdvRow][sdvCol]=99;
facing=1;
}
if(directionToTravel==2){
if(facing==2){
broadcastAndWait(FORWARD);
}
if(facing==1){
broadcastAndWait(RIGHT);
broadcastAndWait(FORWARD);
}
if(facing==0){
broadcastAndWait(LEFT);
broadcastAndWait(LEFT);
broadcastAndWait(FORWARD);
}
if(facing==3){
broadcastAndWait(LEFT);
broadcastAndWait(FORWARD);
}
myArray1[sdvRow][sdvCol]=98;
sdvRow=sdvRow+1;
myArray1[sdvRow][sdvCol]=99;
facing=2;
}
if(directionToTravel==3){
if(facing==3){
broadcastAndWait(FORWARD);
}
if(facing==0){
broadcastAndWait(LEFT);
broadcastAndWait(FORWARD);
}
if(facing==1){
broadcastAndWait(LEFT);
broadcastAndWait(LEFT);
broadcastAndWait(FORWARD);
}
if(facing==2){
broadcastAndWait(RIGHT);
broadcastAndWait(FORWARD);
}
myArray1[sdvRow][sdvCol]=98;
sdvCol=sdvCol-1;
myArray1[sdvRow][sdvCol]=99;
facing=3;
}
broadcastAndWait(COMPLETE);
}
}​