8-puzzle - Functions not working correctly

for (a=3;a>0;a--){A three element array has no element with the subscription 3