Page 1 of 9 12345>Last »
Topic Options
#209044 - 2014-06-29 03:36 PM Kixgolf - Win, Win, or Draw - Private Round
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4521
Loc: USA
=============
The Challenge - Win, Win or Draw
=============

The Game of Win, Lose or Draw is a television show based on drawing something on a whiteboard and people guessing what it is. However, our game
is called Win, Win or Draw(WWD). There are no Losers here. WWD revolves around a value called a Digital Root. Like the Luhn Check (a previous
kixgolf challenge), the Digital Root can be used as a checksum. The Digital Root of a number is the single digit value obtained by an iterative
process of summing digits, on each iteration using the result from the previous iteration to compute a digit sum. The process continues until
a single-digit number is reached.

From this point forward, the Digital Root will be referred to as DR.

For example, the DR of 65536 is 7, because 6+5+5+3+6 = 25 and 2+5 = 7.
The DR of 1 is 1 because it is a single digit and does not need to be computed.
The DR of CAN is 9 because, 3+1+14 = 18 and 1+8 = 9.
The DR of BAT is 5 because, 2+1+20 = 23 and 2+3 = 5.

To play WWD, you must first determine the DR of each input value. Then you must determine which value is lower than the other. The lowest
DR Value WINS. In the event two DR Values are equal, the input value with the longer length WINS. In the event two DR Values are equal, and
have the same input value length, a DRAW will be given.


*-->A download is available at http://www.kixtart.org/forums/ubbthreads.php?ubb=download&Number=330

=============
Specification
=============


Determine the DR value of each string input. Compare the values, and determine the winner. Use the following rules:

When determining the DR
- To determine the DR, break down each string input into its parts. Add up the values. Repeat until the value is a single digit number.
- For Letters use A=1, B=2, C=3... Z=26.
- 0 is the lowest DR. No other input is less than 0.
- 0-9, A-Z and a-z will be the only letters included in the tests. Capitalization does not effect DR. hello=Hello=HELLO.

When comparing DRs
- Using a string of inputs, compare each string
- The lower the DR value the better.
- In the event two DR values are the same, the input with the longer length wins.
- In the event two DR values are the same, and the lengths are the same, a draw is declared.



=============
Inputs and Outputs
=============


Input
String of Items separated by a comma. The input can consist of 2 to many items.

Example Input: 9,5

Output
Winner: inputstring1=DR, inputstring2=DR, inputstringN=DR, Winner=LowestDRinputstring
Winner (same DR): inputstring1=DR, inputstring2=DR, inputstringN=DR, Winner=LowestDRinputstring
Draw (same DR and Length): inputstring1=DR, inputstring2=DR, inputstringN=DR, Draw

Example Win Output: can=9, bat=5, Winner=bat
Example Draw Output: no=2, no=2, Draw

=================================================================
Notes
================================================================

- The scoring engine has added code to help diagnose which cases are failing. To see test case results:
 Code:
   kix32 kixgolf_wwd $verbose=1 ;shows failing results
   kix32 kixgolf_wwd $verbose=2 ;shows all results

- The scoring engine expects your (primary) function to be named a().


=======
Scoring
=======


The solution must pass all tests in order for it's KiXgolf Score to be considered.

When posting KiXtart Golf Scores, please include the KIXGOLF_*.TXT file that is created in the script directory. It contains some basic information about the computer that the script is run on and the resulting scores.

============
Test program
============


Test cases are provided to help screen entries and to provide the Golf Score.
Any script that passes the test cases can be submitted. If you are surprised that your solution passed the test cases, please submit it anyway! That will help me identify bugs in the test program.

================================================================
KiXtart GOLF - How To Play
================================================================


Most importantly, anybody can play, no age restrictions, no penalties, no handicap!

The object in "real" golf is to hit the ball in the hole in the fewest strokes. The object in KiXtart Golf is to get from input (tee) to target (hole) in the fewest keystrokes.

Example: How many positive elements are in array $a?

Array $a could be of structure $a=[1, 2 ,-3, 4, -5, -7, 8, 9]

One approach:
 Code:
for $b=0 to ubound($a)
  if $a[$b]>0
    $c=$c+1
  endif
next

for a score of 45.

Another solution is:
 Code:
DO
  $b=$b+1
  if $a[$b]>0
    $c=$c+1
  endif
UNTIL $b>(UBOUND($a)+1)

for a score of 53.

Better approach: Code sample 1

================================================================
KiXtart GOLF - The Rules
================================================================


1) The goal of KiXtart Golf is to score the lowest strokes.
2) Strokes are all characters in a piece of code except whitespace characters, unless the whitespace character is necessary for the line of code to work. Therefore, carriage returns and line feeds do not count or spaces in between the '=' sign when assigning variables, e.g. '$a = $b' scores 5.
3) Code can be constructed any way you like, as long as it does not generate syntax or other errors when running the script in KiXtart.
4) The final solution MUST pass all test scripts that are part of the KiXtart golf challenge.
7) During the private coding phase, no code is allowed to be posted. Violations result in disqualification of said player.
8) During the public coding phase, code should be posted, reused, and borrowed from other players.
9) The test script contains the official KiXgolf scoring engine
10) Only the person posting a particular score will be recognized for the score, unless the KiXtart Golf Challenge organizer or another delegate posts code on behalf of a player
11) KiXtart Golf (a.k.a KiXgolf) codes must be written inside the KiXgolf UDF collection tags, ';!' and ';!;!'
12) Parameter names of the UDF's can be changed and additional optional parameters can be added.
13) Additional helper UDFs and code can be written as long as they reside inside the ';!' and ';!;!' tags.
14) The use of '$' as a variable is allowed.
15) The UDF layout is up to coder.
16) The UDF is expected to finish in a reasonable time, that is, on modern computers inside 1 hour timeframe.
17) You can submit scores as often as you want.
18) If you reach leading score, you are obligated to post your score immediately so others can try to compete with you.
19) The UDF may only use the KiXtart/KiXforms commands/functions/macros, no other code fragments are allowed.
20) Calls to COM components that are part of a standard default Windows installation are allowed.
21) The use of the KiXforms DLL is also permitted as the KiXforms DLL can now be considered an integral part of KiXtart scripting.
22) Calls to other executables, as long as they are part of a standard default Windows installation are allowed.
23) The UDF should be self-contained (except for any I/O mentioned in the challenge). In particular, you may not do things like fetching extra data from a remote site or file.
24) You may assume ASCII as character set.
25) You may use block comments as the KiXgolf Scoring Engine now supports block comments.
26) You are allowed to only use publicly available versions of KiXtart and KiXforms, private builds or alpha builds are NOT allowed.
27) Your submitted score must include the result print of the KiXgolf test-engine.
28) The SETOPTION() parameters in the KiXgolf script may not be modified and will govern the script behavior. SETOPTION() parameters may change depending on the particular needs of the KiXgolf challenge.
29) Tokenizing the UDF, script, or portions thereof is not allowed.
30) If something is not explicitly denied by the rules, it's allowed.
31) If Confusion arises, arranger of the KiXgolf round has the final say.
32) Additional test cases can be added at any time during the KiXgolf round. The code is expected to pass based on the rules. The test cases may not include tests for all rules and exceptions. Test cases that are added during the public round will not alter the results of the private round.


================================================================
KiXtart GOLF - The Duration of the Competition
================================================================


1) Private coding phase: 2014-06-29 to 2014-07-06 (Official Count down clock will determine end time)

2) Public coding phase: 2014-07-06 to 2014-07-13

3) Final results: 2014-07-13


*--> You will need the complete package from http://www.kixtart.org/forums/ubbthreads.php?ubb=download&Number=330 .




Attachments
kixgolf_wwd.zip (264 downloads)
Description:



Top
#209045 - 2014-06-29 03:36 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4521
Loc: USA
Ended

Edited by Allen (2014-07-13 05:30 PM)

Top
#209046 - 2014-06-29 08:13 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Allen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
ok, downloaded.
Seems to hold a ton of strokes on first thought.

Tricky..
_________________________



Top
#209047 - 2014-06-29 09:00 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Very tricky ... Nice one Allen.
Tee-off not expected today \:\)
_________________________



Top
#209048 - 2014-06-29 09:13 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Jochen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4521
Loc: USA
I've added another case and updated the zip.

 Code:
[Test25]
Input=eleven,thirteen,three,seven,zero
Output=eleven=9, thirteen=9, three=2, seven=2, zero=1, Winner=zero

Top
#209049 - 2014-06-29 09:20 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4521
Loc: USA
I think once you get going you won't think its all that tricky. \:\)
Top
#209050 - 2014-06-29 09:25 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Allen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
yeah probably,
but more tomorrow ;\)
_________________________



Top
#209051 - 2014-06-29 09:36 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
One Question though:

How is KixGolf=3 possible?

K = 11
i = 9
x = 24
G = 7
o = 15
l = 12
f = 6

== 84
8+4 = 12

Do I miss something here?

_________________________



Top
#209052 - 2014-06-29 09:37 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Jochen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4521
Loc: USA
Yup... 12 is not a single digit number... 1+2=3
Top
#209053 - 2014-06-29 09:38 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Allen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany


Ok, even more tricky \:\)
_________________________



Top
#209054 - 2014-06-29 10:46 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Jochen]
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
getting there...got the right numbers but need to go back find the winner/draw now...
_________________________
Eric

Top
#209055 - 2014-06-29 11:26 PM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: maciep]
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
ugly but functional...

 Code:
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_wwd.kix
Scoring Engine   = 3.3
OS               = Windows 6.2 / 1
CPU              = Intel Pentium III Xeon
Speed            = 2195 MHz
Memory           = 4096 MB

Tournament       = Win, Win or Draw
Processing Start = 2014/06/29 17:25:48.123
Processing End   = 2014/06/29 17:25:48.137
Duration         = 0000/00/00 00:00:00.014
# Tests Run      = 25
# Tests Passed   = 25
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 366
_________________________
Eric

Top
#209056 - 2014-06-30 12:08 AM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: maciep]
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
Still pretty ugly, but good enough for day 1...

 Code:
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_wwd.kix
Scoring Engine   = 3.3
OS               = Windows 6.2 / 1
CPU              = Intel Pentium III Xeon
Speed            = 2195 MHz
Memory           = 4096 MB

Tournament       = Win, Win or Draw
Processing Start = 2014/06/29 18:07:40.888
Processing End   = 2014/06/29 18:07:40.902
Duration         = 0000/00/00 00:00:00.014
# Tests Run      = 25
# Tests Passed   = 25
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 331
_________________________
Eric

Top
#209057 - 2014-06-30 12:17 AM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: maciep]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4521
Loc: USA
Awesome. I always sweat out the first submission, thinking I have a bug in code/ini.

\:\)

Top
#209058 - 2014-06-30 08:55 AM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: maciep]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Nice Tee-Off Eric,
don't think that I can start anywhere near this score..

Well, lets see
_________________________



Top
#209059 - 2014-06-30 10:46 AM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
See?

# Tests Run = 25
# Tests Passed = 25
# Tests Failed = 0
Result = Passed
KiXGolf Score = 450
_________________________



Top
#209060 - 2014-06-30 10:57 AM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
437 436 435

Edited by Jochen (2014-06-30 11:02 AM)
_________________________



Top
#209061 - 2014-06-30 11:19 AM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Baby steps


# Tests Run = 25
# Tests Passed = 25
# Tests Failed = 0
Result = Passed
KiXGolf Score = 431


_________________________



Top
#209062 - 2014-06-30 11:23 AM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
429
_________________________



Top
#209063 - 2014-06-30 11:28 AM Re: Kixgolf - Win, Win, or Draw - Private Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Better


# Tests Run = 25
# Tests Passed = 25
# Tests Failed = 0
Result = Passed
KiXGolf Score = 411


still ugly
_________________________



Top
Page 1 of 9 12345>Last »


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

Who's Online
0 registered and 241 anonymous users online.
Newest Members
Thechadpma, CestMoi, MeMyselfAndI, Praveer, Ollero
17745 Registered Users

Generated in 0.045 seconds in which 0.013 seconds were spent on a total of 15 queries. Zlib compression enabled.

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