Page 2 of 7 <12345>Last »
Topic Options
#69775 - 2002-09-15 07:40 PM Re: KiXtart Golf V: Game24
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I think that the first operator is actually not necessary since it will not produce distinct solutions that cannot be achieved by other permutations.
_________________________
There are two types of vessels, submarines and targets.

Top
#69776 - 2002-09-15 07:42 PM Re: KiXtart Golf V: Game24
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mmm...

I left out the first potential operator (which actually, as I thought of it, could be -)

then, situation with ()()()() is there for nothing, so didn't count that either...

the one part I don't get on the operator thing...
I got under 100 of them...

and paranthesis counted for 5 effective...
_________________________
!

download KiXnet

Top
#69777 - 2002-09-15 08:02 PM Re: KiXtart Golf V: Game24
Jack Lothian Offline
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
#69778 - 2002-09-15 08:11 PM Re: KiXtart Golf V: Game24
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I don't thnik you need to be concerned about repeat solutions, since I just want to have one valid solution returned. And whether that is (1+2+3)*4 or 1*2*3*4 or ((3+2)+1)*4 doesn't really matter.
_________________________
There are two types of vessels, submarines and targets.

Top
#69779 - 2002-09-15 08:17 PM Re: KiXtart Golf V: Game24
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ah, forgot one in the paranthesis part...

what comes to increase the size when only one output, I think it actually decreases the size by 2-10 strokes
_________________________
!

download KiXnet

Top
#69780 - 2002-09-15 08:28 PM Re: KiXtart Golf V: Game24
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Jens,

But maybe there are cases where only solution or worse none exist. To validate these cases the algorithm must contain loops that eliminate all possibilities.

Unless one has a proof that eliminates a permutation as always being a repeat you must code for all permutations. Stopping after finding your first solution requires an IF statement. Maybe someone could make a smaller algorithm that finds all solutions but doesn't contain the if statement.
_________________________
Jack

Top
#69781 - 2002-09-15 08:53 PM Re: KiXtart Golf V: Game24
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jack, why you should stop there?

just scan trough them all...
easy, I already have the finding part in simple loop.

I actually made a bad quess and I have to check it out.
it may run for days, but will work.
if I remember correctly, there is no time limit as long as it works, right? [Razz]
_________________________
!

download KiXnet

Top
#69782 - 2002-09-15 09:06 PM Re: KiXtart Golf V: Game24
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Nope, there's no time limit. However, I've found a website containing a Game24 solver written entirely in JavaScript. It spits out the solution nearly instantaneously, thus I would not expect KiXtart to run for days [Wink]

I'm leaving now, gonna play some Squash!
_________________________
There are two types of vessels, submarines and targets.

Top
#69783 - 2002-09-15 09:18 PM Re: KiXtart Golf V: Game24
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jens, it's just about different goals...

if you think there is nice source... 1000 strokes and such.
what if I can make it 200?
with just 500000 times longer run time...
_________________________
!

download KiXnet

Top
#69784 - 2002-09-15 09:35 PM Re: KiXtart Golf V: Game24
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Jens.

I presume this is the site.

24Game

It is actually tougher because it allows the 4 numbers to take on the values 1 though 13 & not 0 through 9. Also, for those interested he provides his source code. The solution is mainly in "solution.java" & "solution.class". Interesting!

This kind of strategy will find fast answers most of the time at the sacrifice of complex code.

Several of you have mentioned that your children are using the game at school. This site contains both an internet & standalone version.

PS. After looking over the above java code, I realized I forgot 1 type Parenthesis - i.e none what so ever so there are 15,232 permutations.

[ 16. September 2002, 01:34: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#69785 - 2002-09-16 12:10 AM Re: KiXtart Golf V: Game24
Howard Bullock Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69786 - 2002-09-16 02:05 AM Re: KiXtart Golf V: Game24
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Nice job, Howard!

You would get the First Scorer Award but for the fact that you did not return the formula. The rules state that $out should contain the formula or an empty string.

I guess, while we all were chatting away, you've been in stealth mode and coded [Big Grin]

[ 16. September 2002, 02:08: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#69787 - 2002-09-16 03:51 AM Re: KiXtart Golf V: Game24
Howard Bullock Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69788 - 2002-09-16 04:12 AM Re: KiXtart Golf V: Game24
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
[Smile] [Smile] Nice [Smile] [Smile]

Howard will receive the First Scorer Award.
_________________________
There are two types of vessels, submarines and targets.

Top
#69789 - 2002-09-17 12:40 AM Re: KiXtart Golf V: Game24
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
he migth even win the first period...

and we are still lacking the company of brian...
neither is fernando here.
_________________________
!

download KiXnet

Top
#69790 - 2002-09-17 12:43 AM Re: KiXtart Golf V: Game24
Howard Bullock Offline
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 ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69791 - 2002-09-16 03:42 PM Re: KiXtart Golf V: Game24
Fernando Madruga Offline
Starting to like KiXtart

Registered: 2002-08-21
Posts: 149
Loc: Coimbra.Portugal.Europe.Earth....
I've been busy! [Smile]

Just found out today.
Have some cinema to catch up later, but I'll try and give this a spin afterwards...

Later,
  Madruga

P.S.: I have a couple questions:
1) Any particular reason why we're using the "old" kixgolf3 ?
2) Shouldn't the test code include the proper :! before and after the function declaration?

[ 16. September 2002, 16:24: Message edited by: Fernando Madruga ]
_________________________
Later,   [b]Mad[/b]ruga

Top
#69792 - 2002-09-16 04:48 PM Re: KiXtart Golf V: Game24
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Fernando: If you have improvements to the KiXtart scoring script, then the posting of code might be better served in the scoring script thread since I will always reference that thread for the official scoring script.

[ 16. September 2002, 16:49: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#69793 - 2002-09-16 05:25 PM Re: KiXtart Golf V: Game24
Fernando Madruga Offline
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
#69794 - 2002-09-16 05:40 PM Re: KiXtart Golf V: Game24
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
KixGolf v3.0.3 score = 446, running under KiXtart v4.11 RC 1
Top
Page 2 of 7 <12345>Last »


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 496 anonymous users online.
Newest Members
Raoul, Timothy, Jojo67, MaikSimon, kvn317
17875 Registered Users

Generated in 0.153 seconds in which 0.105 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org