Well, at the expense of a few cycles, you could probably shave a stroke by:

Removing this line initializer:

$n=0

an editing this line like so ( add 0. at beginning):

$n = 0. + $y * ($x - 48 - ($x > 64) * 7) + $n

hmmm,