Page 1 of 2 12>
Topic Options
#191341 - 2008-12-20 01:59 PM KiXgolf - Instruens Fabulam
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
=============
The Challenge - Instruens Fabulam
=============


Instruens Fabulam means drawing a chart (or table) in Latin. That's what you will do for this problem.

Example:
Format
 Code:
<>=>


Input
 Code:
TITLE&VERSION&OPERATING SYSTEM&PRICE
Slug Farm&2.0&FreeBSD&49.99
Figs of Doom&1.7&Linux&9.98
Smiley Goes to Happy Town&11.0&Windows&129.25
Wheelbarrow Motocross&1.0&BeOS&34.97


Output
 Code:
@-----------------------------------------------------------------@
| TITLE                     | VERSION | OPERATING SYSTEM |  PRICE |
|---------------------------+---------+------------------+--------|
| Slug Farm                 |     2.0 |     FreeBSD      |  49.99 |
| Figs of Doom              |     1.7 |      Linux       |   9.98 |
| Smiley Goes to Happy Town |    11.0 |     Windows      | 129.25 |
| Wheelbarrow Motocross     |     1.0 |       BeOS       |  34.97 |
@-----------------------------------------------------------------@


A download is available at http://s91376351.onlinehome.us/kixtart/kixgolf_if.zip

=============
Inputs
=============

The input consists of a table format description, plus a input string consisting of two or more lines of text. Each table format contains one or more characters that define the number and alignment of columns in the table. Each character in the table format line is either '<', '=', or '>', and indicates a left-justified, centered, or right-justified column. The input string contains at least two and at most 21 data lines that contain the entries for each row. Each data line consists of one or more nonempty entries separated by an ampersand ('&'), where the number of entries is equal to the number of columns defined in the header line. The first data line contains entries for the column titles, and the remaining data lines contain entries for the body of the table. Spaces may appear within an entry, but never at the beginning or end of an entry. The characters '/', '<', '=', '>', '&', and '*' will not appear in the input except where indicated above.

=============
Outputs
=============


For each table description, output the table using the exact format shown in the example. Note that
  • The total width of the table will never exceed 79 characters (not counting end-of-line).
  • Dashes ('-') are used to draw horizontal lines, not underscores ('_'). 'At' signs ('@') appear at each of the four outer corners. Plus signs ('+') appear at intersections within the line separating the title from the body.
  • The largest entry in a column is always separated from the enclosing bars ('|') by exactly one space.
  • If a centered entry cannot be exactly centered within a column, the extra space goes on the right of the entry.


Output rows are separated via the CRLF line termination.


=======
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: 2008-12-20 to 2008-12-26

2) Public coding phase: 2008-12-27 to 2009-01-09

3) Final results: 2009-01-10

You will need the complete package from http://s91376351.onlinehome.us/kixtart/kixgolf_if.zip.


Edited by Sealeopard (2008-12-22 02:32 PM)
_________________________
There are two types of vessels, submarines and targets.

Top
#191354 - 2008-12-21 09:02 AM Re: KiXgolf - Instruens Fabulam [Re: Sealeopard]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
This one should have been called "Easier said than done" \:\)

My code is a mess, but I am getting there.

Top
#191356 - 2008-12-21 09:27 AM Re: KiXgolf - Instruens Fabulam [Re: Allen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
line length must not exceed 79 chars.

well, what we do with the extra?
if the data is too long, do we use multi-line cells or do we truncate the data?
or don't we need to care?
_________________________
!

download KiXnet

Top
#191357 - 2008-12-21 02:46 PM Re: KiXgolf - Instruens Fabulam [Re: Lonkero]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
The line length will not exceed 79 characters as the input data will be short enough to accommodate this. Therefore, you do not need to perform length checking of 79+ characters.
_________________________
There are two types of vessels, submarines and targets.

Top
#191358 - 2008-12-21 03:59 PM Re: KiXgolf - Instruens Fabulam [Re: Sealeopard]
Lonkero Administrator Offline
KiX Master Guru
*****

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

also, I do not see you say it anywhere, but / is the line delimeter?
or why it's reserved character?
_________________________
!

download KiXnet

Top
#191359 - 2008-12-21 04:45 PM Re: KiXgolf - Instruens Fabulam [Re: Lonkero]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
The back-slash "/" character is used as the line terminator inside the .INI file. It is then replaced by a CRLF to build the correct line termination for the solution comparison.

Edited by Sealeopard (2008-12-21 06:54 PM)
_________________________
There are two types of vessels, submarines and targets.

Top
#191361 - 2008-12-21 06:33 PM Re: KiXgolf - Instruens Fabulam [Re: Sealeopard]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok.
got confused by this statement:
 Quote:

The characters '/', '<', '=', '>', '&', and '*' will not appear in the input except where indicated above.
_________________________
!

download KiXnet

Top
#191368 - 2008-12-22 04:57 AM Re: KiXgolf - Instruens Fabulam [Re: Lonkero]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
Ughhh... I'm this far. (if only the data could look like this...)

 Code:
[TITLE                    ][VERSION][OPERATING SYSTEM][ PRICE]
[Slug Farm                ][    2.0][     FreeBSD    ][ 49.99]
[Figs of Doom             ][    1.7][      Linux     ][  9.98]
[Smiley Goes to Happy Town][   11.0][     Windows    ][129.25]
[Wheelbarrow Motocross    ][    1.0][      BeOS      ][ 34.97]

... I guess I'll work on the table lines tomorrow.

Has anyone else started?

Top
#191369 - 2008-12-22 05:49 AM Re: KiXgolf - Instruens Fabulam [Re: Allen]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Have not even thought about it. Bad week to be thinking of Golf, what with 3 8 year olds, a Mother in Law, and my parents all in the same house.... UGH..... No rest for me. Luckily I do get to go to work a few days this next week.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#191372 - 2008-12-22 11:52 AM Re: KiXgolf - Instruens Fabulam [Re: Gargoyle]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I've got a working solution not golfed yet, unfortunately the test results are wrong:
 Quote:
KiXtart
KiXtart Version = 4.60
KiXGolf Script = kixgolf_if.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium Model 14
Speed = 1995 MHz
Memory = 2048 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Instruens Fabulam
Processing Start = 2008/12/22 10:44:26.580
Processing End = 2008/12/22 10:44:26.643
Duration = 0000/00/00 00:00:00.062
KiXGolf Score = 711

Thank you for participating in KiXtart Golf!


There are two problems with the results.
  1. Test #1 - the extra space in the centred OS column is on the left, the rules say it should be on the right.
  2. Test #4 - The column title does not follow the format - is is cented, not right justified.

Top
#191373 - 2008-12-22 12:04 PM Re: KiXgolf - Instruens Fabulam [Re: Richard H.]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Golfing begins, fixed ".ini" file attached.
 Quote:
KiXGolf Score = 684

 Quote:
KiXGolf Score = 679

 Quote:
KiXGolf Score = 673

 Quote:
KiXGolf Score = 639

 Quote:
KiXGolf Score = 624

 Quote:
KiXGolf Score = 618

 Quote:
KiXGolf Score = 614


Woohoo! Got it under 600!
 Quote:
Running Test 1...Done
Running Test 2...Done
Running Test 3...Done
Running Test 4...Done
Your solution passed all tests

KiXtart
KiXtart Version = 4.60
KiXGolf Script = kixgolf_if.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium Model 14
Speed = 1995 MHz
Memory = 2048 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Instruens Fabulam
Processing Start = 2008/12/22 12:51:45.192
Processing End = 2008/12/22 12:51:45.239
Duration = 0000/00/00 00:00:00.046
KiXGolf Score = 586

Thank you for participating in KiXtart Golf!


Attachments
kixgolf_if.ini (124 downloads)
Description: Patched INI file




Edited by Richard H. (2008-12-22 01:55 PM)
Edit Reason: Updated scores

Top
#191375 - 2008-12-22 02:33 PM Re: KiXgolf - Instruens Fabulam [Re: Richard H.]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Richard: Thanks for finding these issues. I've posted a corrected package. The .INI file should now be correct.
_________________________
There are two types of vessels, submarines and targets.

Top
#191389 - 2008-12-23 04:37 PM Re: KiXgolf - Instruens Fabulam [Re: Sealeopard]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Ok, here's my tee off (with the latest test ini)

 Code:
Your solution passed all tests

KiXtart
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_if.KIX

Computer
OS               = Windows Vista Business Edition
CPU              = Intel Pentium Model 15
Speed            = 2194 MHz
Memory           = 2038 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Instruens Fabulam
Processing Start = 2008/12/23 16:34:09.847
Processing End   = 2008/12/23 16:34:09.863
Duration         = 0000/00/00 00:00:00.015
KiXGolf Score    = 883

Thank you for participating in KiXtart Golf!


I've got room to improve, but I'll wait with that until my braincells are calmed down a bit


Edited by DrillSergeant (2008-12-23 04:38 PM)
_________________________
The Code is out there

Top
#191390 - 2008-12-23 04:41 PM Re: KiXgolf - Instruens Fabulam [Re: DrillSergeant]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
ok here is my Tee Off: 770
 Code:
Your solution passed all tests

KiXtart
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_if.kix

Computer
OS               = Windows Vista Business Edition
CPU              =               Intel(R) Pentium(R) D CPU 3.20GHz
Speed            = 3200 MHz
Memory           = 2046 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Instruens Fabulam
Processing Start = 2008/12/23 09:40:00.014
Processing End   = 2008/12/23 09:40:00.043
Duration         = 0000/00/00 00:00:00.028
KiXGolf Score    = 770

Thank you for participating in KiXtart Golf!
Press any key to continue...
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#191391 - 2008-12-23 04:54 PM Re: KiXgolf - Instruens Fabulam [Re: Benny69]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Can't... rest... have...to...play...

Took out a big useless chunk

 Code:
Your solution passed all tests

KiXtart
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_if.KIX

Computer
OS               = Windows Vista Business Edition
CPU              = Intel Pentium Model 15
Speed            = 2194 MHz
Memory           = 2038 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Instruens Fabulam
Processing Start = 2008/12/23 16:51:59.631
Processing End   = 2008/12/23 16:51:59.646
Duration         = 0000/00/00 00:00:00.014
KiXGolf Score    = 762

Thank you for participating in KiXtart Golf!
_________________________
The Code is out there

Top
#191392 - 2008-12-23 05:14 PM Re: KiXgolf - Instruens Fabulam [Re: DrillSergeant]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Coming down!

 Code:
Your solution passed all tests

KiXtart
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_if.KIX

Computer
OS               = Windows Vista Business Edition
CPU              = Intel Pentium Model 15
Speed            = 2194 MHz
Memory           = 2038 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Instruens Fabulam
Processing Start = 2008/12/23 17:12:44.909
Processing End   = 2008/12/23 17:12:44.925
Duration         = 0000/00/00 00:00:00.016
KiXGolf Score    = 705

Thank you for participating in KiXtart Golf!
_________________________
The Code is out there

Top
#191393 - 2008-12-23 05:53 PM Re: KiXgolf - Instruens Fabulam [Re: DrillSergeant]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
687
 Code:
Running Test 4...Done
Your solution passed all tests

KiXtart
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_if.kix

Computer
OS               = Windows Vista Business Edition
CPU              =               Intel(R) Pentium(R) D CPU 3.20GHz
Speed            = 3200 MHz
Memory           = 2046 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Instruens Fabulam
Processing Start = 2008/12/23 10:52:25.978
Processing End   = 2008/12/23 10:52:25.993
Duration         = 0000/00/00 00:00:00.014
KiXGolf Score    = 687

Thank you for participating in KiXtart Golf!
Press any key to continue...
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#191394 - 2008-12-23 08:02 PM Re: KiXgolf - Instruens Fabulam [Re: Benny69]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Four!

 Code:
Your solution passed all tests

KiXtart
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_if.KIX

Computer
OS               = Windows Vista Business Edition
CPU              = Intel Pentium Model 15
Speed            = 2194 MHz
Memory           = 2038 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Instruens Fabulam
Processing Start = 2008/12/23 20:00:23.970
Processing End   = 2008/12/23 20:00:23.985
Duration         = 0000/00/00 00:00:00.014
KiXGolf Score    = 616

Thank you for participating in KiXtart Golf!
_________________________
The Code is out there

Top
#191395 - 2008-12-23 08:29 PM Re: KiXgolf - Instruens Fabulam [Re: DrillSergeant]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
yeah!

 Code:
Your solution passed all tests

KiXtart
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_if.KIX

Computer
OS               = Windows Vista Business Edition
CPU              = Intel Pentium Model 15
Speed            = 2194 MHz
Memory           = 2038 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Instruens Fabulam
Processing Start = 2008/12/23 20:28:02.500
Processing End   = 2008/12/23 20:28:02.516
Duration         = 0000/00/00 00:00:00.016
KiXGolf Score    = 597

Thank you for participating in KiXtart Golf!
_________________________
The Code is out there

Top
#191396 - 2008-12-23 09:15 PM Re: KiXgolf - Instruens Fabulam [Re: DrillSergeant]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
playin through!

 Code:
Your solution passed all tests

KiXtart
KiXtart Version  = 4.60
KiXGolf Script   = kixgolf_if.KIX

Computer
OS               = Windows Vista Business Edition
CPU              = Intel Pentium Model 15
Speed            = 2194 MHz
Memory           = 2038 MB

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Instruens Fabulam
Processing Start = 2008/12/23 21:13:54.734
Processing End   = 2008/12/23 21:13:54.765
Duration         = 0000/00/00 00:00:00.031
KiXGolf Score    = 582

Thank you for participating in KiXtart Golf!
_________________________
The Code is out there

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 465 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.084 seconds in which 0.03 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