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6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 8 8 8 6 6
)
mapw=44 maph=44
((mx=375*scale/10))
((my=95*scale/10))
angle=$((pi2-pi/2))
elif ((mapselect==3)); then
map=(
    9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
    9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9
    9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
)
mapw=18 maph=18
((mx=scale,my=(maph-1)*scale))
angle=$((pi2-pi/4))
else
map=(
    2 2 2 3 3 4 4 5 6 7 7 7 7 7 9 9 9 9 9 9 9 9 9
    2 0 0 0 0 0 0 0 6 0 0 0 0 8 0 0 9 9 0 0 0 0 9
    2 2 2 0 0 4 0 0 6 0 7 0 0 8 8 8 8 9 0 0 0 0 9
    9 0 3 0 0 4 0 0 0 0 7 0 0 8 0 0 0 0 0 0 0 0 9
    9 0 3 0 0 4 0 0 6 0 7 0 0 0 0 0 8 9 0 0 0 0 9
    9 0 3 0 0 4 0 0 6 0 7 0 0 8 8 8 8 9 0 0 0 0 9
    3 3 3 0 0 0 0 0 6 0 0 0 0 8 0 0 0 9 0 0 0 0 9
    3 0 3 0 0 0 0 0 6 7 7 7 7 8 0 0 0 9 9 9 9 9 9
    3 0 3 3 5 5 6 6 6 7 7 0 0 0 0 0 0 0 0 0 0 0 9
    3 0 4 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 0 0 9
    3 0 0 0 0 0 0 0 6 0 7 0 0 0 0 0 0 0 0 0 0 0 9
    4 4 4 4 5 5 6 6 6 0 7 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 8 0 8 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 0 8 0 8 0 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 8 8 0 8 8 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 9 0 0 0 9 0 0 0 0 0 0 0 0 0 0 9
    9 0 0 0 0 0 0 9 0 0 0 9 0 0 0 0 0 0 0 0 0 0 9
    9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
)
mapw=23 maph=18
((mx=my=scale*3/2))
angle=$((pi/2))
fi
for ((i=0;i<maph;i+=2)) do
    for ((j=0;j<mapw;j++)) do
        mapt[q++]=${map[i*mapw+j]}
        mapt[q++]=${map[(i+1)*mapw+j]}
    done
done
