#167959 - 2006-09-22 01:09 AM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Stop Witto Stop... His head is growing so large he's starting to force others out of the room
|
Top
|
|
|
|
#167960 - 2006-09-22 02:10 AM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
well there is my original code 652. A description of how the code works can be found here. Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $b=' ' $c=$z $d=$c For $a=1 to $z $b='W'+$b+'B' $d=''+$c+' '+$d+' '+$c+'' $c=$c-1 $h=$h+'2 ' Next $d=Split($d) $c=$z-1 For $a=1 to $z $h='1 '+$h+'1 ' For $f = 1 to $c $h='2 '+$h+'2 ' Next $c=$c-1 Next $h=Split(Trim($h)) $a=1 For Each $c in $d For $f = 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)) ReDim $g[UBound($d)+1] $g[0]=$b $a=1 For Each $c in $d $f=Split($b)[0] $h=Split($b)[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,SubStr($f,1,Len($f)-1)+' W',SubStr($f,1,Len($f)-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+SubStr($h,2,Len($h)-1),'B'+Left($h,1) +' '+SubStr($h,3,Len($h)-2))) $g[$a]=$b $a=$a+1 ;Next $s=$g EndFunction
|
Top
|
|
|
|
#167961 - 2006-09-22 06:24 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
well... here is 640 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $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 $c=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $c $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) $a=1 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)) ReDim $g[UBound($d)+1] $g[0]=$b $a=1 For Each $c in $d $f=Split($b)[0] $h=Split($b)[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,SubStr($f,1,Len($f)-1)+' W',SubStr($f,1,Len($f)-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+SubStr($h,2,Len($h)-1),'B'+Left($h,1) +' '+SubStr($h,3,Len($h)-2))) $g[$a]=$b $a=$a+1 ;Next $s=$g EndFunction
|
Top
|
|
|
|
#167962 - 2006-09-22 06:27 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
show off
|
Top
|
|
|
|
#167964 - 2006-09-22 06:31 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
i think your right, public only.
|
Top
|
|
|
|
#167965 - 2006-09-22 06:34 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
636 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $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)) ReDim $g[UBound($d)+1] $g[0]=$b $a=1 For Each $c in $d $f=Split($b)[0] $h=Split($b)[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,SubStr($f,1,Len($f)-1)+' W',SubStr($f,1,Len($f)-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+SubStr($h,2,Len($h)-1),'B'+Left($h,1) +' '+SubStr($h,3,Len($h)-2))) $g[$a]=$b $a=$a+1 ;Next $s=$g EndFunction
|
Top
|
|
|
|
#167966 - 2006-09-22 06:46 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
well... 592: Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $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)) ReDim $g[UBound($d)+1] $g[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))) $g[$a]=$b $a=$a+1 $s=$g EndFunction
|
Top
|
|
|
|
#167967 - 2006-09-22 06:47 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
633 Code:
Function s($z) Dim $a,$b,$c,$d,$e,$f,$g,$h,$i $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 $f = 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)) ReDim $g[$z*($z+2)] $g[0]=$b $a=1 For Each $c in $d $f=Split($b)[0] $h=Split($b)[1] $e=Right($c,1) $b=IIf(Left($c,1)='W', IIf($e=1,SubStr($f,1,Len($f)-1)+' W',SubStr($f,1,Len($f)-2)+ ' '+Right($f,1)+'W')+$h,$f+ IIf($e=1,'B '+SubStr($h,2,Len($h)-1),'B'+Left($h,1) +' '+SubStr($h,3,Len($h)-2))) $g[$a]=$b $a=$a+1 ;Next $s=$g EndFunction
|
Top
|
|
|
|
#167969 - 2006-09-22 06:50 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
booger, you snuck that in
|
Top
|
|
|
|
#167970 - 2006-09-22 06:52 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
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)
|
Top
|
|
|
|
#167971 - 2006-09-22 06:59 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
579 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 $g=$g+IIf($a mod 2,'B','W')+$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
|
Top
|
|
|
|
#167972 - 2006-09-22 07:05 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
|
Top
|
|
|
|
#167973 - 2006-09-22 07:16 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
575 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) $s[0]=$b For $e=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $e $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) For Each $c in $d For $z = 1 to $c $g=$g+IIf($e mod 2,'B','W')+$h[$i]+' ' $i=$i+1 Next $e=$e+1 Next $d=Split(Trim($g)) For Each $c in $d $a=$a+1 $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 EndFunction
|
Top
|
|
|
|
#167974 - 2006-09-22 07:18 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
570 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) $s[0]=$b For $e=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $e $h='2 '+$h+'2 ' Next Next $h=Split(Trim($h)) For Each $c in $d For $z = 1 to $c $g=$g+IIf($e mod 2,'B','W')+$h[$i]+' ' $i=$i+1 Next $e=$e+1 Next For Each $c in Split(Trim($g)) $a=$a+1 $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 EndFunction
|
Top
|
|
|
|
#167975 - 2006-09-22 07:19 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
565 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) $s[0]=$b For $e=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $e $h='2 '+$h+'2 ' Next Next For Each $c in $d For $z = 1 to $c $g=$g+IIf($e mod 2,'B','W')+Split(Trim($h))[$i]+' ' $i=$i+1 Next $e=$e+1 Next For Each $c in Split(Trim($g)) $a=$a+1 $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 EndFunction
|
Top
|
|
|
|
#167976 - 2006-09-22 07:20 PM
Re: KiXgolf: Shuttle Puzzle - Public Round
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
560 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 $s[0]=$b For $e=$z-1 to 0 step -1 $h='1 '+$h+'1 ' For $f = 1 to $e $h='2 '+$h+'2 ' Next Next For Each $c in Split($d) For $z = 1 to $c $g=$g+IIf($e mod 2,'B','W')+Split(Trim($h))[$i]+' ' $i=$i+1 Next $e=$e+1 Next For Each $c in Split(Trim($g)) $a=$a+1 $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 EndFunction
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 700 anonymous users online.
|
|
|