#70106 - 2002-09-24 03:14 AM
Re: KixGolf Results/Code
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I am looking to save a little more than that.
|
Top
|
|
|
|
#70107 - 2002-09-24 03:37 AM
Re: KixGolf Results/Code
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Tripled performance. 33 number sets in 52 seconds. on PIII 850 Mhz.
code:
Game24 v 1.1 KiXtart Golf running under KiXtart v4.11
In: 1346; Out: 6.0/(1.0-3.0/4.0) = 24 => Correct!! In: 3388; Out: 8.0/(3.0-8.0/3.0) = 24 => Correct!! In: 5555; Out: (5.0*5.0)-5.0/5.0 = 24 => Correct!! In: 4971; Out: (4.0-7.0)*(1.0-9.0) = 24 => Correct!! In: 6143; Out: 6.0/(1.0-3.0/4.0) = 24 => Correct!! In: 6451; Out: 6.0/(5.0/4.0-1.0) = 24 => Correct!! In: 4429; Out: (9.0-2.0)*4.0-4.0 = 24 => Correct!! In: 1234; Out: (1.0+2.0+3.0)*4.0 = 24 => Correct!! In: 2268; Out: (2.0+2.0*8.0)+6.0 = 24 => Correct!! In: 4466; Out: = => Correct!! In: 0206; Out: = => Correct!! In: 2219; Out: 2.0*(2.0+1.0+9.0) = 24 => Correct!! In: 4707; Out: = => Correct!! In: 4818; Out: (4.0*8.0)-1.0*8.0 = 24 => Correct!! In: 2827; Out: (2.0+8.0)+2.0*7.0 = 24 => Correct!! In: 5669; Out: (6.0*9.0)-5.0*6.0 = 24 => Correct!! In: 9504; Out: = => Correct!! In: 5865; Out: (5.0+8.0)+6.0+5.0 = 24 => Correct!! In: 3600; Out: = => Correct!! In: 5581; Out: = => Correct!! In: 6149; Out: 6.0*(9.0-1.0-4.0) = 24 => Correct!! In: 7742; Out: (7.0+7.0)*2.0-4.0 = 24 => Correct!! In: 1972; Out: (1.0+9.0)+7.0*2.0 = 24 => Correct!! In: 2605; Out: = => Correct!! In: 2622; Out: = => Correct!! In: 4004; Out: = => Correct!! In: 3696; Out: (3.0+6.0)+9.0+6.0 = 24 => Correct!! In: 0461; Out: (0.0+4.0)*6.0/1.0 = 24 => Correct!! In: 7631; Out: (7.0+6.0*3.0)-1.0 = 24 => Correct!! In: 6452; Out: (6.0+4.0*5.0)-2.0 = 24 => Correct!! In: 3477; Out: (3.0+4.0*7.0)-7.0 = 24 => Correct!! In: 1289; Out: (2.0*8.0)+9.0-1.0 = 24 => Correct!! In: 3377; Out: (3.0+3.0/7.0)*7.0 = 24 => Correct!!
Time = 51885 ticks kix32 Kixgolf3.kix $f=junk.kix
KixGolf score = 472
code:
function game24($a,$b,$c,$d)
Dim $h, $j, $l, $p, $q, $r, $s, $t, $v, $, $x, $y, $z $h = "+","-","/","*" for $z=1 to 4 for $y=1 to 4 for $x=1 to 2 for each $p in $h for each $q in $h for each $r in $h for each $j in split("0,8~0,8,10,18~0,12~4,16","~") $ = ".0" $s = ""+$a+$+$p+$b+$+$q+$c+$+$r+$d+$ for each $ in split($j,",") $l = chr(40 + ($l="(")) $s = "" + left($s,$) + $l + substr($s,1+$) next $t = execute("$$v=$s") if abs($v-24)< 1E-9 goto E endif next next next next $ = $c $c = $d $d = $ next $ = $b $b = $c $c = $d $d = $ next $ = $a $a = $d $d = $ next $s = ""
:E $game24 = $s exit endfunction
[ 24. September 2002, 03:50: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#70108 - 2002-09-24 04:15 AM
Re: KixGolf Results/Code
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Fernando, cat got your tongue? [ 24. September 2002, 04:16: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#70110 - 2002-09-24 11:35 AM
Re: KixGolf Results/Code
|
Fernando Madruga
Starting to like KiXtart
Registered: 2002-08-21
Posts: 149
Loc: Coimbra.Portugal.Europe.Earth....
|
|
Top
|
|
|
|
#70111 - 2002-09-25 12:27 AM
Re: KixGolf Results/Code
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
All's fair in phase two. Beg, borrow, and steal. All code is fair game.
|
Top
|
|
|
|
#70114 - 2002-09-24 04:11 PM
Re: KixGolf Results/Code
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Jack, no I don't, in fact it adds a character. $e=Split("+ - * /") = 19 spaces inside quotes are counted.
$h = "+","-","/","*" = 18
|
Top
|
|
|
|
#70116 - 2002-09-24 04:15 PM
Re: KixGolf Results/Code
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Yes. Turn on the KixGolf debug (;~) and look at the log.
|
Top
|
|
|
|
#70119 - 2002-09-24 04:40 PM
Re: KixGolf Results/Code
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
As always, these little adventures benefit everyone.
So far this exercise has educated many of us.
It has also asisted in locating 1 KiXtart bug and pointing to another behavior that might prove to be a bug.
|
Top
|
|
|
|
#70123 - 2002-09-24 07:14 PM
Re: KixGolf Results/Code
|
Anonymous
Anonymous
Unregistered
|
I have amended my script to add in some parentheses which I removed after Madruger's analysis but, as was shown, at least one of (ab)cd, a(bc)d or ab(cd) is required [ie (1+1)*9+6]. (added 4 strokes, but removed 4 quoted spaces to leave score unchanged!)
Is the second possable kixtart bug to do with using QUIT within a udf? I used RETURN as QUIT quit the entire script, not just the udf.
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 980 anonymous users online.
|
|
|