Page 1 of 2 12>
Topic Options
#191340 - 2008-12-20 01:57 PM KiXgolf - A Well-Formed Problem - Public Round
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
The public round for "KiXgolf - A Well-Formed Problem" is now open. The corresponding private round can be found at http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=191339&fpart=1
_________________________
There are two types of vessels, submarines and targets.

Top
#191344 - 2008-12-20 02:02 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Sealeopard]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
 Quote:

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_wfp.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 = A Well-Formed Problem
Processing Start = 2008/12/20 15:00:45.171
Processing End = 2008/12/20 15:00:45.390
Duration = 0000/00/00 00:00:00.218
KiXGolf Score = 639


 Code:
Function WFP($)
dim $e,$p,$s,$k,$i,$_
$k="well-formed"
$s="non "+$k
$wfp=$s

$ = open(1,".\"+$)
do
 $=readline(1)
 $_=$_+$
until @error
$=split($_,'<?xml version="1.0"?>')


if 1=ubound($)+close(1)
 $wfp=$k
 for each $ in split($[1],"<")
   $_=split(split($,">")[0])
   dim $a
   for $p=0 to ubound($_)
    $k=split($_[$p],'="')[0]
    for $i=1 to $k^0
     $=asc(ucase(substr($k,$i)))
     if 0=(($>64 & $<91) | ($>47 & $<58) | $=45 | 47=asc($k) | $p=0 & $i=($k^) & $=47) | instr($a,\+$k+\) | $p & 0=instr('/"',right($_[$p],1))
      $wfp=$s
     endif
    next
    if $p
     $a=$a+\+$k+\
    else
     $=$_[0]
     $i=47=asc($)
     if $
      $=\+substr($,1+$i)+\
      if right(join($_),1)<>"/" | $e=$ | $e=""
       $e=$e+$
       $k=split($e,$)
       if $i | $e=$+$
        $=$k[0]
        $e=$
        if 0= ($ | $i) * ($k[1] + ubound($k) = 2)
         $wfp=$s
EndFunction
_________________________
!

download KiXnet

Top
#191345 - 2008-12-20 02:04 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
about the possible issues with my code.
never did test it, but say you have too many quote-marks in the attribs...
_________________________
!

download KiXnet

Top
#191346 - 2008-12-20 02:05 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and for the another approach probably even drill took...
just a single loop that goes through all the text and just calculates the stuff.
could have been even easier to do with the latest test-set
_________________________
!

download KiXnet

Top
#191347 - 2008-12-20 02:29 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
I will admit, it's a bit sneaky but afaik it's within the rules \:\/

 Code:
; begin KiXgolfUDF
;
;!
Function WFP($t)
dim $, $c

$ = CreateObject('Microsoft.XMLDOM')
$.load($t)

$t = 'non '
$wfp = iif(val($.firstChild.nodetype) + $.parseError.errorCode<7,$t,'')+'well-formed'

For Each $ in $.getElementsByTagName('*')
	For Each $c in $.childnodes
		if $.tagname = $c.tagname
			$wfp=$t+$wfp
EndFunction
;!
;!
; end KiXgolfUDF



 Code:

KiXtart
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_wfp.KIX

Computer
OS               = Windows Vista Business Edition
CPU              = Intel Pentium Model 15
Speed            = 2194 MHz
Memory           = 2038 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = A Well-Formed Problem
Processing Start = 2008/12/20 14:26:43.200
Processing End   = 2008/12/20 14:26:43.501
Duration         = 0000/00/00 00:00:00.300
KiXGolf Score    = 261
 
Thank you for participating in KiXtart Golf!
_________________________
The Code is out there

Top
#191348 - 2008-12-20 03:06 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: DrillSergeant]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Not sneaky at all. The XML DOM is an integral part of an Internet Explorer installation, which is an integral part of a Microsoft Windows installation. Therefore, it is permitted to be utilized. I was actually hoping that somebody would go the Internet Explorer route as the files can be opened in IE and IE will return the correct validation results except in cases where it tests for the XML header line.
_________________________
There are two types of vessels, submarines and targets.

Top
#191349 - 2008-12-20 03:15 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Sealeopard]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Well, as you can see I do three checks:

$.parseError.errorCode (this should be 0 if there are no XML errors, which takes care of most of the cases)

val($.firstChild.nodetype) (this should be 7 if the first node is a valid identifier)

The for-each loops check for the node-in-node case (this is apperantly not invalid in XML or else it would have been caught at the first check)

I feel bad for the others who slaved away at a full text parser and all I did was a simple COM call... I hope you guys don't hate me now?
_________________________
The Code is out there

Top
#191350 - 2008-12-20 03:51 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: DrillSergeant]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol.
not at all.
_________________________
!

download KiXnet

Top
#191351 - 2008-12-20 06:31 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
And here is my code that I did not get finished. I had though about using a COM call, but was unsure where to look and never followed through with the thought.
 Code:
; begin KiXgolfUDF
;
;!
Function WFP($w)

Dim $L,$I[0],$C,$T,$Y[],$Z,$,$U[]

$wfp = "well-formed"
Open(6,$w)  
$L = Readline(6)

While @Error = 0
	$I[$C] = $L
	$C = $C + 1
	Redim Preserve $I[$C]
	$L = Readline(6)
Loop
close(6)

If $I[0] <> '<?xml version="1.0"?>'
	$T = 1
EndIf

For $C = 1 to Ubound($I)

	For $ = 1 to $I[$c] + 1 ^ 0 
		If SubStr($I[$C],$,1) = "<"
			$L = $
			While Substr($I[$C],$,1) <> ">"
				$ = $ + 1
			Loop
			Redim Preserve $Y[$Z]
			$Y[$Z] = Substr($I[$C],$L,($ +1) - $L)
			$Z = $Z + 1
		EndIf
	Next
Next

For $C = 0 to Ubound($Y)
	If left($Y[$C],2) <> "</" AND Left($Y[$C],2) <> 0
		$ = Left(Substr($Y[$C],2),-1) 
		$L = Ascan($Y,"</" + $ + ">",$C)
		If Ascan($Y,"<"+$+">",($C + 1)) < $L And Ascan($Y,"<"+$+">",($C + 1)) > -1
			$T = $T | 1
		EndIf

		If Instr($," ")
			If Instr($,"=") 
				$U = Split($,"=")
				If left($U[1],1) = CHR(34) AND INSTRREV($U[1],CHR(34)) > 1
					$ = Split($U[0])[0]
				Else
					$T = $T | 1	
				EndIf
			EndIf
		EndIf

		For $Z = 0 to Len($) -1
			Redim Preserve $U[$Z]
			$U[$Z] = Substr($,$Z +1,1)
		Next
		For each $L in $U
			$L = ASC($L)
			If $L > 44 AND $L < 58 OR $L > 64 AND $L < 91 OR $L > 96 and $L < 123
			Else
				$T = $T | 1
			EndIF
		Next

		$L = Ascan($Y,"</" + $ + ">",$C) 
		If $L > -1
			$y[$c] = 0
			$y[$L] = 0
		Else
			$L = Ascan($Y,"<" + Left($,-1) + "/>") 
			If $L > -1
				$y[$L] = 0
			Else
				$T = $T | 1
			EndIf
		EndIf

	EndIf
Next


If Instr(Join($y),"<")
	$T = $T | 1
EndIf

If $T <> 0
 $wFP = "non " + $wFP

EndFunction
;!
;!
; end KiXgolfUDF


Edited by Gargoyle (2008-12-20 06:34 PM)
Edit Reason: didn't like the html post
_________________________
Today is the tomorrow you worried about yesterday.

Top
#191352 - 2008-12-21 12:42 AM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Gargoyle]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
gargoyle, did it really open like that?
every time I tried on my machine, if I didn't include the ".\" it failed to open.
wtf.
_________________________
!

download KiXnet

Top
#191353 - 2008-12-21 01:12 AM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
How was your directory structure set up?

I have mine as

 Code:

K:
|-Scripts
  |-Golf
    |-WFP



My Kix32.EXE is in the Scripts directory but I would run the script from the wfp

K:\Scripts\Golf\WFP\>K:\Scripts\Kix32.EXE kixgolf_wfp.kix
_________________________
Today is the tomorrow you worried about yesterday.

Top
#191355 - 2008-12-21 09:12 AM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Gargoyle]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, mine was:
e:\documents and settings\Jooje\desktop\kixgolf\wfp

hmm...
anyhow, if there is a irregularities in the way kixtart handles different types of path with curdir, is there room for the big buggie boo word?
_________________________
!

download KiXnet

Top
#191360 - 2008-12-21 05:27 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Here is my fully bloated code. This has my thought process in it and the debugging that I was doing. For those that want to tell me how I could have approached different challenges I am welcome to comments.

 Code:
; begin KiXgolfUDF
;
;!
Function WFP($)

Dim $LineIn,$InitialArray[0],$Counter,$TestResult,$TempArray[0],$Counter2,$Temp,$Temp2,$Tag,$Temp3[],$Start,$Letter,$Match
$Counter = 0
$Counter2 = 0

;Start by Breaking up the Initial File into an array to manage the contents
Open(1,$)
;;======Debug Here=========

Open (2,"ArrayOutput.txt",5)
WriteLine(2,"File Name = " + $ + @CRLF)

;;

  
$LineIn = Readline(1)

While @Error = 0
	$InitialArray[$Counter] = Trim($LineIn)
	$Counter = $Counter + 1
	Redim Preserve $InitialArray[$counter]
	$LineIn = Readline(1)
Loop

Close(1)

;;;===========Debug Here ===============
;For $counter = 0 to Ubound($InitialArray)
;
;	Writeline(2, "Element " + $counter + " = " + $InitialArray[$Counter] + @CRLF)
;
;Next
;;;

;Look to see if the version tag is there
If $InitialArray[0] = '<?xml version="1.0"?>'
	$TestResult = 0
Else
	$TestResult = 1
EndIf

$InitialArray[0] = "" ;Clear the data so we can safely ignore it later

;;==============Debug Here ===============

Writeline(2, "Version tag test = " + $Testresult + @CRLF)

;;

;Parse out the Open and Close Tags
;Look at the Input string from the initial array and find the first <

For $Counter = 1 to Ubound($InitialArray)

;break out the string to look for multiple tags on a single line

	For $Temp = 1 to Len($InitialArray[$Counter])
		If SubStr($InitialArray[$counter],$Temp,1) = "<"
			$Start = $Temp
			While Substr($InitialArray[$Counter],$Temp,1) <> ">"
				$Temp = $Temp + 1
			Loop
			Redim Preserve $TempArray[$Counter2]
			$TempArray[$Counter2] = Substr($InitialArray[$Counter],$Start,($Temp +1) - $Start)
			$Counter2 = $Counter2 + 1
		EndIf
	Next
Next



;;Debug Code
For $counter = 0 to Ubound($TempArray)

	Writeline(2, "Element " + $counter + " = " + $TempArray[$Counter] + @CRLF)

Next





;Are there matching open and close tags
For $Counter = 0 to Ubound($TempArray)
  ;Find an Open Tag
	If left($TempArray[$Counter],2) <> "</" AND left($TempArray[$Counter],2) <> 0
		;Now we validate all the different conditions
		;To Get it working in the most basic form
		$Temp = Left(Substr($TempArray[$Counter],2),-1) ;This will give us the non tag characters to use for comparison
		WriteLine(2,"Line that we are checking = " + $Temp +@CRLF) ;Debugging


		;Check for same name tags within each other
		$Temp2 = Ascan($Temparray,"</" + $Temp + ">",$Counter)
		WriteLine(2,"value of tag in a tag = " +$Temp2+@crlf) ; debuggin
		If Ascan($Temparray,"<"+$Temp+">",($counter + 1)) < $Temp2 And Ascan($Temparray,"<"+$Temp+">",($counter + 1)) > -1
			$Tag = Ascan($Temparray,"<"+$Temp+">",($counter + 1)) 
			WriteLine(2,"We found a value of "+$Tag+" less than the next close"+@crlf) ;debuggin
			$TestResult = $TestResult | 1
		EndIf

		;Now we have to test to see if this is an attibute
		If Instr($Temp," ") 
			If Instr($Temp,"=")
				$Temp3 = Split($Temp,"=")
				Writeline(2,"This is an Attribute, The Value after the = is " +$Temp3[1] +@CRLF) ;Debuggin
				;Writeline(2,"This is the first value we are checking " + left($Temp3[1],1) + "and this is the second value " + Right($Temp3[1],1) + @CRLF) ; Debuggin
				Writeline(2,"This is the first value we are checking " + left($Temp3[1],1) + "and this is the second value " + InstrRev($Temp3[1],CHR(34)) + @CRLF) 
				;If left($Temp3[1],1) = CHR(34) and Right($Temp3[1],1) = CHR(34)

;;;This is the new LINE to be PUT into the stipped code
				If Left($Temp3[1],1) = CHR(34) and InstrRev($Temp3[1],CHR(34)) > 1



					WriteLine(2,"The attribute test Passed" + @CRLF) ;Debuggin
					;Have to rewrite the value of $Temp to remove attibute fields
					$Temp = Split($Temp3[0])[0]
					Writeline(2,"New value of $Temp = " + $Temp + @CRLF)
					$TestResult = $TestResult | 0
				Else
					$TestResult = $TestResult | 1	
				EndIf
			EndIf
		EndIf

		;Check for invalid characters in the string
		For $Counter2 = 0 to Len($Temp) -1
			Redim Preserve $Temp3[$Counter2]
			$Temp3[$Counter2] = Substr($Temp,$Counter2 +1,1)
		Next
		For each $Letter in $Temp3
			Select
				Case asc($Letter) = 45
					Writeline(2,"Valid Character of " +$Letter+@CRLF); debuggin
				Case asc($Letter) > 46 AND asc($letter) < 58
					Writeline(2,"Valid Character of " +$Letter+@CRLF); debuggin
				Case asc($letter) > 64 AND asc($letter) < 91
					Writeline(2,"Valid Character of " +$Letter+@CRLF); debuggin
				Case asc($letter) > 96 and asc($letter) < 123
					Writeline(2,"Valid Character of " +$Letter+@CRLF); debuggin
				Case asc($letter) = 32
				Case 1
					Writeline(2,"inValid Character of " +$Letter+@CRLF); debuggin
					$TestResult = $TestResult | 1
			EndSelect
		Next

		;Finally is there corresponding open and close tags
		$Temp2 = Ascan($TempArray,"</"+ $Temp + ">",$Counter)
		If $Temp2 > -1 
			$TempArray[$Counter] = 0
			WriteLine(2,"Found a proper Close tag.  Clearing the element: "+$counter+@CRLF)
			$TempArray[$Temp2] = 0
			WriteLine(2,"And The closing tag is element: "+$Temp2+@CRLF)
		Else
			$Temp2 = Ascan($TempArray,"<" + Left($Temp,-1) + "/>") 
			If $Temp2 > -1
				$TempArray[$Temp2] = 0
				Writeline(2,"Found the 'orders/' tag.  Clearing element: "+$Temp2+@CRLF)
			Else
				$TestResult = $TestResult | 1
				Writeline(2,"Failue on open and close tags"+@CRLF)
			EndIf
		EndIf

			

;		If Ascan($TempArray,"</" + $Temp + ">",$Counter) > -1 OR Ascan($TempArray,"<" + Left($Temp,-1) + "/>") > -1	
;			
;			$TestResult = $TestResult | 0
;		Else 
;			$TestResult = $Testresult | 1
;		EndIf

	EndIf
	


Next
	If Instr(Join($TempArray),"<")
		$TestResult = $TestResult | 1
	EndIf
	Writeline(2,Join($TempArray)+@CRLF)
If $TestResult = 0
 $WFP = "well-formed"
Else
 $WFP = "non well-formed"
EndIf

;;================= Debug Here ==============
Close(2)
;;


EndFunction
;!
;!
; end KiXgolfUDF
_________________________
Today is the tomorrow you worried about yesterday.

Top
#191362 - 2008-12-21 11:44 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Gargoyle]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
looking at drills code.
I got a return of:
 Code:
Running Test 01...-1Done
Running Test 02...-1Done
Running Test 03...-1Done
Running Test 04...0Done
Running Test 05...0Done
Running Test 06...0Done
Running Test 07...-1Done
Running Test 08...0Done
Running Test 09...0Done
Running Test 10...-1Done
Running Test 11...0Done
Running Test 12...0Done
Running Test 13...0Done
Running Test 14...-1Done
Running Test 15...0Done
Running Test 16...0Done
Running Test 17...-1Done
Running Test 18...-1Done
Running Test 19...0Done
Running Test 20...-1Done
Running Test 21...-1Done
Your solution passed all tests

KiXtart
KiXtart Version  = 4.53
KiXGolf Script   = kixgolf_wfp.kix

Computer
OS               = Windows XP Professional
CPU              = AMD Turion(tm) 64 X2 Mobile Technology TL-64
Speed            = 2194 MHz
Memory           = 1920 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = A Well-Formed Problem
Processing Start = 2008/12/22 00:39:34.343
Processing End   = 2008/12/22 00:39:34.546
Duration         = 0000/00/00 00:00:00.202
KiXGolf Score    = 261

Thank you for participating in KiXtart Golf!


this was not accepted, at least in the early days.
the UDF has to be self-containing and shall not "speak out"

changing:
$.load($t)

to:
$c = $.load($t)

fixes this issue, leaving the score at 264
_________________________
!

download KiXnet

Top
#191363 - 2008-12-21 11:49 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and here is the new leader:
260.

 Code:
Function WFP($c)
dim $

$ = CreateObject('Microsoft.XMLDOM')
$c = $.load($c)

$wfp = iif(val($.firstChild.nodetype) + $.parseError.errorCode<7,'non ','')+'well-formed'

For Each $ in $.getElementsByTagName('*')
	For Each $c in $.childnodes
		if $.tagname = $c.tagname
			$wfp='non '+$wfp
EndFunction


 Quote:

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_wfp.kix

Computer
OS = Windows XP Professional
CPU = AMD Turion(tm) 64 X2 Mobile Technology TL-64
Speed = 2194 MHz
Memory = 1920 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = A Well-Formed Problem
Processing Start = 2008/12/22 00:47:14.703
Processing End = 2008/12/22 00:47:14.875
Duration = 0000/00/00 00:00:00.172
KiXGolf Score = 260
_________________________
!

download KiXnet

Top
#191364 - 2008-12-21 11:56 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
 Quote:

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_wfp.kix

Computer
OS = Windows XP Professional
CPU = AMD Turion(tm) 64 X2 Mobile Technology TL-64
Speed = 2194 MHz
Memory = 1920 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = A Well-Formed Problem
Processing Start = 2008/12/22 00:54:14.843
Processing End = 2008/12/22 00:54:15.015
Duration = 0000/00/00 00:00:00.172
KiXGolf Score = 259

 Code:
Function WFP($c)
dim $

$ = CreateObject('Microsoft.XMLDOM')
$c = $.load($c)

$wfp = iif(val($.firstChild.nodetype) + $.parseError.errorCode<7,'non w',w)+'ell-formed'

For Each $ in $.getElementsByTagName('*')
	For Each $c in $.childnodes
		if $.tagname = $c.tagname
			$wfp='non '+$wfp
EndFunction
_________________________
!

download KiXnet

Top
#191365 - 2008-12-22 12:01 AM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
 Quote:

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_wfp.kix

Computer
OS = Windows XP Professional
CPU = AMD Turion(tm) 64 X2 Mobile Technology TL-64
Speed = 2194 MHz
Memory = 1920 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = A Well-Formed Problem
Processing Start = 2008/12/22 00:58:32.296
Processing End = 2008/12/22 00:58:32.468
Duration = 0000/00/00 00:00:00.172
KiXGolf Score = 257

 Code:
Function WFP($c)
dim $

$ = CreateObject(Microsoft.XMLDOM)
$c = $.load($c)

$wfp = iif(val($.firstChild.nodetype) + $.parseError.errorCode<7,'non w',w)+'ell-formed'

For Each $ in $.getElementsByTagName('*')
	For Each $c in $.childnodes
		if $.tagname = $c.tagname
			$wfp='non '+$wfp
EndFunction
_________________________
!

download KiXnet

Top
#191366 - 2008-12-22 12:08 AM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, I take it back.
current rules don't care about extra output to the console.

thus:
 Quote:

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_wfp.kix

Computer
OS = Windows XP Professional
CPU = AMD Turion(tm) 64 X2 Mobile Technology TL-64
Speed = 2194 MHz
Memory = 1920 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = A Well-Formed Problem
Processing Start = 2008/12/22 01:06:18.609
Processing End = 2008/12/22 01:06:18.781
Duration = 0000/00/00 00:00:00.172
KiXGolf Score = 254

Thank you for participating in KiXtart Golf!


 Code:
Function WFP($c)
dim $

$ = CreateObject(Microsoft.XMLDOM)
$.load($c)

$wfp = iif(val($.firstChild.nodetype) + $.parseError.errorCode<7,'non w',w)+'ell-formed'

For Each $ in $.getElementsByTagName('*')
	For Each $c in $.childnodes
		if $.tagname = $c.tagname
			$wfp='non '+$wfp
EndFunction
_________________________
!

download KiXnet

Top
#191367 - 2008-12-22 12:20 AM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
And then, lets shorten little bit more.

 Quote:

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_wfp.kix

Computer
OS = Windows XP Professional
CPU = AMD Turion(tm) 64 X2 Mobile Technology TL-64
Speed = 2194 MHz
Memory = 1920 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = A Well-Formed Problem
Processing Start = 2008/12/22 01:17:52.593
Processing End = 2008/12/22 01:17:52.765
Duration = 0000/00/00 00:00:00.172
KiXGolf Score = 232

Thank you for participating in KiXtart Golf!


 Code:
Function WFP($c)
dim $

$ = CreateObject(Microsoft.XMLDOM)

$wfp = iif(6 = $.load($c) + val($.firstChild.nodetype),w,'non w')+'ell-formed'

For Each $ in $.getElementsByTagName('*')
	For Each $c in $.childnodes
		if $.tagname = $c.tagname
			$wfp='non '+$wfp
EndFunction
_________________________
!

download KiXnet

Top
#191379 - 2008-12-22 03:34 PM Re: KiXgolf - A Well-Formed Problem - Public Round [Re: Lonkero]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
230
 Code:
Your solution passed all tests

KiXtart
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_wfp.kix

Computer
OS               = Windows Vista Business Edition
CPU              =               Intel(R) Pentium(R) D CPU 3.20GHz
Speed            = 3200 MHz
Memory           = 2046 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = A Well-Formed Problem
Processing Start = 2008/12/22 08:33:06.788
Processing End   = 2008/12/22 08:33:06.929
Duration         = 0000/00/00 00:00:00.140
KiXGolf Score    = 230

Thank you for participating in KiXtart Golf!
Press any key to continue...

 Code:
Function WFP($c)
Dim $

$ = CreateObject(Microsoft.XMLDOM)

  $wfp = IIf($.load($c) + Val($.firstChild.nodetype), w, 'non w') + 'ell-formed'
For Each $ in $.getElementsByTagName('*')
  For Each $c in $.childnodes
      If $ .tagname = $c.tagname
        $wfp = 'non ' + $wfp
      EndFunction
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
Page 1 of 2 12>


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

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

Generated in 0.077 seconds in which 0.025 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