#69777 - 2002-09-15 08:02 PM
Re: KiXtart Golf V: Game24
|
Jack Lothian
MM club member
Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
|
Jens,
True, but in general, repeat solutions can not be so easily eliminated. So, if someone can put forward a logical position for dropping a permutation or class of permutation in the analysis, this is permitted in the contest? Validation of the resultants could be difficult.
Jooel,
Parenthesis permutations:
(n n n ) n n (n n n) (n n) n n n (n n) n n n (n n) (n n) (n n)
I got 128 operator permutations by:
2*4*4*4
but Jens' point reduces this to 4*4*4=64
thus my revised number is: 9,216.
Of course there will be many solutions that are effectively repeat solutions in these permutations. Maybe we could might try to identify methods that eliminate repeats?
Note, Jens, Commonsense says you are correct but can you put forward a proof of this point covering all permutations. The presence of divisions which are not transative and parenthesis makes this a more difficult proof than I orginally thought. [ 15. September 2002, 20:20: Message edited by: Jack Lothian ]
_________________________
Jack
|
Top
|
|
|
|
#69785 - 2002-09-16 12:10 AM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Game24 KiXtart Golf running under KiXtart v4.11
Numbers = 1, 2, 3, 4 Please doublecheck your solution to guarantee a correct result 24 = 24
Numbers = 2, 2, 6, 8 Please doublecheck your solution to guarantee a correct result 24 = 24
Numbers = 4, 4, 6, 6 Correct answer answer, there is no solution to this combination
Numbers = 3, 3, 8, 8 Correct answer answer, there is no solution to this combination
Numbers = 0, 3, 2, 0 No solution found <> 24
Numbers = 3, 4, 7, 7 Please doublecheck your solution to guarantee a correct result 24 = 24
Numbers = 1, 2, 8, 9 Please doublecheck your solution to guarantee a correct result 24 = 24
Time: 1683 ticks KixGolf score = 634 [ 16. September 2002, 00:37: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#69787 - 2002-09-16 03:51 AM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Sorry, returned the wrong variable.
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*(2.0+6.0)+8.0 = 24
Numbers = 4, 4, 6, 6 Correct answer answer, there is no solution to this combination
Numbers = 3, 3, 8, 8 Correct answer answer, there is no solution to this combination
Numbers = 0, 3, 3, 8 Please doublecheck your solution to guarantee a correct result (0.0/3.0)+(3.0*8.0) = 24
Numbers = 3, 4, 7, 7 Please doublecheck your solution to guarantee a correct result 3.0+(4.0*7.0)-7.0 = 24
Numbers = 1, 2, 8, 9 Please doublecheck your solution to guarantee a correct result (9.0-1.0)+(2.0*8.0) = 24
Time: 1152 ticks
KixGolf score = 632
{edit} KixGolf score = 518 {edit} KixGolf score = 488 {edit} KixGolf score = 470 {edit} KixGolf score = 469 [ 16. September 2002, 05:54: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#69788 - 2002-09-16 04:12 AM
Re: KiXtart Golf V: Game24
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
|
Top
|
|
|
|
#69790 - 2002-09-17 12:43 AM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I certainly don't want to be the ONLY participant. [ 16. September 2002, 12:44: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#69793 - 2002-09-16 05:25 PM
Re: KiXtart Golf V: Game24
|
Fernando Madruga
Starting to like KiXtart
Registered: 2002-08-21
Posts: 149
Loc: Coimbra.Portugal.Europe.Earth....
|
Updated test.kix for Game24.
Too many changes to list, but I think this one has a clear output, and it's a lot easier to add new test conditions...
Please *DO* test it and post any required fixes: haven't tested it enough...
code:
BREAK ON
Global $Target
$Target = 24
$rc=SETOPTION('Explicit','ON') $rc=SETOPTION('NoVarsInString','ON') $rc=SRND(@MSECS)
? 'Game24 KiXtart Golf running under KiXtart v'@KIX ? ''
test24(1,2,3,4,1) test24(2,2,6,8,1) test24(4,4,6,6,2) test24(3,3,8,8,2) test24(RND(9),RND(9),RND(9),RND(9),3) test24(3,4,7,7,1) test24(1,2,8,9,1) ? ""
; Inputs: $i1..$i4 => 4 numbers to pass to game24 ; $behaviour = 1 -> Expected result ; $behaviour = 2 -> Expected to fail ; $behaviour = 3 -> Don't know (random) function test24($i1,$i2,$i3,$i4,$behaviour) DIM $rc, $out, $result, $error, $str $str = 'In => '+$i1+', '+$i2+', '+$i3+', '+$i4+'; Out => ' $out=Game24($i1,$i2,$i3,$i4) $error=trim(Execute("$$result=("+$out+")")) if $result = $Target $str = $str + $out + " = " + $result else $str = $str + $out + " = " + $result endif if ( ($behaviour=1) and ($result=$Target) ) or ( ($behaviour=2) and ($result='') ) $str = $str + " => Correct!!" else if ( $behaviour = 3 ) $str = $str + " => Not sure..." else $str = $str + " => WRONG!!" endif endif ? $str endfunction
Dim $shellcommand $shellcommand='kix32 Kixgolf3.kix $f='+@scriptname ? $shellcommand Shell $shellcommand
;! function game24($a,$b,$c,$d) $game24="9*3-2-1";$a+$b+$c+$d endfunction ;! ;!
P.S. As sugested, I'll post the updated KixGolf script in the proper place. [ 16. September 2002, 17:51: Message edited by: Fernando Madruga ]
_________________________
Later,
[b]Mad[/b]ruga
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(mole)
and 405 anonymous users online.
|
|
|