Page 3 of 4 <1234>
Topic Options
#191143 - 2008-12-14 03:02 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Benny69]
RemcovC Offline
Starting to like KiXtart
*****

Registered: 2006-09-13
Posts: 174
Loc: Holland
lol benny... that's the same code as Lonk a few post ago ^^
_________________________
It's better to have scripted and died, then to never have scripted at all

Top
#191144 - 2008-12-14 03:05 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: RemcovC]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
LOL!
well I gave it a try \:\(
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#191145 - 2008-12-14 03:11 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Sealeopard]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Well, it breaks my coding heart, but if it's in the rules I can't really object to it.

I had this discussion with Remco during the private round. I feel the rules should define the functionality, and that the ini file is just a helpful tool to check your code.

Other coding contests also provide a set of test data but the code will be tested against many other cases before the code is approved.

I'm for a rule change (implemented whenever convenient) that just states that the code should follow the given rules and that the test-case is just a small subset of possibilities.

BUT, ehm... with the current rules that makes me the current leader with 189? ;\)
_________________________
The Code is out there

Top
#191146 - 2008-12-14 04:16 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Sealeopard]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mkay.
it's not really even a working code with the rules, but rules are rules.

hey benny, your last 199 is exactly my 199 half a day before.
could have saved you the trouble \:\)
_________________________
!

download KiXnet

Top
#191147 - 2008-12-14 04:20 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
damn, not used to these multi-page threads...

drill, I hear you.
the tests do define possible failure points, but they do not define perfect code.
but then, oh that poor bastard who works on his code for a week and gets smashed by the gang.
_________________________
!

download KiXnet

Top
#191149 - 2008-12-14 05:56 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Lonkero]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
We can implement the rule change for the next round, reflecting that the test cases can be expanded to test for proper implementation of code. I'll post a revised rule #32 tonight for review.
_________________________
There are two types of vessels, submarines and targets.

Top
#191178 - 2008-12-15 05:24 AM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Sealeopard]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I'n not sure about changing rule #32 (again). In the past we played rounds where I was allowed to have "secret" test cases to test the code against. However, we changed that and ultimately ended up with rule #32.

On the other hand, one should be able to add additional test cases that validate certain rules or assumptions to be made for the challenge. That would then change the rule to allow the addition of new test cases, maybe limited to prior of the final scoring of the private round. This would then prevent somebody from holding back new test cases in order to alter the results of the private round. Comments are welcome.
_________________________
There are two types of vessels, submarines and targets.

Top
#191181 - 2008-12-15 08:45 AM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Sealeopard]
RemcovC Offline
Starting to like KiXtart
*****

Registered: 2006-09-13
Posts: 174
Loc: Holland
I don't think the rule should change, we have the option to submit new testcases. Only because I started late, and didn't had much time, I didn't submitted the extra cases I made.

I really think that all of us should post new testcases as much as possible to avoid this.

You might add a rule stating that the public round (not private round) code must pass all possible testcases(even those who are not in the ini), in other words, the code must comply with the rules of the assignment and not with the ini.
_________________________
It's better to have scripted and died, then to never have scripted at all

Top
#191187 - 2008-12-15 02:32 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: RemcovC]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Can somebody please tell me what the code is that actually leads the scoring board?
I am quite a bit confused about that atm \:\)
_________________________



Top
#191232 - 2008-12-16 10:40 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Jochen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I think this one:
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=191135#Post191135
_________________________
!

download KiXnet

Top
#191234 - 2008-12-16 10:53 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
but then came lonkenizer...

 Quote:

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_edts.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 = Easier Done Than Said?
Processing Start = 2008/12/16 23:53:14.718
Processing End = 2008/12/16 23:53:14.718
Duration = 0000/00/00 00:00:00.000
KiXGolf Score = 183


 Code:
Function EDTS($p)
  Dim $, $a[1], $i, $n, $o
    
  For $i = 1 to $p + 1 ^ 0
        
    $EDTS = '<' + $p + '> is ' + $n + acceptable.
        	
    $o = $
    $ = SubStr($p, $i, 1)
        
    $a[0=InStr(aeiou, $)]=$i
        
    If ($a[0] - $a[1]) /3 | ($p^)=2| $o = $ & $ > e
        $n = 'not '
EndFunction
_________________________
!

download KiXnet

Top
#191253 - 2008-12-17 08:40 AM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Lonkero]
RemcovC Offline
Starting to like KiXtart
*****

Registered: 2006-09-13
Posts: 174
Loc: Holland
First I'm not posting this to get first place in this round, I don't even want this code to be taken in cosideration as serious code. The reason I post this is because I think the rules are not full proof, and should be adjusted slightly. I think there should be a rule like this:

- Code posted in the public round (also the code to validate the private round) should be conform stated rules in the assignment. The test cases provided in the package are a tool to help you achieve this goal but are not final.

This will exclude code like in the previous posts, and code like this. And please don't go golfing this code, I only posted it to make a statement.

Again just to make myself clear I don't want this code to count in the tournament. I really feel like this is cheating in the worst way possible.

 Code:
KiXtart Golf Score
Tournament       = Easier Done Than Said?
Processing Start = 2008/12/17 08:37:12.598
Processing End   = 2008/12/17 08:37:12.623
Duration         = 0000/00/00 00:00:00.024
KiXGolf Score    = 108


 Code:
Function EDTS($)
    $EDTS = '<' + $ + '> is ' + IIf((instr(aeh,Left($,1))&left($,2))<>ab,a,'not a') + cceptable.
EndFunction
_________________________
It's better to have scripted and died, then to never have scripted at all

Top
#191255 - 2008-12-17 09:10 AM Re: KiXgolf - Easier Done Than Said - Public Round [Re: RemcovC]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
I see it similar.
The rules should be considered validating a code, not the test cases!

Jooel, please post a 196 score code with this line:

 Code:
if ($a[0] - $a[1]) /3 | $i - $a[0] = ($p^) | $o = $ & $ <> e & $ <> o


I won't, because it feels like stealing to me ;\)
_________________________



Top
#191256 - 2008-12-17 11:06 AM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Jochen]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
I'm with Remco and Jochen on this one. I don't want my 189 to be an official score either, it was just a statement.

But, either way, that array thingy is a thing of beauty. My hat is off to you, Jooel!
_________________________
The Code is out there

Top
#191259 - 2008-12-17 12:46 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Lonkero]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
I couldn't figure out how to get my code into the scoring engine. I shoved it into the UDF where I was told, but got an immediate illegal (or undeclared?) $p. I then put in code to read the test ini file. That wound up running it 12*12 times. \:\) After looking at everyone else's code, I can see where I messed up. I'll try to fix it this evening and see how bad I was. \:\)
Top
#191289 - 2008-12-17 11:29 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: BradV]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
nice, new blood.

jochen&drill, don't matter who posts 196 with that.
I think Jens made it clear, that at least on this round, the rules are as they are.

and thanks, I thought it was a lucky last minute find :p
there might be some more old kixgolf tricks to be used here too, if someone just has the time to dig...
_________________________
!

download KiXnet

Top
#191296 - 2008-12-18 04:28 AM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Lonkero]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Brad:

Welcome to KiXgolf. It's actually quite easy to participate. Once you download the package and unzip it into a directory all yu have to do is put the code into the kixgolf_edts.udf file and call the kixgolf_edts.kix script, e.g. via "KIX32 kixgolf_edts" from the command line. The code itself goes inside the FUNCTION and ENDFUNCTION line. Your error most likely comes fro you not explicitly declaring variables via DIM inside the UDF. We are using some restrictive SETOPTION settings for the KiXgolf rounds.

You cna always take one of the posted codes and put them into the UDF to get a feel for the way the KiXgolf packages work.
_________________________
There are two types of vessels, submarines and targets.

Top
#191302 - 2008-12-18 01:02 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: Sealeopard]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
No, my problem was I wrote a separate piece of code that took input from the keyboard. Then, when I found out I was supposed to put it in the udf file, I couldn't figure out how I was supposed to get the password. I last attempt was opening the ini file and reiterating through it. That didn't work. When the public round started, I saw that I just needed to accept it as input to my function. \:\)
Top
#191314 - 2008-12-18 10:44 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: BradV]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
I'm missing something. When I run my code by itself and manually input passwords, it works as expected. When I put it in the UDF, the output looks fine to me, but it says I've failed all 12 tests. What am I missing?

Score here:
 Code:

KiXtart
KiXtart Version  = 4.52
KiXGolf Script   = kixgolf_edts.kix

Computer
OS               = Windows XP Media Center Edition
CPU              =               Intel(R) Pentium(R) 4 CPU 3.00GHz
Speed            = 3000 MHz
Memory           = 1016 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Easier Done Than Said?
Processing Start = 2008/12/18 16:29:53.905
Processing End   = 2008/12/18 16:29:53.921
Duration         = 0000/00/00 00:00:00.016
KiXGolf Score    = 489
 
Thank you for participating in KiXtart Golf!


 Code:
; begin KiXgolfUDF
;
;!
Function EDTS($p)
   dim $l,$u,$o,$c,$t,$k,$a,$i,$n,$b
   ;gets $p
	;$p = input password
   ;$l = length of input password
	;$u = previous character
	;$c = current character
	;$t = character type (of last character), vowel, consonants, or other (v,c,o)
	;$k = boolean if password is OK.  Assume true to start.
	;$a = boolean if found at least one vowel.  Assume false to start.
	;$o = count of consecutive vowels
	;$b = count of consecutive consonants
	;$i = loop iteration variable
	;$n = "not" variable
   $l=len($p)
   $u=""
   $o=0
   $b=0
   $t=""
   $k=1
   $a=0
   for $i = 1 to $l												; iterate through all characters
      $c=substr($p,$i,1)										; pick the ith character
   	if instr("aeiou",$c)										; is the character a vowel?
	      $b = 0													; since this is a vowel, consecutive consonants is now 0
	      $a=1														; found a vowel.  set $a true
   		if $c = $u												; is this character the same as the last character?
	   	   if not ($o = 0 and instr("eo",$c))			; only allow "ee" and "oo"
		   	   $k = 0											; it's not.  So, fail the word
			   endif
   		endif
	   	if $t = "v"												; was the last character a vowel?
		      if $o = 0											; is the consecutive vowel count 0?
			      $o = 1											; if so, increment it
   			else
	   		   if $o > 0										; had too many consecutive vowels
		   	      $k = 0										; fail this password
			   		$o = 5										; set consecutive vowel count to some large number
				   endif
   			endif
	   	else
		      $o = 0												; last character was not a vowel.  Set consecutive vowel count to 0
   		endif
	      $t = "v"													; set last character to a vowel (this character for next loop)
   	else
	      if instr("bcdfghjklmnpqrstvwxyz",$c)			; not a vowel, is it a consonant?
		      $o = 0												; is a consonant.  Therefore the consecutive vowel count is 0
		      if $c = $u											; is this character the same as the last character?
			      $k = 0											; if so, fail this password
   			endif
	   	   if $t = "c"											; was the last character a consonant?
  		   	   if $b = 0										; is the consecutive consonant count 0?
   		   		$b = 1										; if so, increment it
	   		   else
   		   	   if $b > 0									; had too many consecutive consonants
	   		   	   $k = 0									; fail the password
		   		   	$b = 5									; set consecutive consonant count to some large number
  			   		endif
   			   endif
   			else
	   		   $b = 0											; last character was not a consonant.  Set the consecutive consonant count to 0
		   	endif
		      $t = "c"												; set last character to a consonant (this character for next loop)
   		else
            $k=0													; found a character other than a letter.  Fail this password
		   	$t = ""												; set the last type to other
         endif
      endif
   	$u = $c														; make the next last character this character
   next	
   if $a = 1 and $k = 1											; if we found a vowel and did not change OK to false
	   $n = ""														; ok
   else
	   $n = " not"													; failed
   endif
   ? "<" + $p + "> is" + $n +" acceptable."
endFunction
;!
; end KiXgolfUDF


Obviously not golfed, but not sure why it tells me I failed.

Regards,

Brad

Top
#191316 - 2008-12-18 11:36 PM Re: KiXgolf - Easier Done Than Said - Public Round [Re: BradV]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you need to set $EDTS

that's how UDF works and that's the return value, which is tested.
_________________________
!

download KiXnet

Top
Page 3 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 530 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.098 seconds in which 0.062 seconds were spent on a total of 14 queries. Zlib compression enabled.

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