#69795 - 2002-09-16 06:07 PM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
aha! The game is afoot. Now to trim some more...
Richard, do you have the proper out? [ 16. September 2002, 18:08: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#69796 - 2002-09-16 07:43 PM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
KixGolf v3.0.3 score = 413, running under KiXtart v4.10 KixGolf v3.0.3 score = 401, running under KiXtart v4.10 KixGolf v3.0.3 score = 377, running under KiXtart v4.10 KixGolf v3.0.3 score = 367, running under KiXtart v4.10 [ 16. September 2002, 21:36: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#69799 - 2002-09-16 11:08 PM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Jens, That invalidates my "first to post". I still have not found that combination. [ 16. September 2002, 23:08: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#69801 - 2002-09-16 11:22 PM
Re: KiXtart Golf V: Game24
|
Jack Lothian
MM club member
Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
|
I also get another inconsistency with Madruga's test script. His script gives:
In => 3, 3, 7, 7; Out => ( 3 + 3 / 7 ) * 7 = 21 => WRONG!!
Which is clearly incorrect.
You know, I have been playing with the math in Kixtart for almost 2 days non stop & I don't believe "execute", "val", "decimalnumber", "join", or "cdbl" generate consistent answers when you feed them various mixes of floating point numbers & integers. All seem to have some type of internal house cleaning rountines that convert all floating points that are integer values to integer values. Sometimes the results are downright bizarre & unpredicatable.
It is frustrating as hell & I had to fudge the math to make the routine work consistently.
Also, isn't adding zeros to output numbers inconsistent with the game's overall approach of dealing only with integers? My solution doesn't add zeros. [ 16. September 2002, 23:25: Message edited by: Jack Lothian ]
_________________________
Jack
|
Top
|
|
|
|
#69802 - 2002-09-16 11:52 PM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Although it appears that
$s = execute("$$v = 8.0/(3.0-8.0/3.0)") equals 24 try this: code:
$s = execute("$$v = 8.0/(3.0-8.0/3.0)") ? $v if $v=24 ? "hey this equals 24" else ? "wait a minute - this does not equal 24" endif
My code found this combination but did not see it as the correct answer. [ 16. September 2002, 23:57: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#69805 - 2002-09-17 12:20 AM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Not sure why this works:
code:
$s = Execute("$$v = 8.0/(3.0-8.0/3.0)") If cint($v)=24 ? "hey this equals 24" Else ? "wait a minute - this does not equal 24" EndIf
and this does not: code:
$s = Execute("$$v = 8.0/(3.0-8.0/3.0)") If $v=cdbl(24) ? "hey this equals 24" Else ? "wait a minute - this does not equal 24" EndIf
I guess changing to an INT just plain easier to do.. [ 17. September 2002, 00:36: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#69809 - 2002-09-17 01:31 AM
Re: KiXtart Golf V: Game24
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
Damn, I think I know what it is. Has anybody every heard of EPS?
EPS = Floating point relative accuracy. EPS is a permanent variable whose value is initially the distance from 1.0 to the next largest floating point number.
Basically, in order to display any give number in a discreet numbering system, it has to be converted into that numering system. And based on the number of bits used in that system you end up with a specific number which is the smallest number that can be displayed.
For example, assuming an integer numbering system, EPS equals 1 since the next higher number from 1 is 2. Any number in beweeen 1 and 2 that is to be converted to the integer system will thus end up being either 1 or 2. Which one it is, is being governed by conventions, e.g. IEEE definitions.
Another example, in Matlab, a mathematical scripting language, EPS=2.2204e-016 for floating point math. This means any number smaller than EPS cannot be displayed, it will either be rounded down to 0 or up to EPS. It also means that certain numbers cannot be displayed without some (small) loss. Thus, if I calculate 0.0001*3 - 0.0003 in discreet floating point math I will get a result of 5.4210e-020 and not '0'.
I hope everybody is still with me on this?
Anyway, I don't think there's anything we can do about this since it's a limitation of the underlying number conversion system.
_________________________
There are two types of vessels, submarines and targets.
|
Top
|
|
|
|
#69810 - 2002-09-17 01:38 AM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Now that this behavior has been defined, should we defined that the calculated value of the input be close to 24 within some specified range?
|
Top
|
|
|
|
#69812 - 2002-09-17 02:02 AM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
This fails: code:
$a='cdbl(8)/(cdbl(3)-cdbl(8)/cdbl(3))' $rc=execute('$$b='+$a) ? 'Result = '+$b ? 'Result = '+($b=24) ? 'Result = '+vartypename($b)
This works (in this case): code:
? 'Result = '+(cint($b)=24)
[ 17. September 2002, 02:04: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#69813 - 2002-09-17 02:07 AM
Re: KiXtart Golf V: Game24
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
This is obviously wrong but with CINT is passes: code:
$a='(cdbl(3)/cdbl(8))+cdbl(8)*cdbl(3)'
$rc=execute('$$b='+$a) ? 'Result = '+$b ? 'Result = '+(cint($b)=24) ? 'Result = '+vartypename($b)
[ 17. September 2002, 02:08: Message edited by: Howard Bullock ]
|
Top
|
|
|
|
#69814 - 2002-09-17 02:07 AM
Re: KiXtart Golf V: Game24
|
Fernando Madruga
Starting to like KiXtart
Registered: 2002-08-21
Posts: 149
Loc: Coimbra.Portugal.Europe.Earth....
|
Jack, I don't quite get it when you say: quote:
I also get another inconsistency with Madruga's test script. His script gives:
In => 3, 3, 7, 7; Out => ( 3 + 3 / 7 ) * 7 = 21 => WRONG!!
Which is clearly incorrect.
Why is that incorrect? If I use integer math, then 3 / 7 = 0, + 3 = 3, * 7 = 21... Have I forgotten something from school? Surelly that is not the intended result! You may be induced in error by the "WRONG!" part: it does not mean that the expression is wrong, it only means that that expression does not evaluate to the expected result of 24...
P.S.: I'm still trying to figure out a decent algorithm... When I do, I'll sure as hell post the results here... [ 17. September 2002, 02:08: Message edited by: Fernando Madruga ]
_________________________
Later,
[b]Mad[/b]ruga
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 868 anonymous users online.
|
|
|