#202190 - 2011-05-11 11:16 AM
Re: Kixgolf - Four Is Magic - Public Round
[Re: Jochen]
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
266
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..
_________________________
|
Top
|
|
|
|
#202191 - 2011-05-11 01:41 PM
Re: Kixgolf - Four Is Magic - Public Round
[Re: Jochen]
|
BradV
Seasoned Scripter
Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
|
It's so unobvious. What does $a=($=) do?
|
Top
|
|
|
|
#202194 - 2011-05-11 04:27 PM
Re: Kixgolf - Four Is Magic - Public Round
[Re: Lonkero]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
264
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
_________________________
!download KiXnet
|
Top
|
|
|
|
#202196 - 2011-05-11 04:36 PM
Re: Kixgolf - Four Is Magic - Public Round
[Re: Jochen]
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
but why left($,~) ?
259:
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
_________________________
|
Top
|
|
|
|
#202210 - 2011-05-12 07:53 PM
Re: Kixgolf - Four Is Magic - Public Round
[Re: Lonkero]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
258.
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
_________________________
!download KiXnet
|
Top
|
|
|
|
#202211 - 2011-05-12 07:55 PM
Re: Kixgolf - Four Is Magic - Public Round
[Re: Lonkero]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
257
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
_________________________
!download KiXnet
|
Top
|
|
|
|
#202218 - 2011-05-13 02:20 PM
Re: Kixgolf - Four Is Magic - Public Round
[Re: Lonkero]
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Sorry, just couldn't resist:
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
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 231 anonymous users online.
|
|
|