Page 1 of 4 1234>
Topic Options
#191434 - 2008-12-27 04:02 PM KiXgolf: Instruens Fabulam - public round
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
This is the public round continuation of KiXgolf: Instruens Fabulam. The private round can be found at http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=191433

Please post you code and start the enhancements.
_________________________
There are two types of vessels, submarines and targets.

Top
#191436 - 2008-12-27 04:48 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Sealeopard]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Here is my 569

function cif($a,$p)
dim $r,$c,$i,$,$d,$z
$z=@crlf
$p=split($p,$z)
$r=ubound($p)
$c=ubound(split($p[0],"&"))
dim $y[$r,$c] , $l[$c], $t[$c]
for $i=0 to $r
for $=0 to $c
$d=split($p[$i],"&")[$]
$y[$i,$]=$d
if ($d^) > $l[$]
$l[$]=0^$d
endif
next
next
for $i=0 to $r
for $=0 to $c
$p=substr($a,$+1,1)
while ($y[$i,$]^)<$l[$]
$d=$y[$i,$]
$y[$i,$]=iif($p="<",$d + " ",iif($p=">"," " + $d,right(" " + $d + " ",$l[$])))
loop
while ($t[$]^)< $l[$]+2
$t[$]=$t[$]+"-"
loop
next
next
$p="@" + join($t,"-") + "@"
$d=$p+$z
for $i=0 to $r
for $=0 to $c
$d=$d+ iif($i=1 & $=0,"|" + join($t,"+") + "|" + $z,"") + "| " + $y[$i,$] + " " + iif($=$c,"|" + $z,"")
$cif=$d + $p
endfunction

Top
#191437 - 2008-12-27 04:52 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
And found one stroke after the fact.

568
function cif($a,$p)
dim $r,$c,$i,$,$d,$z
$z=@crlf
$p=split($p,$z)
$r=ubound($p)
$c=ubound(split($p[0],"&"))
dim $y[$r,$c] , $l[$c], $t[$c]
for $i=0 to $r
for $=0 to $c
$d=split($p[$i],"&")[$]
$y[$i,$]=$d
if ($d^) > $l[$]
$l[$]=0^$d
endif
next
next
for $i=0 to $r
for $=0 to $c
$p=substr($a,$+1,1)
while ($y[$i,$]^)<$l[$]
$d=" " + $y[$i,$] + " "
$y[$i,$]=iif( $p=">",left($d,~),right( $d,iif( $p="=",$l[$],~ ) ) )
loop
while ($t[$]^)< $l[$]+2
$t[$]=$t[$]+"-"
loop
next
next
$p="@" + join($t,"-") + "@"
$d=$p+$z
for $i=0 to $r
for $=0 to $c
$d=$d+ iif($i=1 & $=0,"|" + join($t,"+") + "|" + $z,"") + "| " + $y[$i,$] + " " + iif($=$c,"|" + $z,"")
$cif=$d + $p
endfunction

Top
#191438 - 2008-12-27 05:25 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Allen]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Here's my 566. I think there's lots of room to improve so let's see if the collective can get it below 500 :-)

 Code:
; begin KiXgolfUDF
;
;!
Function CIF($a, $l)
Dim $b, $c, $d, $f, $i, $j, $k, $n, $t[$a^0], $;

	$l = split($l,@crlf)

	for $i = 0 to 79
		$f = $f + ' '
		$d = $d + '-'
	next

	for each $i in $l
		$k = split($i,'&')
		for $j = 1 to $a^0
			$c = len($k[$j-1])
			if $c>$t[$j]
				$t[$j]=$c
			endif
		next
	next

	for each $i in $l
		for $j = 1 to $a^0
			$k = substr($a,$j,1)

			$c = instr($i+'&','&')
			$n = left($i,$c-1)
			$i = substr($i,$c+1)

			$c = $t[$j]

			$ = $ + '| ' + iif($k='<',left($n + $f,$c),iif($k='>',right($f + $n,$c),left(left($f,($c-($n^))/2) + $n + $f,$c))) + ' '

		next
		$ = $ + '|' + @crlf
		if $b=0
			$b = '@' + left($d,($^)-4) + '@'
			$ =  $b  + @crlf + $ + '|'
			for $k = 1 to $a^0
				$ = $ + left($d,$t[$k]+2) + '+'
			next
			$ = left($,($^)-1) + '|' + @crlf
		endif
		$cif = $ + $b

EndFunction
;!
;!
; end KiXgolfUDF
_________________________
The Code is out there

Top
#191439 - 2008-12-27 05:50 PM Re: KiXgolf: Instruens Fabulam - public round [Re: DrillSergeant]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Drill's 565

 Code:
Function CIF($a, $l)
Dim $b, $c, $d, $f, $i, $j, $k, $n, $t[$a^0], $,$z;
        $z=@crlf
	$l = split($l,$z)

	for $i = 0 to 79
		$f = $f + ' '
		$d = $d + '-'
	next

	for each $i in $l
		$k = split($i,'&')
		for $j = 1 to $a^0
			$c = len($k[$j-1])
			if $c>$t[$j]
				$t[$j]=$c
			endif
		next
	next

	for each $i in $l
		for $j = 1 to $a^0
			$k = substr($a,$j,1)

			$c = instr($i+'&','&')
			$n = left($i,$c-1)
			$i = substr($i,$c+1)

			$c = $t[$j]

			$ = $ + '| ' + iif($k='<',left($n + $f,$c),iif($k='>',right($f + $n,$c),left(left($f,($c-($n^))/2) + $n + $f,$c))) + ' '

		next
		$ = $ + '|' + $z
		if $b=0
			$b = '@' + left($d,($^)-4) + '@'
			$ =  $b  + $z + $ + '|'
			for $k = 1 to $a^0
				$ = $ + left($d,$t[$k]+2) + '+'
			next
			$ = left($,($^)-1) + '|' + $z
		endif
		$cif = $ + $b

EndFunction

Top
#191440 - 2008-12-27 07:24 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Allen]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Allen's 551

Replaced $c=ubound(split($p[0],"&")) by $c=($a^)-1

 Code:
; begin KiXgolfUDF
;
;!
function cif($a,$p)
dim $r,$c,$i,$,$d,$z
	$z=@crlf
	$p=split($p,$z)
	$r=ubound($p)
	$c=($a^)-1
	dim $y[$r,$c] , $l[$c], $t[$c]
	for $i=0 to $r
		for $=0 to $c
			$d=split($p[$i],"&")[$]
			$y[$i,$]=$d
			if ($d^) > $l[$]
				$l[$]=0^$d
			endif
		next
	next
	for $i=0 to $r
		for $=0 to $c
			$p=substr($a,$+1,1)
			while ($y[$i,$]^)<$l[$]
				$d=" " + $y[$i,$] + " "
				$y[$i,$]=iif( $p=">",left($d,~),right( $d,iif( $p="=",$l[$],~ ) ) )
			loop
			while ($t[$]^)< $l[$]+2
				$t[$]=$t[$]+"-"
			loop
		next
	next
	$p="@" + join($t,"-") + "@"
	$d=$p+$z
	for $i=0 to $r
		for $=0 to $c
			$d=$d+ iif($i=1 & $=0,"|" + join($t,"+") + "|" + $z,"") + "| " + $y[$i,$] + " " + iif($=$c,"|" + $z,"")
			$cif=$d + $p
endfunction
;!
;!
; end KiXgolfUDF
_________________________
The Code is out there

Top
#191441 - 2008-12-27 08:11 PM Re: KiXgolf: Instruens Fabulam - public round [Re: DrillSergeant]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Allen's 549

Changed + " " + iif($=$c,"|" + $z,"") to + iif($=$c," |" + $z," ")

 Code:
; begin KiXgolfUDF
;
;!
function cif($a,$p)
dim $r,$c,$i,$,$d,$z
	$z=@crlf
	$p=split($p,$z)
	$r=ubound($p)
	$c=($a^)-1
	dim $y[$r,$c] , $l[$c], $t[$c]
	for $i=0 to $r
		for $=0 to $c
			$d=split($p[$i],"&")[$]
			$y[$i,$]=$d
			if ($d^) > $l[$]
				$l[$]=0^$d
			endif
		next
	next
	for $i=0 to $r
		for $=0 to $c
			$p=substr($a,$+1,1)
			while ($y[$i,$]^)<$l[$]
				$d=" " + $y[$i,$] + " "
				$y[$i,$]=iif( $p=">",left($d,~),right( $d,iif( $p="=",$l[$],~ ) ) )
			loop
			while ($t[$]^)< $l[$]+2
				$t[$]=$t[$]+"-"
			loop
		next
	next
	$p="@" + join($t,"-") + "@"
	$d=$p+$z
	for $i=0 to $r
		for $=0 to $c
			$d=$d+ iif($i=1 & $=0,"|" + join($t,"+") + "|" + $z,"") + "| " + $y[$i,$] + iif($=$c," |" + $z," ")
			$cif=$d + $p
endfunction
;!
;!
; end KiXgolfUDF
_________________________
The Code is out there

Top
#191442 - 2008-12-27 09:21 PM Re: KiXgolf: Instruens Fabulam - public round [Re: DrillSergeant]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
$c=($a^)-1
oh that sucks.... I sat there and sat there thinking... there must be an easier way.

iif($=$c," |" + $z," ")
and this one... wow... I should have gotten that one.

Dang.

Top
#191443 - 2008-12-27 09:44 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Allen]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
here is my 649 down to 645
 Code:
Function CIF($f, $)
  Dim $a,$b,$c,$d,$e[($f^)],$g,$h,$j,$k,$l,$m,$o,$p,$q,$s,$t,$u
  $a = Split($, @CRLF)
  $g = ($f ^) - 1
  For Each $b in $a
    $c = Split($b, '&')
    For $d = 0 to $g
      $e[$d] = IIf($e[$d] < ($c[$d]^), ($c[$d]^), $e[$d])
    Next
  Next
  For $d = 0 to $g
    $o = $o + $e[$d]
  Next
  $s = 1
  For Each $b in $a
    $c = Split($b, '&')
    For $d = 0 to $g
      $h = SubStr($f,$d+1,1)
      $u = $c[$d]
      $j = $e[$d] - ($u^)
      For $q = 1 to $e[$d] +2
        $p = $p + '-'
      Next
      If $s
        $p = $p + '+'
      EndIf
      For $k = 1 to $j /2
        $l = $l + ' '
      Next
      $m = IIf($j mod 2,' ','')
      $t = Join(Split($t+'| '+IIf($h<>'=',IIf($h='<',$u+$l+$l+$m,$l+$l+$m+$u),$l+$u+$l+$m)+' |','||'),'|')
      $l = ''
    Next
    $t = $t + @CRLF + IIf($s,'|' + Left($p, ~) + '|' + @CRLF,'')
    $s = 0
  Next
  For $k = 1 to $o+3*($f^)-1
    $l = $l + '-'
;  Next
  $CIF = '@' + $l + '@' + @CRLF + $t + '@' + $l + '@'
EndFunction
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#191444 - 2008-12-28 01:38 AM Re: KiXgolf: Instruens Fabulam - public round [Re: Benny69]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Drills 562
$c=len($k[$j-1]) to $c = 0^$k[$j-1]

Function CIF($a, $l)
Dim $b, $c, $d, $f, $i, $j, $k, $n, $t[$a^0], $,$z;
$z=@crlf
$l = split($l,$z)


for $i = 0 to 79
$f = $f + ' '
$d = $d + '-'
next


for each $i in $l
$k = split($i,'&')
for $j = 1 to $a^0
$c = 0^$k[$j-1]
if $c>$t[$j]
$t[$j]=$c
endif
next
next


for each $i in $l
for $j = 1 to $a^0
$k = substr($a,$j,1)


$c = instr($i+'&','&')
$n = left($i,$c-1)
$i = substr($i,$c+1)


$c = $t[$j]


$ = $ + '| ' + iif($k='<',left($n + $f,$c),iif($k='>',right($f + $n,$c),left(left($f,($c-($n^))/2) + $n + $f,$c))) + ' '


next
$ = $ + '|' + $z
if $b=0
$b = '@' + left($d,($^)-4) + '@'
$ = $b + $z + $ + '|'
for $k = 1 to $a^0
$ = $ + left($d,$t[$k]+2) + '+'
next
$ = left($,($^)-1) + '|' + $z
endif
$cif = $ + $b


EndFunction

Top
#191445 - 2008-12-28 02:14 AM Re: KiXgolf: Instruens Fabulam - public round [Re: Allen]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
I forgot a LEN??? \:o Jeeez, I'm getting sloppy...

Edited by DrillSergeant (2008-12-28 02:16 AM)
_________________________
The Code is out there

Top
#191465 - 2008-12-29 01:09 PM Re: KiXgolf: Instruens Fabulam - public round [Re: DrillSergeant]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Jeez, it's getting so a guy can't take his eye off the ball for a Christmas break without everyone rushing past!

My 586 (game interrupted for Turkey) looks like this:

; begin KiXgolfUDF
;
;!
Function CIF($a, $y)
Dim $,$s,$l,$e,$h,$q,$z,$c
$l=Len($a)-1
Dim $w[$l]
$c=@CRLF
$y=Split($y,$c)

;
; LOOP 1 - pass through data and record longest entry in each column
; We also construct table top/botton/heading template as we go
;
For Each $s in $y
$h=@
For $=0 to $l
$e=Len(Split($s,"&")[$])
If $w[$]<$e $w[$]=$e EndIf
$h=Trim($h+" "+j($w[$],"<",@,"-"))
Next
Next

;
; LOOP 2 - Pass through data again, constructing table body
;
For Each $s in $y
$q=@
For $=0 to $l
$q=$q+" | "+j($w[$],SubStr($a,$+1,1),Split($s,"&")[$]," ") ; Format data line
Next
$z=$z+"|"+SubStr($q,3)+" |"+$c
+IIf($z=@,"|-"+Join(Split($h),"-+-")+"-|"+$c,@) ; IIf() the table is empty then this is the header line
Next
; Add the header line to the top and bottom of the table
$h="@-"+Join(Split($h),"---")+"-@"
$CIF=$h+$c+$z+$h
EndFunction

; Justification UDF
; $w=Width
; $t=Justification type
; $s=String to justify
; $c=Fill character
;
Function j($w,$t,$s,$c)
Dim $L,$R,$,$x
If $t="<" $R=$c EndIf ; Left Justify
If $t=">" $L=$c EndIf ; Right Justify
If $t="=" $=$c EndIf ; Centre Justify, start on right
while Len($s)<$w
$s=$L+$j+$s+$R+$
$x=$ $=$j $j=$x ; Toggle centre justify RHS <-> LHS
Loop
$j=$s
EndFunction
;!
;!
; end KiXgolfUDF
; vim:filetype=kix sw=4 ts=4

Top
#191469 - 2008-12-29 01:58 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Richard H.]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Ok, down to 560 - it's amazing what shortcuts you forget when you don't play for a while:

; begin KiXgolfUDF
;
;!
Function CIF($a, $y)
Dim $,$s,$l,$e,$h,$z,$c
$l=($a^)-1
Dim $w[$l]
$c=@CRLF
$y=Split($y,$c)

;
; LOOP 1 - pass through data and record longest entry in each column
; We also construct table top/botton/heading template as we go
;
For Each $s in $y
$h=@
For $=0 to $l
$e=0^Split($s,"&")[$]
If $w[$]<$e $w[$]=$e EndIf
$h=Trim($h+" "+j($w[$],"<",@,"-"))
Next
Next

;
; LOOP 2 - Pass through data again, constructing table body
;
For Each $s in $y
$e=@
For $=0 to $l
$e=$e+" | "+j($w[$],SubStr($a,$+1,1),Split($s,"&")[$]," ") ; Format data line
Next
$z=$z+"|"+SubStr($e,3)+" |"+$c
+IIf($z=@,"|-"+Join(Split($h),"-+-")+"-|"+$c,@) ; IIf() the table is empty then this is the header line
Next
; Add the header line to the top and bottom of the table
$h="@-"+Join(Split($h),"---")+"-@"
$CIF=$h+$c+$z+$h
EndFunction

; Justification UDF
; $w=Width
; $t=Justification type
; $s=String to justify
; $c=Fill character
;
Function j($w,$t,$s,$c)
Dim $,$x
If $t="=" $=$c EndIf ; Centre Justify, start on right
while ($s^)<$w
$s=Left($c,$t=">")+$j+$s+Left($c,$t="<")+$
$x=$ $=$j $j=$x ; Toggle centre justify RHS <-> LHS
Loop
$j=$s
EndFunction
;!
;!
; end KiXgolfUDF
; vim:filetype=kix sw=4 ts=4


Edited by Richard H. (2008-12-29 02:15 PM)

Top
#191471 - 2008-12-29 02:32 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Richard H.]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Hey Rich... just wanted to make sure you saw Drill's 549 of my code... I just posted the 562 because it made me feel better to know he could miss easy ones too.

Interesting... 4 players... mostly different approaches.

Top
#191478 - 2008-12-29 10:32 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Allen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, it's time for me to have something too...

benny's 645 down to 644:

 Code:
Function CIF($f, $)
  Dim $a,$b,$c,$d,$e[($f^)],$g,$h,$j,$k,$l,$m,$o,$p,$q,$s,$t,$u,$!
  $! = @CRLF
  $a = Split($, $!)
  $g = ($f ^) - 1
  For Each $b in $a
    $c = Split($b, '&')
    For $d = 0 to $g
      $e[$d] = IIf($e[$d] < ($c[$d]^), ($c[$d]^), $e[$d])
    Next
  Next
  For $d = 0 to $g
    $o = $o + $e[$d]
  Next
  $s = 1
  For Each $b in $a
    $c = Split($b, '&')
    For $d = 0 to $g
      $h = SubStr($f,$d+1,1)
      $u = $c[$d]
      $j = $e[$d] - ($u^)
      For $q = 1 to $e[$d] +2
        $p = $p + '-'
      Next
      If $s
        $p = $p + '+'
      EndIf
      For $k = 1 to $j /2
        $l = $l + ' '
      Next
      $m = IIf($j mod 2,' ','')
      $t = Join(Split($t+'| '+IIf($h<>'=',IIf($h='<',$u+$l+$l+$m,$l+$l+$m+$u),$l+$u+$l+$m)+' |','||'),'|')
      $l = ''
    Next
    $t = $t + $! + IIf($s,'|' + Left($p, ~) + '|' + $!,'')
    $s = 0
  Next
  For $k = 1 to $o+3*($f^)-1
    $l = $l + '-'
;  Next
  $CIF = '@' + $l + '@' + $! + $t + '@' + $l + '@'
EndFunction
_________________________
!

download KiXnet

Top
#191479 - 2008-12-29 10:40 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
again, on benny's code:
 Quote:

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_if.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium Model 15
Speed = 2131 MHz
Memory = 1526 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Instruens Fabulam
Processing Start = 2008/12/29 23:39:55.500
Processing End = 2008/12/29 23:39:55.515
Duration = 0000/00/00 00:00:00.014
KiXGolf Score = 635


 Code:
Function CIF($f, $)
  Dim $b,$c,$d,$e[($f^)],$g,$h,$j,$k,$l,$o,$p,$q,$s,$t,$u,$!
  $! = @CRLF
  $ = Split($, $!)
  $g = ($f ^) - 1
  For Each $b in $
    $c = Split($b, '&')
    For $d = 0 to $g
      $e[$d] = IIf($e[$d] < ($c[$d]^), ($c[$d]^), $e[$d])
    Next
  Next
  For $d = 0 to $g
    $o = $o + $e[$d]
  Next
  $s = 1
  For Each $b in $
    For $d = 0 to $g
      $c = Split($b, '&')
      $h = SubStr($f,$d+1,1)
      $u = $c[$d]
      $j = $e[$d] - ($u^)
      For $q = 1 to $e[$d] +2
        $p = $p + '-'
      Next
      If $s
        $p = $p + '+'
      EndIf
      For $k = 1 to $j /2
        $l = $l + ' '
      Next
      $c = IIf($j mod 2,' ','')
      $t = Join(Split($t+'| '+IIf($h<>'=',IIf($h='<',$u+$l+$l+$c,$l+$l+$c+$u),$l+$u+$l+$c)+' |','||'),'|')
      $l = ''
    Next
    $t = $t + $! + IIf($s,'|' + Left($p, ~) + '|' + $!,'')
    $s = 0
  Next
  For $k = 1 to $o+3*($f^)-1
    $l = $l + '-'
;  Next
  $CIF = '@' + $l + '@' + $! + $t + '@' + $l + '@'
EndFunction
_________________________
!

download KiXnet

Top
#191480 - 2008-12-29 10:43 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
KiXGolf Score = 628
on Benny's code:
 Code:
Function CIF($f, $)
  Dim $b,$c,$d,$e[($f^)],$g,$h,$j,$k,$l,$o,$p,$q,$s,$t,$u,$!
  $! = @CRLF
  $ = Split($, $!)
  $g = ($f ^) - 1
  For Each $b in $
    $c = Split($b, '&')
    For $d = 0 to $g
	  if $e[$d] < ($c[$d]^)
      $e[$d] = $c[$d]^0
	  endif
    Next
  Next
  For $d = 0 to $g
    $o = $o + $e[$d]
  Next
  $s = 1
  For Each $b in $
    For $d = 0 to $g
      $c = Split($b, '&')
      $h = SubStr($f,$d+1,1)
      $u = $c[$d]
      $j = $e[$d] - ($u^)
      For $q = 1 to $e[$d] +2
        $p = $p + '-'
      Next
      If $s
        $p = $p + '+'
      EndIf
      For $k = 1 to $j /2
        $l = $l + ' '
      Next
      $c = IIf($j mod 2,' ','')
      $t = Join(Split($t+'| '+IIf($h<>'=',IIf($h='<',$u+$l+$l+$c,$l+$l+$c+$u),$l+$u+$l+$c)+' |','||'),'|')
      $l = ''
    Next
    $t = $t + $! + IIf($s,'|' + Left($p, ~) + '|' + $!,'')
    $s = 0
  Next
  For $k = 1 to $o+3*($f^)-1
    $l = $l + '-'
;  Next
  $CIF = '@' + $l + '@' + $! + $t + '@' + $l + '@'
EndFunction
_________________________
!

download KiXnet

Top
#191481 - 2008-12-29 10:47 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
619 on Benny's code:

 Code:
Function CIF($f, $)
  Dim $b,$d,$e[($f^)],$g,$h,$j,$k,$l,$o,$p,$q,$s,$t,$u,$!
  $! = @CRLF
  $ = Split($, $!)
  $g = ($f ^) - 1
  For Each $b in $
    $b = Split($b, '&')
    For $d = 0 to $g
	  if $e[$d] < ($b[$d]^)
      $e[$d] = $b[$d]^0
	  endif
    Next
  Next
  For $d = 0 to $g
    $o = $o + $e[$d]
  Next
  $s = 1
  For Each $b in $
    For $d = 0 to $g
      $ = Split($b, '&')
      $h = SubStr($f,$d+1,1)
      $u = $[$d]
      $j = $e[$d] - ($u^)
      For $q = 1 to $e[$d] +2
        $p = $p + '-'
      Next
      If $s
        $p = $p + '+'
      EndIf
      For $k = 1 to $j /2
        $l = $l + ' '
      Next
      $ = IIf($j mod 2,' ','')
      $t = Join(Split($t+'| '+IIf($h<>'=',IIf($h='<',$u+$l+$l+$,$l+$l+$+$u),$l+$u+$l+$)+' |','||'),'|')
      $l = ''
    Next
    $t = $t + $! + IIf($s,'|' + Left($p, ~) + '|' + $!,'')
    $s = 0
  Next
  For $k = 1 to $o+3*($f^)-1
    $l = $l + '-'
;  Next
  $CIF = '@' + $l + '@' + $! + $t + '@' + $l + '@'
EndFunction
_________________________
!

download KiXnet

Top
#191482 - 2008-12-29 10:49 PM Re: KiXgolf: Instruens Fabulam - public round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
616:
 Code:
Function CIF($f, $)
  Dim $b,$d,$e[($f^)],$g,$h,$j,$k,$l,$o,$p,$s,$t,$u,$!
  $! = @CRLF
  $ = Split($, $!)
  $g = ($f ^) - 1
  For Each $b in $
    $b = Split($b, '&')
    For $d = 0 to $g
	  if $e[$d] < ($b[$d]^)
      $e[$d] = $b[$d]^0
	  endif
    Next
  Next
  For $d = 0 to $g
    $o = $o + $e[$d]
  Next
  $s = 1
  For Each $b in $
    For $d = 0 to $g
      $ = Split($b, '&')
      $h = SubStr($f,$d+1,1)
      $u = $[$d]
      For $j = 1 to $e[$d] +2
        $p = $p + '-'
      Next
      $j = $e[$d] - ($u^)
      If $s
        $p = $p + '+'
      EndIf
      For $k = 1 to $j /2
        $l = $l + ' '
      Next
      $ = IIf($j mod 2,' ','')
      $t = Join(Split($t+'| '+IIf($h<>'=',IIf($h='<',$u+$l+$l+$,$l+$l+$+$u),$l+$u+$l+$)+' |','||'),'|')
      $l = ''
    Next
    $t = $t + $! + IIf($s,'|' + Left($p, ~) + '|' + $!,'')
    $s = 0
  Next
  For $k = 1 to $o+3*($f^)-1
    $l = $l + '-'
;  Next
  $CIF = '@' + $l + '@' + $! + $t + '@' + $l + '@'
EndFunction
_________________________
!

download KiXnet

Top
#191483 - 2008-12-30 12:12 AM Re: KiXgolf: Instruens Fabulam - public round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
richie boy...
no matter what postprepper you are using, please drop it.
ppl can't copy&paste your code to their favorite editor without losing format.
_________________________
!

download KiXnet

Top
Page 1 of 4 1234>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 718 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.041 seconds in which 0.013 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org