test for completion

while(((col < n+1)&&(row < n+1)) || !empty(&s))