AllenAdministrator
(KiX Supporter)
2011-05-08 06:02 PM
Kixgolf - Four Is Magic - Public Round

Post your codes...

Private Round Final Scores
Jooel	283
Jochen	308
Maciep	316
Glenn	637
Citrix	660
Brad	1085




JochenAdministrator
(KiX Supporter)
2011-05-08 06:11 PM
Re: Kixgolf - Four Is Magic - Public Round

my 308:

 Code:
function a($)
    dim $s
    $s = 4,3,3,5,4,4,3,5,5,4,3,6,6,8,8,7,7,9,8,8,6,6,5,5,5,7,6,6,three,four,five,six,seven,eight,nine,ten,eleven,twelve
    while 1
        $a = "" + $a + $ + " is "
        if four=$ | 4=$
            $a = $a + magic.
            exit
        else
            if $>99
                $ = $s[($^)+25-(($^)>7&instr($,y)>)]
            else
                $ = $s[iif($<20,$,$/10+18)] + $s[$ mod 10]*($>19&$ mod 10>)
            endif
            $a = $a + $ + ". "
endfunction


AllenAdministrator
(KiX Supporter)
2011-05-08 06:13 PM
Re: Kixgolf - Four Is Magic - Public Round

Eric's 316

 Code:
function a($)
	dim $b
	$b = three,four,five,six,seven,eight,nine,ten,eleven,twelve
	$a = '' + $ + ' is '
	if four = $ or $ = 4
		$a = $a + magic.
	else
		if $ > 99
			$=$b[($^) -3 - (instr($,' ') or instr($,'-'))]
		else
			$b = 0,3,3,5,4,4,3,5,5,4,3,6,6,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6
			$ = iif($<20,$b[$ mod 20] + 4*($=0),$b[$/10+20] + $b[$ mod 10])
		
		endif
		$a = $a + $ + '. ' + a($)

endfunction


JochenAdministrator
(KiX Supporter)
2011-05-08 06:16 PM
Re: Kixgolf - Four Is Magic - Public Round

almost similar..

JochenAdministrator
(KiX Supporter)
2011-05-08 06:26 PM
Re: Kixgolf - Four Is Magic - Public Round

Modifying Eric's with parts of mine for 307:

 Code:
function a($)
	dim $b
	$b = 0,3,3,5,4,4,3,5,5,4,3,6,6,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6,three,four,five,six,seven,eight,nine,ten,eleven,twelve
	$a = '' + $ + ' is '
	if four = $ or $ = 4
		$a = $a + magic.
	else
		if $ > 99
			$=$b[($^)+27-(($^)>7&instr($,y)>)]
		else
			$ = iif($<20,$b[$ mod 20] + 4*($=0),$b[$/10+20] + $b[$ mod 10])
		endif
		$a = $a + $ + '. ' + a($)
endfunction


JochenAdministrator
(KiX Supporter)
2011-05-08 06:30 PM
Re: Kixgolf - Four Is Magic - Public Round

Mine with Eric's recursion also 307:

 Code:
function a($)
    dim $s
    $s = 4,3,3,5,4,4,3,5,5,4,3,6,6,8,8,7,7,9,8,8,6,6,5,5,5,7,6,6,three,four,five,six,seven,eight,nine,ten,eleven,twelve
    $a = "" + $a + $ + " is "
    if four=$ | 4=$
        $a = $a + magic.
        exit
    else
        if $>99
            $ = $s[($^)+25-(($^)>7&instr($,y)>)]
        else
            $ = $s[iif($<20,$,$/10+18)] + $s[$ mod 10]*($>19&$ mod 10>)
        endif
        $a = $a + $ + ". " + a($)
endfunction


very similar indeed


JochenAdministrator
(KiX Supporter)
2011-05-08 06:45 PM
Re: Kixgolf - Four Is Magic - Public Round

Ah well, haven't thought of that exit now being superfluos..

303:

 Code:
function a($)
    dim $s
    $s = 4,3,3,5,4,4,3,5,5,4,3,6,6,8,8,7,7,9,8,8,6,6,5,5,5,7,6,6,three,four,five,six,seven,eight,nine,ten,eleven,twelve
    $a = "" + $a + $ + " is "
    if four=$ | 4=$
        $a = $a + magic.
    else
        if $>99
            $ = $s[($^)+25-(($^)>7&instr($,y)>)]
        else
            $ = $s[iif($<20,$,$/10+18)] + $s[$ mod 10]*($>19&$ mod 10>)
        endif
        $a = $a + $ + ". " + a($)
endfunction


LonkeroAdministrator
(KiX Master Guru)
2011-05-08 10:18 PM
Re: Kixgolf - Four Is Magic - Public Round

sorry guys. have been driving back home for the past 3 hours.
here is mine:
 Code:
function a($)

	$a=($=)*4,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6
	if 0<$+1
		$a=($a[$ mod (20-10*($>19))]^)+$a[20+$/10]
	else
		$a=$a[($^)-(($^)>8+(seventeen=$))]
	endif
	if four=$ ^ $=4
		$a=""+$+" is magic."
	else
		$a=""+$+" is " + $a +". "+a($a)
endfunction


AllenAdministrator
(KiX Supporter)
2011-05-08 10:24 PM
Re: Kixgolf - Four Is Magic - Public Round

No DIM... nice \:\)

LonkeroAdministrator
(KiX Master Guru)
2011-05-08 10:27 PM
Re: Kixgolf - Four Is Magic - Public Round

I like that too \:\)
I was actually able to get one other code to 283 too and it had a dim but I prefer this one. oh and that seventeen in there. there is another way to determine with as low strokes, but I thought it was darn funny so I left it like this. \:\)


LonkeroAdministrator
(KiX Master Guru)
2011-05-08 10:31 PM
Re: Kixgolf - Four Is Magic - Public Round

oops. 282.
 Code:
function a($)

	$a=($=)*4,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6
	if $>99
		$a=$a[($^)-(($^)>8+(seventeen=$))]
	else
		$a=($a[$ mod (20-10*($>19))]^)+$a[20+$/10]
	endif
	if four=$ ^ $=4
		$a=""+$+" is magic."
	else
		$a=""+$+" is " + $a +". "+a($a)
endfunction


LonkeroAdministrator
(KiX Master Guru)
2011-05-08 10:34 PM
Re: Kixgolf - Four Is Magic - Public Round

oops 2: 278
 Code:
function a($)

	$a=($=)*4,3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6
	if $>99
		$a=$a[($^)-(($^)>8+(seventeen=$))]
	else
		$a=($a[$ mod (20-10*($>19))]^)+$a[20+$/10]
	endif
	if four=$ ^ $=4
		$a=""+$+" is magic."
	else
		$a=""+$+" is " + $a +". "+a($a)
endfunction


maciep
(Korg Regular)
2011-05-09 01:06 AM
Re: Kixgolf - Four Is Magic - Public Round

Nice work guys!!

AllenAdministrator
(KiX Supporter)
2011-05-09 01:48 AM
Re: Kixgolf - Four Is Magic - Public Round

Honestly guys, these codes are so wicked. I kinda see how you only used 3-12 words, but how you got the lengths with the bigger ones is truly artistic.

JochenAdministrator
(KiX Supporter)
2011-05-09 07:20 AM
Re: Kixgolf - Four Is Magic - Public Round

Wow, amazing Jooel,

but I can't ignore this present..

276:

 Code:
function a($)
	$a=($=)*4,3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6
	if $>99
		$a=$a[($^)-(($^)>7&instr($,y)>)]
	else
		$a=($a[$ mod (20-10*($>19))]^)+$a[20+$/10]
	endif
	if four=$ ^ $=4
		$a=""+$+" is magic."
	else
		$a=""+$+" is " + $a +". "+a($a)
endfunction


AllenAdministrator
(KiX Supporter)
2011-05-09 07:37 AM
Re: Kixgolf - Four Is Magic - Public Round

oooo!!! I wish I could play, I'd be taking the lead right now.

JochenAdministrator
(KiX Supporter)
2011-05-09 07:54 AM
Re: Kixgolf - Four Is Magic - Public Round

mmmm... something I overlooked?

AllenAdministrator
(KiX Supporter)
2011-05-09 08:02 AM
Re: Kixgolf - Four Is Magic - Public Round

I probably shouldn't have said what I did say...



JochenAdministrator
(KiX Supporter)
2011-05-09 08:07 AM
Re: Kixgolf - Four Is Magic - Public Round

well, as I can't see what you meant, there's no danger atm..

JochenAdministrator
(KiX Supporter)
2011-05-09 03:34 PM
Re: Kixgolf - Four Is Magic - Public Round

 Originally Posted By: Allen
Post your codes...



Private Round Final Scores
Jooel 283
Jochen 308
Maciep 316
Glenn 637
Citrix 660
Brad 1085







Still 3 of 6 codes missing \:o


LonkeroAdministrator
(KiX Master Guru)
2011-05-09 03:37 PM
Re: Kixgolf - Four Is Magic - Public Round

Jochen, I guess I am getting old and blind already \:\)

AllenAdministrator
(KiX Supporter)
2011-05-09 03:44 PM
Re: Kixgolf - Four Is Magic - Public Round

In between holes, lets talk about the errors you guys were running into.

I may know the one Jochen ran into. I actually asked a question about it about 8 months ago, when I first started putting this together: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Main=26945&Number=199573#Post199573


JochenAdministrator
(KiX Supporter)
2011-05-09 03:55 PM
Re: Kixgolf - Four Is Magic - Public Round

not at all,

this was what I stumbled over (or similar):

take my last working with 303 :

 Code:
function a($)
    dim $s
    $s = 4,3,3,5,4,4,3,5,5,4,3,6,6,8,8,7,7,9,8,8,6,6,5,5,5,7,6,6,three,four,five,six,seven,eight,nine,ten,eleven,twelve
    $a = "" + $a + $ + " is "
    if four=$ | 4=$
        $a = $a + magic.
    else
        if $>99
            $ = $s[($^)+25-(($^)>7&instr($,y)>)]
        else
            $ = $s[iif($<20,$,$/10+18)] + $s[$ mod 10]*($>19&$ mod 10>)
        endif
        $a = $a + $ + ". " + a($)
endfunction


replacing with an iif() in line 11 (one stroke less) fails with array ref out of bounds if $ > 37 (set $verbose to 2):

 Code:
function a($)
    dim $s
    $s = 4,3,3,5,4,4,3,5,5,4,3,6,6,8,8,7,7,9,8,8,6,6,5,5,5,7,6,6,three,four,five,six,seven,eight,nine,ten,eleven,twelve
    $a = "" + $a + $ + " is "
    if four=$ | 4=$
        $a = $a + magic.
    else
        if $>99
            $ = $s[($^)+25-(($^)>7&instr($,y)>)]
        else
            $ = iif($<20, $s[$], $s[$/10+18]+($ mod 10>)*$s[$ mod 10])  
               ;$s[iif($<20,$,$/10+18)] + $s[$ mod 10]*($>19&$ mod 10>)                    
        endif
        $a = $a + $ + ". " + a($)
endfunction


Still can't explain that..


AllenAdministrator
(KiX Supporter)
2011-05-09 03:57 PM
Re: Kixgolf - Four Is Magic - Public Round

I forgot you had that one... it was early on when you had one failing test that I was thinking of.

JochenAdministrator
(KiX Supporter)
2011-05-09 04:00 PM
Re: Kixgolf - Four Is Magic - Public Round

Oh yeah, you're right. First it evaluated true even if $ was 0 .. But a quick "if four=$ | 4=$" solved the variant type problem ;\)

Oh well, in reality I had a very long time this instead

 Code:
if $=4 | $=four & $>0


then .. for a shorter period this:

 Code:
if instr(four4,$)




Glenn BarnasAdministrator
(KiX Supporter)
2011-05-09 04:20 PM
Re: Kixgolf - Four Is Magic - Public Round

Here's my code.. only had time for one draft last week and no fine-tuning.
 Code:
function a($)
 Dim $T,$v,$l,$n,$f,$z
 $T = zero,one,two,three,four,five,six,seven,eight,nine,ten,
 eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,twenty
 ReDim Preserve $T[90]
 $T[30]=thirty
 $T[40]=forty
 $T[50]=fifty
 $T[60]=sixty
 $T[70]=seventy
 $T[80]=eighty
 $T[90]=ninety
 $v=Join(Split(Join(Split($, '-'), ''), ' '), '')

 If $ = Val($)			; is numeric
  $f=1				; set flag
  $l=Right($,1)
  If $<21			; direct translation
   $v = $T[$]
  Else				; tens plus ones (if not zero)
   $v = $T[10*left($,1)] + IIf($l<>0,$T[$l],'')
  EndIf
 EndIf

 If $v <> four			; don't process if input is "four"
  Do
   $n = Len($v)			; len of verbose number value
   $z=IIf($f,$n, $T[$n])	; len as either number or verbose value

   $a = '' + $a + $ + ' is ' + $Z + '. '
   $v = $T[$n]			; reset new verbose value
   $=IIf($f,$z,$v)
  Until $n = 4
 EndIf

 $a = $a + IIf($f,'4', 'four') + ' is magic.'

endfunction
When I submitted my code I still had a debug message. Actual score without the message was 571 - here's the run from this morning:
 Code:
KiXtart Version  = 4.61
KiXGolf Script   = kixgolf_fim.kix
Scoring Engine   = 3.3
OS               = Windows 7 Enterprise Edition
CPU              = Intel Pentium Model 14
Speed            = 1662 MHz
Memory           = 2048 MB

Tournament       = Four Is Magic
Processing Start = 2011/05/09 10:11:38.105
Processing End   = 2011/05/09 10:11:38.293
Duration         = 0000/00/00 00:00:00.187
# Tests Run      = 200
# Tests Passed   = 200
# Tests Failed   =
Result           = passed
KiXGolf Score    = 571

Thank you for participating in KiXtart Golf!
Really interesting solutions (as usual) being posted. I wish I had more time to play.

My concept was to process the words, converting digits to words and reusing the conversion logic.

Glenn


ShaneEP
(MM club member)
2011-05-09 04:31 PM
Re: Kixgolf - Four Is Magic - Public Round

Sorry I havent been home much in the last couple days. And I don't have my newest code here at work.

ShaneEP
(MM club member)
2011-05-09 04:31 PM
Re: Kixgolf - Four Is Magic - Public Round

I can post my 703 version if you want.

LonkeroAdministrator
(KiX Master Guru)
2011-05-09 07:23 PM
Re: Kixgolf - Four Is Magic - Public Round

how stupid. this what you meant Allen?
275
 Code:
function a($)
	$a=($=)*4,3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6
	if b>$
		$a=($a[$ mod (20-10*($>19))]^)+$a[20+$/10]
	else
		$a=$a[($^)-(($^)>7&instr($,y)>)]
	endif
	if four=$ ^ $=4
		$a=""+$+" is magic."
	else
		$a=""+$+" is " + $a +". "+a($a)
endfunction


JochenAdministrator
(KiX Supporter)
2011-05-09 09:14 PM
Re: Kixgolf - Four Is Magic - Public Round

OMG !!!!!
We've talked about variant types and I didn't see the forrest for the trees..

If I think of how many times I tried "if $>a" or "if $>b" .. GAWD!!

really stupid, that


AllenAdministrator
(KiX Supporter)
2011-05-10 12:20 AM
Re: Kixgolf - Four Is Magic - Public Round

LOL... that is so funny. However...consider this competition still open...

ShaneEP
(MM club member)
2011-05-10 02:02 AM
Re: Kixgolf - Four Is Magic - Public Round

Here is my 660 beast \:\) Like Glen, I just got a first version, and then a couple mods in...then didn't have as much time as I wanted to work on it after that. Wish I could have gotten it a bit more competitive.

 Code:
function a($)
   dim $1,$2,$3,$s
   $1="zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve",
       "thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"
   $2="","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"

   if $=4 OR $="four" AND $>0
      $a=""+$+" is magic."
   else
      if val($)>0 or $=0
         if val($)>19
            $3=len($2[$/10])+len($1[$ mod 10])
            if instr($,0)
               $3=$3-4
            endif
         else
            $3=len($1[$])
         endif
         While $3<>4
            $s=""+$s+$+" is "+$3+". "
            $=$3
            $3=len($1[$3])
         Loop
      else
         $3=$1[Len(join(split(join(split($," "),""),"-"),""))]
         While $3<>"four"
            $s=$s+$+" is "+$3+". "
            $=$3
            $3=$1[len($3)]
         Loop
      endif
      $a=""+$s+$+" is "+$3+". "+$3+" is magic."
   endif
endfunction


JochenAdministrator
(KiX Supporter)
2011-05-10 02:00 PM
Re: Kixgolf - Four Is Magic - Public Round

 Originally Posted By: Allen
LOL... that is so funny. However...consider this competition still open...

okay .. point taken.

Oh, btw. Jooel, sometimes more is indeed less..

273:
 Code:
function a($)
    dim $b
    $b=($=)*4,3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6
    $a = ""+$+" is "
    if four=$|$=4
        $a=$a+magic.
    else
        if b>$
            $=($b[$ mod (20-10*($>19))]^)+$b[20+$/10]
        else
            $=$b[($^)-(($^)*instr($,y)>36)]
        endif
        $a=$a+$+". "+a($)
endfunction


LonkeroAdministrator
(KiX Master Guru)
2011-05-10 05:34 PM
Re: Kixgolf - Four Is Magic - Public Round

oh. darn.

BradV
(Seasoned Scripter)
2011-05-10 09:29 PM
Re: Kixgolf - Four Is Magic - Public Round

OK, here is my crap code. \:\)

 Code:
function a($)
   dim $s, $t[9], $o[9], $d[9], $w[2], $f, $r, $l, $n
   $o = "zero","one","two","three","four","five","six","seven","eight","nine"
   $d = $ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"
   $t = "","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"
   $a = ""
   if $ + 0 = $
      select
         case $ < 10
            $w = "","",$o[$]
         case $ < 20
            $w = "","",$d[$ - 10]
         case 1
            $r = $ mod 10
            $f = int($ / 10)
            $w = $t[$f],"-",iif($r = 0,"",$o[$r])
      endselect
      while not($w[0] = "" and $w[2] = "four")
         $l = len($w[0]) + len($w[2])
         if $w[0] = ""
            if Ascan($d,$w[2]) < 0
               $n = Ascan($o,$w[2])
            else
               $n = Ascan($d,$w[2]) + 10
            endif
         else
            $n = Ascan($t,$w[0]) * 10 + iif($w[2]="",0,Ascan($o,$w[2]))
         endif
         $a = $a + $n + " is " + $l + ". "
         if $l < 10
            $w = "","",$o[$l]
         else
            $w = "","",$d[$l-10]
         endif
      loop
      $a = $a + "4 is magic."
   else
      if Instr($,"-")
         $s="-"
         $w = split($,$s)
      else
         if Instr($," ")
            $s=" "
            $w = split($,$s)
         else
            $s=""
            $w = $s,$
         endif
      endif
      redim preserve $w[2]
      $w[2]=$w[1]
      $w[1]=$s
      while not($w[0] = "" and $w[2] = "four")
         $l = len($w[0]) + len($w[2])
         if $l < 10
            $n = $o[$l]
         else
            $n = $d[$l-10]
         endif
         $a = $a + join($w,"") + " is " + $n + ". "
         if $l < 10
            $w = "","",$o[$l]
         else
            $w = "","",$d[$l-10]
         endif
      loop
      $a = $a + "four is magic."
   endif
endfunction


LonkeroAdministrator
(KiX Master Guru)
2011-05-10 11:39 PM
Re: Kixgolf - Four Is Magic - Public Round

271.
 Code:
function a($)
    dim $b
    $b=($=)*4,3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6
    $a = ""+$+" is "
    if four=$|$=4
        $a=$a+magic.
    else
        if b>$
            $=($b[$ mod (20-10*($>19))]^)+$b[20+$/10]
        else
            $=$b[($^)-(($^instr($,y))>9)]
        endif
        $a=$a+$+". "+a($)
endfunction


LonkeroAdministrator
(KiX Master Guru)
2011-05-11 05:30 AM
Re: Kixgolf - Four Is Magic - Public Round

knew it.
no Jochen, Less is MORE ;\)

267

 Code:
function a($)
    $a=($=)*4,3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6
    if b>$
        $a=($a[$ mod (20-10*($>19))]^)+$a[20+$/10]
    else
        $a=$a[($^)-(($^instr($,y))>9)]
    endif
    if $=$a
        $a=""+$+" is magic."
    else
        $a="" + $ + " is " + $a + ". "+a($a)
endfunction


LonkeroAdministrator
(KiX Master Guru)
2011-05-11 05:34 AM
Re: Kixgolf - Four Is Magic - Public Round

no... Less is ... how did it go? \:\/

ShaneEP
(MM club member)
2011-05-11 06:30 AM
Re: Kixgolf - Four Is Magic - Public Round

Dang...you guys should start adding comments into your code so lowly scripters like myself can know what's going on.

JochenAdministrator
(KiX Supporter)
2011-05-11 08:48 AM
Re: Kixgolf - Four Is Magic - Public Round

hehe, nice one ..

 Code:
if $=$a



now it starts getting hard \:D


JochenAdministrator
(KiX Supporter)
2011-05-11 08:57 AM
Re: Kixgolf - Four Is Magic - Public Round

ok, got it,

if $=$a .. so obvious, it hurts!


JochenAdministrator
(KiX Supporter)
2011-05-11 11:16 AM
Re: Kixgolf - Four Is Magic - Public Round

266

 Code:
function a($)
    $a=($=)*4,3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8,0,0,6,6,5,5,5,7,6,6
    if b>$
        $a=($a[right($,1+($<20))]^)+$a[20+$/10]
    else
        $a=$a[($^)-((instr($,y)^$)>9)]
    endif
    if $=$a
        $a=""+$+" is magic."
    else
        $a=""+$+" is "+$a+". "+a($a)
endfunction


@Shane: as this is Jooels Baby, it's up to him explaining whats going on..

Only so much:
this part here is very clever, and I don't know if it was used as such before:

($a[right($,1+($<20))]^)

If the array element is of type String, it returns its length or, if it is of type integer, it returns the value of the element..


BradV
(Seasoned Scripter)
2011-05-11 01:41 PM
Re: Kixgolf - Four Is Magic - Public Round

It's so unobvious. \:\(
What does $a=($=) do?


JochenAdministrator
(KiX Supporter)
2011-05-11 01:47 PM
Re: Kixgolf - Four Is Magic - Public Round

$a=($=)*4,3,3...

if $=0 $a looks like this:

$a = 4,3,3...

other wise it looks like this:

$a = 0,3,3...


LonkeroAdministrator
(KiX Master Guru)
2011-05-11 03:37 PM
Re: Kixgolf - Four Is Magic - Public Round

THANKS JOCHEN!
I so wanted to get rid of that MOD for sooo long. thanks!


LonkeroAdministrator
(KiX Master Guru)
2011-05-11 04:27 PM
Re: Kixgolf - Four Is Magic - Public Round

264
 Code:
function a($)
    $a=4*($=),3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8
    if b>$
        $a=($a[right($,1+($<20))]^)+substr(t66555766,left($,~),1)
    else
        $a=$a[($^)-((instr($,y)^$)>9)]
    endif
    if $=$a
        $a=""+$+" is magic."
    else
        $a=""+$+" is "+$a+". "+a($a)
endfunction


JochenAdministrator
(KiX Supporter)
2011-05-11 04:33 PM
Re: Kixgolf - Four Is Magic - Public Round

cool.

JochenAdministrator
(KiX Supporter)
2011-05-11 04:36 PM
Re: Kixgolf - Four Is Magic - Public Round

but why left($,~) ?

259:

 Code:
function a($)
    $a=4*($=),3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8
    if b>$
        $a=($a[right($,1+($<20))]^)+substr(t66555766,$/10,1)
    else
        $a=$a[($^)-((instr($,y)^$)>9)]
    endif
    if $=$a
        $a=""+$+" is magic."
    else
        $a=""+$+" is "+$a+". "+a($a)
endfunction


LonkeroAdministrator
(KiX Master Guru)
2011-05-11 04:37 PM
Re: Kixgolf - Four Is Magic - Public Round

FFS!!!!!!!!!!!!!!!!

LonkeroAdministrator
(KiX Master Guru)
2011-05-12 07:53 PM
Re: Kixgolf - Four Is Magic - Public Round

258.
 Code:
function a($)
    $a=4*($=),3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8
	if b>$
        $a=($a[$-($>19)*$/10*10]^)+substr(t66555766,$/10,1)
    else
        $a=$a[($^)-((instr($,y)^$)>9)]
    endif
    if $=$a
        $a=""+$+" is magic."
    else
        $a=""+$+" is "+$a+". "+a($a)
endfunction


LonkeroAdministrator
(KiX Master Guru)
2011-05-12 07:55 PM
Re: Kixgolf - Four Is Magic - Public Round

257
 Code:
function a($)
    $a=4*($=),3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8
	if b>$
        $a=($a[$-($>19)*$/10*10]^)+substr(t66555766,$/10,1)
    else
        $a=$a[($^)-(instr($,y)^$)/10]
    endif
    if $=$a
        $a=""+$+" is magic."
    else
        $a=""+$+" is "+$a+". "+a($a)
endfunction


JochenAdministrator
(KiX Supporter)
2011-05-12 08:37 PM
Re: Kixgolf - Four Is Magic - Public Round

clever!

LonkeroAdministrator
(KiX Master Guru)
2011-05-12 08:38 PM
Re: Kixgolf - Four Is Magic - Public Round

had to find something, right?
already said I will give up and my baby said NO, before closing her eyes for a nap \:\)


Richard H.Administrator
(KiX Supporter)
2011-05-13 02:20 PM
Re: Kixgolf - Four Is Magic - Public Round

Sorry, just couldn't resist:
 Code:
function a($)
	$a=4*($=),3,3,three,four,five,six,seven,eight,nine,ten,eleven,twelve,8,8,7,7,9,8,8
	if b>$
		$a=($a[$-($>19)*$/10*10]^)+substr(t66555766,$/10,1)
	else
		$a=$a[($^)-(instr($,y)^$)/10]
	endif
	if $=$a
		$a=@+$+" is magic."
	else
		$a=@+$+" is "+$a+". "+a($a)
endfunction


255


LonkeroAdministrator
(KiX Master Guru)
2011-05-13 03:30 PM
Re: Kixgolf - Four Is Magic - Public Round

damn. f. and welcome to the board of scores Richard \:\)

JochenAdministrator
(KiX Supporter)
2011-05-13 03:42 PM
Re: Kixgolf - Four Is Magic - Public Round

@

really the only thing that can replace a "" .. So noted for the next round!


AllenAdministrator
(KiX Supporter)
2011-05-13 04:06 PM
Re: Kixgolf - Four Is Magic - Public Round

"@"... And there it is... I kept smiling every time you guys found more and more strokes... but those quotes kept staying.

JochenAdministrator
(KiX Supporter)
2011-05-13 04:28 PM
Re: Kixgolf - Four Is Magic - Public Round

hmm,
work is quite overwhelming this week, so I blame this not finding more \:\/


LonkeroAdministrator
(KiX Master Guru)
2011-05-13 06:49 PM
Re: Kixgolf - Four Is Magic - Public Round

yhyy

AllenAdministrator
(KiX Supporter)
2011-05-14 06:52 PM
Re: Kixgolf - Four Is Magic - Public Round

As a addendum to this challenge... is there any number where 4 is not magic?

JochenAdministrator
(KiX Supporter)
2011-05-14 09:14 PM
Re: Kixgolf - Four Is Magic - Public Round

nope, there is none.. As any number will come down to a length below 100 and we have already proofed that all numbers end in 4 .. voila, proofed

AllenAdministrator
(KiX Supporter)
2011-05-14 09:33 PM
Re: Kixgolf - Four Is Magic - Public Round

I can't completely disagree, but... just a quick example of a number whose length is > 100
 Code:
;888,888,888,888
? len("eight hundred eighty eight billion, eight hundred eighty eight million, eight hundred eighty eight thousand, eight hundred eighty eight")

135
edit: or 114, less the commas and spaces


ShaneEP
(MM club member)
2011-05-14 09:54 PM
Re: Kixgolf - Four Is Magic - Public Round

Yeah but isn't 132 simply One Hundred Thirty Two which is back to less than 100?

LonkeroAdministrator
(KiX Master Guru)
2011-05-15 12:54 AM
Re: Kixgolf - Four Is Magic - Public Round

four wouldn't be magic if it there was a number that wouldn't come down to it and as four is magic, all numbers have to end there. simple as that.

LonkeroAdministrator
(KiX Master Guru)
2011-05-15 02:11 PM
Re: Kixgolf - Four Is Magic - Public Round

k, there is time to be stubborn and time to give up. I decided to give up now.

AllenAdministrator
(KiX Supporter)
2011-05-15 03:47 PM
Re: Kixgolf - Four Is Magic - Public Round

Is this your attempt of finding strokes, like Jochen did? ;\)

LonkeroAdministrator
(KiX Master Guru)
2011-05-15 03:58 PM
Re: Kixgolf - Four Is Magic - Public Round

no.
been searching for new tricks for couple days now. getting tired. need sleep.


AllenAdministrator
(KiX Supporter)
2011-05-15 06:19 PM
Re: Kixgolf - Four Is Magic - Public Round

Well I guess that does it. I really enjoyed watching and was really impressed with the results. Thumbs up.

I'll mess with the scores later today/tomorrow.


LonkeroAdministrator
(KiX Master Guru)
2011-05-15 07:16 PM
Re: Kixgolf - Four Is Magic - Public Round

thanks for fun round.

JochenAdministrator
(KiX Supporter)
2011-05-15 07:26 PM
Re: Kixgolf - Four Is Magic - Public Round

Thumbs up to you Allen!

Thanx for this nice round of Kixgolf, hope the next is not far away \:\)


ShaneEP
(MM club member)
2011-05-16 05:19 PM
Re: Kixgolf - Four Is Magic - Public Round

Yeah thanks for organizing it Allen. Always fun.

BradV
(Seasoned Scripter)
2011-05-16 06:50 PM
Re: Kixgolf - Four Is Magic - Public Round

Fun, but I obviously don't have my head wrapped around minimalist programming. \:\)


Thanks!


AllenAdministrator
(KiX Supporter)
2011-05-18 01:24 PM
Re: Kixgolf - Four Is Magic - Public Round

Private Round Scores
			Particip.
Name	Score	Points	Points	Total
Jooel	283	5	1	6
Jochen	308	4	1	5
Maciep	316	3	1	4
Glenn	637	2	1	3
Citrix	660	1	1	2
Brad	1085	0	1	1	
 
Public Round Scores Bonus Name Score Points Points Total Richard 255 5 1 6 Jooel 257 4 1 5 Jochen 259 3 1 4 Maciep 316 2 0 2 Glenn 571 1 1 2 Citrix 660 0 0 0 Brad 1085 0 0 0

Total Points
Jooel 11 Jochen 9 Maciep 6 Richard 6 Glenn 5 Citrix 2 Brad 1


JochenAdministrator
(KiX Supporter)
2011-05-18 02:32 PM
Re: Kixgolf - Four Is Magic - Public Round

Yay, Scores!

Congrats Jooel!
Nicely played


Richard H.Administrator
(KiX Supporter)
2011-05-18 02:44 PM
Re: Kixgolf - Four Is Magic - Public Round

Big thanks to everyone who did all the hard work and let me weasel my way to the top of the public round and take the glory in the dying minutes.

I blame my appointment to a management position, it's created a monster mwahahahaha.


LonkeroAdministrator
(KiX Master Guru)
2011-05-18 06:27 PM
Re: Kixgolf - Four Is Magic - Public Round

LOL!

thanks for everyone for the fun. even the manager.

loved it!


AllenAdministrator
(KiX Supporter)
2011-05-21 01:44 AM
Re: Kixgolf - Four Is Magic - Public Round

For fun... using Num2Text() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=202256#Post202256

Practically any number can be used, but must be in quotes once the numbers get sufficiently big enough.

 Code:
  break on
  $RC=setoption("WrapATEOL","ON")
  $RC=setoption("Explicit","ON")

  dim $i,$len

  $i="888888888888"

  if $i<>4
    ? "" + $i + " is "
    $len=len(replace(num2text($i)," ",""))
    while $len<>4
      "" + $len + ". " + $len +  " is "
      $len=len(replace(num2text($len)," ",""))
    loop
    "4. "
  endif
  "4 is magic."


Outputs

888888888888 is 114. 114 is 20. 20 is 6. 6 is 3. 3 is 5. 5 is 4. 4 is magic.


LonkeroAdministrator
(KiX Master Guru)
2011-05-21 12:51 PM
Re: Kixgolf - Four Is Magic - Public Round

cute.
and thanks for making that udf "needed" at least once ;\)


ShaneEP
(MM club member)
2011-05-21 05:13 PM
Re: Kixgolf - Four Is Magic - Public Round

Don't worry I'm def using it. Writing a small payroll app in kix/kixforms. Needed it to convert from dollar amount to text for checks.

LonkeroAdministrator
(KiX Master Guru)
2011-05-21 08:00 PM
Re: Kixgolf - Four Is Magic - Public Round

oh. that was the only thing I was able to think myself as a use... \:\)
and it's cute too \:\)


BradV
(Seasoned Scripter)
2011-05-23 12:10 PM
Re: Kixgolf - Four Is Magic - Public Round

Shane, make sure to add a zero or two to your check! \:\)

I worked with a guy years ago at ITT defense that got upset with someone and for a long time, just kept removing their pay punch card from the stack. The guy had to go to payroll and show they made a mistake and then get a special check cut. This went on for months.


LonkeroAdministrator
(KiX Master Guru)
2011-05-24 03:52 AM
Re: Kixgolf - Four Is Magic - Public Round

lol. thats just cruel :P

ShaneEP
(MM club member)
2011-05-24 04:21 AM
Re: Kixgolf - Four Is Magic - Public Round

Haha it certainly is tempting...

if $emp = "Shane"
$hours = $hours+(0.05*$hours)
endif


AllenAdministrator
(KiX Supporter)
2011-06-22 10:45 PM
Re: Kixgolf - Four Is Magic - Public Round

 Quote:
Thanx for this nice round of Kixgolf, hope the next is not far away \:\)


Good News, bad news...

Good news is,
Warning, Spoiler:
I finally found a topic I thought was worthy of a golf round.

Bad news is,
Warning, Spoiler:
we are months away from the next round. I'll keep everyone posted as the date approaches.


LonkeroAdministrator
(KiX Master Guru)
2011-06-23 06:44 PM
Re: Kixgolf - Four Is Magic - Public Round

months????????????????

BradV
(Seasoned Scripter)
2011-06-23 07:29 PM
Re: Kixgolf - Four Is Magic - Public Round

How far can you golf that down? \:\)

JochenAdministrator
(KiX Supporter)
2011-06-24 11:27 AM
Re: Kixgolf - Four Is Magic - Public Round

Hey Allen,

months sounds bad .. but hey, most important is that there will be a next round \:\)


AllenAdministrator
(KiX Supporter)
2011-06-24 11:44 AM
Re: Kixgolf - Four Is Magic - Public Round

I'm thinking late October or early November. But definitely before the end of the year. With work and the GF, my time is much more limited than in the past. I try to work on the course a little on the weekends when I have time, so it's a slow work in progress.

Sealeopard
(KiX Master)
2011-07-08 04:43 AM
Re: Kixgolf - Four Is Magic - Public Round

Late to the party but congratulations to everybody on a fun round of KiXgolf.