Page 3 of 11 <12345>Last »
Topic Options
#164821 - 2006-07-23 05:25 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
And here are the current standing of the public pase, not much has happened, though Shawn was able to improve his own code a bit. Benny69 moved up to 4th place due to his improvements to DrillSergeant's code. Sounds like the hunt is on to improve Shawn's code.
Code:

Jooel --------- 182
1. Shawn --------- 182 (Shawn-185 was reduced by 3 strokes)
2. Shawn --------- 185 (confirmed)
3. Shawn --------- 213 (confirmed)
4. Benny69 ------- 216 (DrillSergeant-217 was reduced by 1 stroke)
5. DrillSergeant - 217
Jooel --------- 219
6. Maciep -------- 225 (confirmed)
7. Allen --------- 225 (Allen-256 was reduced by 21 strokes)
8. Richard H ----- 252 (confirmed)
9. Allen --------- 256 (confirmed)
10. Howard bullock 285 (confirmed)
11. Glenn Barnas -- 337 (confirmed)
It_took_my_meds 343 (does not pass validation due to not DIMming variables inside the UDF)
12. Jochen -------- 352 (confirmed)
13. Benny69-------- 448 (confirmed)
14. Krabourn ------ 651 (confirmed)

_________________________
There are two types of vessels, submarines and targets.

Top
#164822 - 2006-07-23 09:29 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Quote:

Cappy, that $ = right($,~) thing ... had to actually run it to figure it out. Its a shorter form of $ = right($,-1). Seems like this:

$ = right("cappy",~)

would return "appy"

That is brilliant.




Yes, brilliant. I havn't run it, but still, after you pointed it out, how could one possibly figure that out without having the kixtart source code?
Rogier, what the green heck did you do to find that one, asked Ruud??


Well, my deep respect to all of you.
I started thinking of reducing the mayan string array thing last week, but that was only wishful thinking for me
_________________________



Top
#164823 - 2006-07-23 11:03 AM Re: KiXgolf: Mayan Number Converter - Public Phase
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
From the manual.

Code:
~ Performs a bit-wise mathematical negation (NOT) operation on a number. 


Top
#164824 - 2006-07-23 11:22 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
which is ... ehhh .... ~ nothing, or ~ 0, resulting in -1

BRILLIANT !!!

[I for one keep forgetting that ~ is an operator in the mean time ]


Edited by Jochen (2006-07-23 01:21 PM)
_________________________



Top
#164825 - 2006-07-23 11:33 AM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
KiXGolf Score = 178

Code:

Function m($)

dim $a,$b,$c

for $b = 1 to 15
$c = split("- . : .: :: | " + $a)
$a = $a + $c[$b] + "| "
next

for each $a in split($)
$m = $m * 20 + ascan($c,$a)
if $+0=$
$m = $c[$ mod 20]
if $/20
$m = m($/20) + " " + $m
;endif
;endif
;next

EndFunction


Top
#164826 - 2006-07-23 01:22 PM Re: KiXgolf: Mayan Number Converter - Public Phase
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Oh boy,
what a codes you guys came up with. Really SUPERB.

Shawn,
nice trick saving 4 strokes...

Top
#164827 - 2006-07-23 01:44 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Thanks Patrick - there's more there to shave - for anyone that wants to re-arrange the code. Can feel it in me bones ;0)
Top
#164828 - 2006-07-23 02:00 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Current public round ranking
Code:

1. Shawn --------- 178 (Shawn-182 was reduced by 4 strokes)
Jooel --------- 182
2. Shawn --------- 182 (Shawn-185 was reduced by 3 strokes)
3. Shawn --------- 185 (confirmed)
4. Shawn --------- 213 (confirmed)
5. Benny69 ------- 216 (DrillSergeant-217 was reduced by 1 stroke)
6. DrillSergeant - 217
Jooel --------- 219
7. Maciep -------- 225 (confirmed)
8. Allen --------- 225 (Allen-256 was reduced by 21 strokes)
9. Richard H ----- 252 (confirmed)
10. Allen --------- 256 (confirmed)
11. Howard bullock 285 (confirmed)
12. Glenn Barnas -- 337 (confirmed)
It_took_my_meds 343 (does not pass validation due to not DIMming variables inside the UDF)
13. Jochen -------- 352 (confirmed)
14. Benny69-------- 448 (confirmed)
15. Krabourn ------ 651 (confirmed)

_________________________
There are two types of vessels, submarines and targets.

Top
#164829 - 2006-07-23 02:28 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
KiXGolf Score = 177

Code:

Function m($)

dim $a,$b,$c

for $b = 1 to 15
$c = split("- . : .: :: | " + $a)
$a = $a + $c[$b] + "| "
next

for each $a in split($)
$m = $m * 20 + ascan($c,$a)
if $m<0
$m = $c[$ mod 20]
if $/20
$m = m($/20) + " " + $m
;endif
;endif
;next

EndFunction


Top
#164830 - 2006-07-23 02:55 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Jeez, what's next, 176.5?
_________________________
There are two types of vessels, submarines and targets.

Top
#164831 - 2006-07-23 05:01 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
rofl, maybe. Hey - were is Jooel's 182 code ? We should all start golfing that down - to shave much more than a few strokes here and there.
Top
#164832 - 2006-07-23 06:07 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sorry boys.
the bachelor party went on a bit longer than they normally do.
I'm not fit to code anything yet but let me find the codes for you...

the 182 code:
Code:

Function m($i)
dim $e, $, $n
if $i=0+$i
do
$ = $i mod 20
do
$n = 3*($>4) + ($>1) + ($>)
$e = substr('-.:__|',1+$n,1) + $e
$ = $ - $n
until $=0
$m = $e + $m
$e = " "
$i = $i/20
until $i=0
else
$m=-1
do $m=$m+1 until $i=m($m)
EndFunction



and the 219:
Code:

Function m($)
dim $e, $i, $n
if $=0+$
do
$i = $ mod 20
$m = split(" . : .: :: -")[iif($i=0,5,$i mod 5)] + left('|||',$i/5) + $e + $m
$e = ' '
$ = $/20
until $=0
else
$i=split($)
$=1
for $n=-ubound($i) to 0
for $e=0 to 19
if $i[-$n]=m($e)
$m = $m + $ * $e
$ = $ * 20
EndFunction



and shawn, no matter how much you protest, the rules are clear.
as long as the code executes in the alloted time, it is fine.
this is not the first golf round when these type of codes are used.
in fact, way back on one golf round the tests were altered by individuals
so these type of codes didn't suffer so much time penalty.

Top
#164833 - 2006-07-23 06:12 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and here is 176 code.
Code:

Function m($_)

dim $,$b,$c

for $b = 1 to 15
$c = split("- . : .: :: | " + $)
$ = $ + $c[$b] + "| "
next

for each $ in split($_)
$m = $m * 20 + ascan($c,$)
if $m<0
$m = $c[$_ mod 20]
if $_/20
$m = m($_/20) + " " + $m

EndFunction


Top
#164834 - 2006-07-23 06:48 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hmmmm, are we were allowed to change the names of the parameters ?

Anyway - heres the thing Jooel - by submitting this brute-force kinda code, your basically spoiling the spirit of these games. Now going-forward - in order for anyone to compete with you (me included) - we're going to have to start writing more of this silly stuff.

Do the Perl golf tournaments have this same problem ?

-Shawn

Top
#164835 - 2006-07-23 07:26 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Ok - here's some 173 code:

Code:

Function m($)

dim $a, $b, $c

for $b = 1 to 15
$c = split("- . : .: :: | " + $a)
$a = $a + $c[$b] + "| "
next

if $=0+$
$m = $c[$ mod 20]
if $/20
$m = m($/20) + " " + $m
endif
else
$m=-1
do $m=$m+1 until $=m($m)
EndFunction


Top
#164836 - 2006-07-23 07:52 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I'm posting this 173 on behalf of Rogier (DrillSergeant) ...

Code:

;!
Function m($)

dim $a

if $=0+$
do
$a = $ mod 20
$m = trim(iif($a,left('.',$ mod 5 mod 2)+left('::',$ mod 5/2)+left('|||',$a/5),'-')+' '+$m)
$ = $ / 20
until $ = 0
else
$m=-1
do
$m=$m+1
until $=m($m)
EndFunction
;!


Top
#164837 - 2006-07-23 07:55 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
did you either one test the codes?
look pretty buggy to me.

Top
#164838 - 2006-07-23 08:03 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
This is 167

This one I am submitting on behalf of me, Rogier and Benny ... especially Benny because he found the reduction ...

Code:

Function m($)

if $=0+$
do
;$a = $ mod 20
$m = trim(iif($ mod 20,left('.',$ mod 5 mod 2)+left('::',$ mod 5/2)+left('|||',$ mod 20/5),'-')+' '+$m)
$ = $ / 20
until $ = 0
else
$m=-1
do
$m=$m+1
until $=m($m)
EndFunction


Top
#164839 - 2006-07-23 08:11 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I just want to recap the last three script submissions and credits - Jens will need this info when he validates all three scripts seperately to ensure standings ...

173 Code - Shawn
173 Code - Shawn & Rogier
167 Code - Shawn/Rogier and Benny

Top
#164840 - 2006-07-23 08:18 PM Re: KiXgolf: Mayan Number Converter - Public Phase
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Quote:


did you either one test the codes?





Is that in the rules ?

Top
Page 3 of 11 <12345>Last »


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.078 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

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