Would some kind person be able to explain to me why the following code fails:
This is assuming that NUM=63, what it should be doing is checking - then switching, if there's no more checks quit out of the routine.
But its stuck in its own loop :(
Global a:Int, b:Int, recheck:Int=0, finish:Int=0 While finish=0 recheck=0 For loop=0 To num-2 a=tiles[loop].tile_layer_pos b=tiles[loop+1].tile_layer_pos If b>a Then a=tile_order[loop] b=tile_order[loop+1] tile_order[loop]=b; tile_order[loop+1]=a recheck=1; EndIf Next If recheck=0 Then finish=1 EndIf Wend
This is assuming that NUM=63, what it should be doing is checking - then switching, if there's no more checks quit out of the routine.
But its stuck in its own loop :(