#191095 - 2008-12-13 06:04 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Sealeopard ]
Gargoyle
MM club member
Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Here is my extremely bloated code:
Function EDTS($)
Dim $v,$c,$t,$Y,$z,$b,$e
$V = split("a e i o u")
$C = split("b c d f g h j k l m n p q r s t v w x y Z")
$b = "<"+$+"> is "
$e ="acceptable."
For each $z in $V
If instr ($,$z)
$T = 1
EndIf
Next
For $y = 1 to Len($)
If ascan($v,Substr($,$y,1)) => 0 AND ascan($v,Substr($,$y+1,1)) => 0 AND ascan($v,Substr($,$y+2,1)) => 0
$T = $t + 1
EndIf
If ascan($c,Substr($,$y,1)) => 0 AND ascan($c,Substr($,$y+1,1)) => 0 AND ascan($c,Substr($,$y+2,1)) => 0
$T = $t + 1
EndIf
If substr($,$y,1) = substr($,$y+1,1)
If substr($,$y,1) <> "e" AND substr($,$y,1) <> "O"
$T = $T + 1
EndIf
EndIf
Next
If $T = 1
$EDTS= $b + $e
Else
$EDTS= $b + "not " + $e
EndIf
EndFunction
_________________________
Today is the tomorrow you worried about yesterday.
Top
#191098 - 2008-12-13 06:37 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Allen ]
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
And for Post#2000 ... I present thee... 296 function edts($z ) dim $ ,$v ,$f ,$b ,$i ,$o $edts ="< " + $z + "> is " $v =split ("a e i o u" ) while $z $ =left ($z ,1 ) $o =b for $i =0 to 4 if $ =$v [$i ] $o =a endif if $ =e | $ =o else $f =instr ($z ,$ +$ )| $f endif next $b =$b +$o $z =right ($z ,~ ) loop $edts =$edts +iif (instr ($b ,a )>0 & not ($f | instr ($b ,aaa ) | instr ($b ,bbb )),"" ,"not " ) + "acceptable." endfunction
Top
#191099 - 2008-12-13 07:02 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Allen ]
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
287function edts($z ) dim $ ,$v ,$f ,$b ,$o $edts ="< " + $z + "> is " while $z $ =left ($z ,1 ) $o =b for each $v in split ("a e i o u" ) if $ =$v $o =a endif if $ =e | $ =o else $f =instr ($z ,$ +$ )| $f endif next $b =$b +$o $z =right ($z ,~ ) loop $edts =$edts +iif (instr ($b ,a )>0 & not ($f | instr ($b ,aaa ) | instr ($b ,bbb )),"" ,"not " ) + "acceptable." endfunction
Top
#191100 - 2008-12-13 07:08 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Allen ]
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
265function edts($z ) dim $ ,$v ,$f ,$b ,$o $edts ="< " + $z + "> is " while $z $ =left ($z ,1 ) $o =b if $ =a | $ =i | $ =u $o =a endif if $ =e | $ =o $o =a else $f =instr ($z ,$ +$ )| $f endif $b =$b +$o $z =right ($z ,~ ) loop $edts =$edts +iif (instr ($b ,a )>0 & not ($f | instr ($b ,aaa ) | instr ($b ,bbb )),"" ,"not " ) + "acceptable." endfunction
Top
#191101 - 2008-12-13 07:10 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Allen ]
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
262function edts($z ) dim $ ,$f ,$b ,$o $edts ="< " + $z + "> is " while $z $ =left ($z ,1 ) $o =b if $ =a | $ =i | $ =u $o =a endif if $ =e | $ =o $o =a else $f =instr ($z ,$ +$ )| $f endif $b =$b +$o $z =right ($z ,~ ) loop $edts =$edts +iif (instr ($b ,a )>0 & not ($f | instr ($b ,aaa ) | instr ($b ,bbb )),"" ,"not " ) + "acceptable." endfunction
Top
#191102 - 2008-12-13 07:33 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Allen ]
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
255function edts($z ) dim $ ,$f ,$b ,$o $edts ="< " + $z + "> is " while $z $ =left ($z ,1 ) $o =$ =a | $ =i | $ =u if $ =e | $ =o $o =1 else $f =instr ($z ,$ +$ )| $f endif $b ="" +$b +$o $z =right ($z ,~ ) loop $edts =$edts +iif (instr ($b ,1 )>0 & not ($f | instr ($b ,111 ) | instr ($b ,"000" )),"" ,"not " ) + "acceptable." endfunction
Top
#191104 - 2008-12-13 07:39 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Allen ]
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
252function edts($z ) dim $ ,$f ,$b ,$o ,$y $y =$z while $z $ =left ($z ,1 ) $o =$ =a | $ =i | $ =u if $ =e | $ =o $o =1 else $f =instr ($z ,$ +$ )| $f endif $b ="" +$b +$o $z =right ($z ,~ ) loop $edts ="< " + $y + "> is " +iif (instr ($b ,1 )>0 & not ($f | instr ($b ,111 ) | instr ($b ,"000" )),"" ,"not " ) + "acceptable." endfunction
Top
#191105 - 2008-12-13 07:50 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Allen ]
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
248function edts($z ) dim $ ,$f ,$b ,$o ,$y $y =$z while $z $ =left ($z ,1 ) $o =$ =a | $ =i | $ =u if $ =e | $ =o $o =1 else $f =instr ($z ,$ +$ )| $f endif $b ="" +$b +$o $z =right ($z ,~ ) $edts ="< " + $y + "> is " +iif (instr ($b ,1 )>0 & not ($f | instr ($b ,111 ) | instr ($b ,"000" )),"" ,"not " ) + "acceptable." ; loop endfunction
Top
#191106 - 2008-12-13 08:06 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Allen ]
DrillSergeant
MM club member
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Here's my 207, I'm sure it can get below 200 I just can't see it myself.
; begin KiXgolfUDF
;
;!
Function EDTS($p)
Dim $, $v, $i, $n, $o, $c
For $i = 1 to $p^0
$ = substr($p,$i,1)
if instr(aeiou,$)
$v = $i
else
$c = $i
endif
if abs($c - $v) = 3 | ($o = $ & o<>$ & e<>$) | $c - $v = ($p^)
$n = 'not '
endif
$EDTS = '<' + $p + '> is ' + $n + acceptable.
$o = $
EndFunction
;!
;!
; end KiXgolfUDF
_________________________
The Code is out there
Top
#191108 - 2008-12-13 08:42 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Gargoyle ]
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
Gargs, I'm going to do something for you that I wish was always done after these things. Here is my code commented. Maybe it will help.function edts($z ) dim $ ,$f ,$b ,$o ,$y $y =$z while $z ;while there are letters left in $z $ =left ($z ,1 ) ;set $=first character $o =$ =a | $ =i | $ =u ;if $=a,i,o set $o=1 else set $o=0 if $ =e | $ =o ;if $=e or o $o =1 ;set $o=1 else ;otherwise $f =instr ($z ,$ +$ )| $f ;if two of the same letter is in $z set $f=1 ;or if not, set $f=0, unless $f is already 1 endif $b ="" +$b +$o ;make a new string based on the original, using $o which is either a 1(vowel) or 0(consonant) $z =right ($z ,~ ) ;remove the first character of $z and reset $z to the new value $edts ="< " + $y + "> is " +iif (instr ($b ,1 )>0 & not ($f | instr ($b ,111 ) | instr ($b ,"000" )),"" ,"not " ) + "acceptable." ;line above checks for other rules: ; if there is a 1 in $b, there is a vowel ; if $f=1 then there was a double character ; if if there is not 111(3 vowels) or 000(3 consonants) in $b, that is true ; loop endfunction
Top
#191110 - 2008-12-13 09:03 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Allen ]
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
245function edts($z ) dim $ ,$f ,$b ,$o ,$y $y =$z while $z $ =left ($z ,1 ) $o =$ =a | $ =i | $ =u if $ =e | $ =o $o =1 else $f =instr ($z ,$ +$ )| $f endif $b ="" +$b +$o $z =right ($z ,~ ) $edts ="< " + $y + "> is " +iif (($f | instr ($b ,111 ) | instr ($b ,"000" ) | instr ($b ,1 )=0 ),"not " ,"" ) + "acceptable." ; loop endfunction
Top
#191113 - 2008-12-13 11:14 AM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Gargoyle ]
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Good morning guys, here my 234 Will not have any time for golfing this weekend, so, have a nice one! (Gratz on the 2000th post Allen!)
; begin KiXgolfUDF
;
;!
function EDTS($4)
dim $, $2, $3, $5, $6
$2 = ccc,vvv,x
for $3 = 1 to 0^$4
dim $1
$ = substr($4, $3, 1)
$5 = $5 + iif(instr(aeiou, $), v, c) + left(x,$=$6 & $<>e & $<>o)
$6 = $
for each $ in $2
if instr($5, $) | instr($5, v) = 0
$1 = 'not '
endif
$EDTS = '<' + $4 + '> is ' + $1 + acceptable.
endfunction
;!
;!
; end KiXgolfUDF
_________________________
Top
#191114 - 2008-12-13 01:28 PM
Re: KiXgolf - Easier Done Than Said - Public Round
[Re: Jochen ]
RemcovC
Starting to like KiXtart
Registered: 2006-09-13
Posts: 174
Loc: Holland
Ok here is my 212:Function EDTS($c)
dim $,$a,$b,$d,$e,$p,$t
for $t=0 to $c^0
$=substr($c,$t+1,1)
$b=$b|$d+$e=3|$<>e&$<>o&$=$p
$p=$
$EDTS="<"+$c+"> is "+iif($a&~$b,a,"not a")+cceptable.
if instr(aeoiu,$)
$d=$d+1
$e=0
$a=1
else
$e=$e+1
$d=0
EndFunction
_________________________
It's better to have scripted and died, then to never have scripted at all
Top
Moderator: Arend_ , Allen , Jochen , Radimus , Glenn Barnas , ShaneEP , Ruud van Velsen , Mart
0 registered
and 569 anonymous users online.