Skip to main content
3 of 10
new approach on "/"
Titus
  • 14.8k
  • 1
  • 24
  • 41

#PHP, 306 292 281 bytes

$r=str_pad("",$w=-1+2*$n=$argv[2],($c=$argv[1])." ")."\n";switch($c){case"+":$r=($m=str_pad("+",$w," ",2))."\n$r$m";break;case"=":$r.=$r;break;case x:for($r=$c;$i<$n;$r[$i*(2+$n)]=$r[++$i*$n-1]=x)$r[$i*$n+$i+$n]="\n";break;case"/":for($r=$s="";$i++<$n;$s.=" ")$r="$s/\n$r";}echo$r;

Ooh this is bulky ... needs further golfing.

Titus
  • 14.8k
  • 1
  • 24
  • 41