ASCII art Bresenham line drawing
Perl, 74
 
/ /;print int(.5+$_*$'/$`)&gt;int(.5+--$_*$'/$`)?$/.$&quot;x$_.'\\':'_'for 1..$`

Run with -n option (counted in code size).
$ perl -n bresenham.pl &lt;&lt;&lt;'11 3'
_
 \___
     \___
         \_
$ perl -n bresenham.pl &lt;&lt;&lt;'11 1'
_____
     \_____
$ perl -n bresenham.pl &lt;&lt;&lt;'5 4'

\
 \_
   \
    \
$ perl -n bresenham.pl &lt;&lt;&lt;'10 1'
____
    \_____