584 ;p
Code:

Function s($z)

Dim $a,$b,$c,$d,$e,$f,$g,$h,$i
ReDim $s[$z*($z+2)]

$b=' '
$d=$z
For $c=$z to 1 step -1
$b='W'+$b+'B'
$d=''+$c+' '+$d+' '+$c+''
$h=$h+'2 '
Next
$d=Split($d)

For $a=$z-1 to 0 step -1
$h='1 '+$h+'1 '
For $f = 1 to $a
$h='2 '+$h+'2 '
Next
Next
$h=Split(Trim($h))

For Each $c in $d
For $z = 1 to $c
$e=IIf($a mod 2,'B','W')
$g=$g+$e+$h[$i]+' '
$i=$i+1
Next
$a=$a+1
Next

$d=Split(Trim($g))

$s[0]=$b
$a=1
For Each $c in $d
$h=Split($b)
$f=$h[0]
$h=$h[1]
$e=Right($c,1)
$b=IIf(Left($c,1)='W',
IIf($e=1,Left($f,-1)+' W',Left($f,-2)+
' '+Right($f,1)+'W')+$h,$f+
IIf($e=1,'B '+Right($h,-1),'B'+Left($h,1)
+' '+Right($h,-2)))
$s[$a]=$b
$a=$a+1
EndFunction



Edited by benny69 (2006-09-22 06:53 PM)