Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
If Richard's double set of "()"'s holds up, then I re-submit my code:
Game24 KiXtart Golf running under KiXtart v4.11
Numbers = 1, 2, 3, 4 Please doublecheck your solution to guarantee a correct result 1.0*(2.0*(3.0*4.0)) = 24
Numbers = 2, 2, 6, 8 Please doublecheck your solution to guarantee a correct result 2.0+(6.0+(8.0*2.0)) = 24
Numbers = 4, 4, 6, 6 Correct answer answer, there is no solution to this combination
Numbers = 3, 3, 8, 8 Please doublecheck your solution to guarantee a correct result 8.0/(3.0-(8.0/3.0)) = 24
Numbers = 0, 4, 6, 8 Please doublecheck your solution to guarantee a correct result 0.0+(6.0*(8.0-4.0)) = 24
Numbers = 3, 4, 7, 7 Please doublecheck your solution to guarantee a correct result 3.0+(7.0*(7.0-4.0)) = 24
Numbers = 1, 2, 8, 9 Please doublecheck your solution to guarantee a correct result 8.0*(9.0/(2.0+1.0)) = 24
Time: 421 ticks
{edit} Thanks Erik, Removed "exit" reduced score by four. KixGolf v3.0.3 score = 314, running under KiXtart v4.10
code:
function game24($a,$b,$c,$d)
Dim $h, $p, $q, $r, $s, $t, $v, $, $x, $y
$h = "+","-","/","*" for $y=1 to 4 for $x=1 to 4 for each $p in $h for each $q in $h for each $r in $h $ = ".0" $s = ""+$a+$+$p+"("+$b+$+$q+"("+$c+$+$r+$d+$+"))" $t = execute("$$v=$s") if abs($v-24)< 1E-9 goto E endif next next next $ = $b $b = $c $c = $d $d = $ next $ = $a $a = $b $b = $ next $s = ""
:E $game24 = $s endfunction
[ 21. September 2002, 23:28: Message edited by: Howard Bullock ]
|