Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array elements crashing program [SOLVED]
#2
Code:
extern void object::Lib(){
    float time = abstime();
    travel();
    time = abstime() - time;
    message(time);
}

public void object::travel(){
    int X = 161;
    int Y = 161;
    
    float map [X][Y];
    
    for ( int x = 0; x < X; x++){
        for ( int y = 0; y < Y; y++){
            map[x][y] = topo(new point (x,y));
            //message("Punkt "+x+","+y+" ma wysokosc "+map[x][y]);
        }
    }
}

This is code I quickly made to simulate creation of 2D array representation of game map. It took exactly 76.1195s.
Good luck with your path-finding algorithm. Tongue


Messages In This Thread
RE: Array elements crashing program - by Smok - 03-20-2018, 08:29 PM
RE: Array elements crashing program - by Smok - 03-20-2018, 09:19 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)