Page 1 of 14 12345>Last »
Topic Options
#183413 - 2007-12-08 12:36 AM KiXgolf 2007: Taunt Generator - Private Round
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
X-Mas Present!: Private coding extended to December 16!
Your repulsive steed masquerades as a ill-tempered coconut!

=============
The Challenge: Taunt Generator
=============


In all the annals of knighthood, no personality trait has been in more dire need than the fortitude to withstand the diplomatically deleterious effects of a vicious, relentless taunting. Tasked with strengthening the mental endurance of Camelot's knights, King Arthur's court decided that instructional taunting must be applied, yet it could not be delivered by the chivalrous administration.

Thus, Sir Lancelot commanded a local anarcho-syndicalist peasant to write a program that generates taunts (a.k.a. mudslinging) thereby producing a script to test the patience of knights in a training environment. To prevent unbridled creativity in taunting from spoiling the otherwise stately proceedings of a nobleman’s education, the following rules designed by committee (The Round Table) must be adhered to:
 Quote:

<taunt> ::= <sentence> | <taunt> <sentence> | <noun>! | <sentence>
<sentence> ::= <past-rel> <noun-phrase> | <present-rel> <noun-phrase> | <past-rel> <article> <noun>
<noun-phrase> ::= <article> <modified-noun>
<modified-noun> ::= <noun> | <modifier> <noun>
<modifier> ::= <adjective> | <adverb> <adjective>
<present-rel> ::= your <present-person> <present-verb>
<past-rel> ::= your <past-person> <past-verb>
<present-person> ::= steed | king | first-born
<past-person> ::= mother | father | grandmother | grandfather | godfather
<noun> ::= hamster | coconut | duck | herring | newt | peril | chicken | vole | parrot | mouse | twit
<present-verb> ::= is | "masquerades as"
<past-verb> ::= was | personified
<article> ::= a
<adjective> ::= silly | wicked | sordid | naughty | repulsive | malodorous | ill-tempered
<adverb> ::= conspicuously | categorically | positively | cruelly | incontrovertibly


Please note that "::=" denotes "is defined as" and "|" denotes an OR. Thus, a "past-verb" is defined as either the word "was" or the word "personified".

Note that all phrases in double quotes are to be treated as one word for taunt simulation output. The number of taunts elicited at any given time is derived from the number of words spoken by the knight. For every three words (or fraction thereof) delivered by the knight, the generator produces one or more taunts in a theater-style script format. In the event that 2 taunts must be produced on a single line, they will be counted as 2 taunts towards the total required. By a mandate from the masses, a word will always contain at least one alphabetic character, and will be separated from other words by at least 1 space. In exception to the above rules, whenever the program finds the holy grail, which is to say, the letters t-h-e-h-o-l-y-g-r-a-i-l (case insensitive) in that order in a line of input, then the first taunt generated will be displayed by the program as "(A childish hand gesture)".

To ensure all royal quality assurance criteria are met, the program must be demonstrated by a simulation showing the taunts produced from a series of inputs. Each taunt is generated by applying the taunt generation rules until all of the <...> have been replaced with appropriate words.

In most cases, you will face a choice of alternate rules for expanding a phrase name.In these cases, you should make a choice as follows: Suppose that this is the kth such choice that you have faced for that rule since the start of program execution, and that you must choose one of n rules for expanding a given kind of phrase. Let the rules for that phrase be numbered from 1...n in the order of appearance above, and then choose rule number ((k-1) mod n) + 1.

Well, get on with it!


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

=============
Inputs & Outputs
=============


Input: The input will consist of an array with an unspecified number of lines (elements). Each line will contain a statement uttered by a knight consisting of letters, digits, the characters ",.-!?" and the space character. Each line of input will be more than 1 character and less than 72 characters in length. All words will be separated by space characters. Each statement will contain at least one word.

Output: For every line of input, generate a block of output containing the following:
  • A single line containing "Knight:", a space, and the input. Any appearance of space characters inside the input will be replaced by a single space.
  • All taunts (as explained in the above rules) prefaced by "Taunter:" and a space, the taunt, and a period. Each word should be separated from neighboring words by a single space. One taunt per line.
  • A blank line

Each taunt should begin with a capital letter, and no extra characters should be added.

Thus, the input will be an array of lines. The output will then be an array of lines as well.

Sample Input
Hello!
Are you feeling alright?
Is there someone else I could talk to?
Anyone at all?
We seek the holy grail . . .

Sample Output
Knight: Hello!
Taunter: Your mother was a hamster.

Knight: Are you feeling alright?
Taunter: Coconut! Your steed is a silly duck.

Knight: Is there someone else I could talk to?
Taunter: Your father personified a herring.
Taunter: Your grandmother was a newt.
Taunter: Peril! Your king masquerades as a conspicuously wicked chicken.

Knight: Anyone at all?
Taunter: Your grandfather personified a vole.

Knight: We seek the holy grail . . .
Taunter: (A childish hand gesture).
Taunter: Your godfather was a parrot.

=======
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 during the private round by submitting a proposal for a new test case to the BBS. The proposed test case becomes official once it has been added to the existing test cases and the KiXgolf package has been reposted for download. If new test cases are added within 12 hours of private round end the private round will extend by an additional 24 hours. The public round will then start one day later and also end one day later. Not additional test cases will be added during the public round.


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


1) Private coding phase: From date/time of posting the tournament challenge to Sunday, December 16 10pm EST (BBS+6 time)

2) Public coding phase: From Sunday, December 16 10pm EST (BBS+6 time) to Wednesday, December 19, 10pm EST (BBS+6 time)

3) Final results: Thursday, December 20

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


Edited by Sealeopard (2007-12-08 08:41 PM)
_________________________
There are two types of vessels, submarines and targets.

Top
#183414 - 2007-12-08 12:43 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Sealeopard]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4549
Loc: USA
WTF?
Top
#183415 - 2007-12-08 01:02 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Allen]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
My head hurts already
_________________________
Today is the tomorrow you worried about yesterday.

Top
#183416 - 2007-12-08 02:54 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Gargoyle]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Second link in description has been corrected.
_________________________
There are two types of vessels, submarines and targets.

Top
#183419 - 2007-12-08 09:37 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Allen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
 Originally Posted By: Allen
WTF?


Your hovercraft is full of eels
_________________________



Top
#183421 - 2007-12-08 02:22 PM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Jochen]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
Jochen, I think the proper responce to Allen:
 Originally Posted By: Allen
WTF?


Would be:
 Originally Posted By: Jochen
Knight: WTF?
Taunter: Your mother was a hamster.
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#183423 - 2007-12-08 02:28 PM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Benny69]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Would you guys like to accept a Chrismas present in the form of extending the private round until Sunday night with the public round then ending on the following Wednesday night?

Also, a preemptive clarification: The counter rule for the program execution applies to everything that happens inside the UDF. Thus, if you feed a five line array into the UDF, the first line would the the first execution of the program, the second line would be a second execution of the program. If there would be a second test case, then the counting inside the UDF would start all over.


Edited by Sealeopard (2007-12-08 02:31 PM)
_________________________
There are two types of vessels, submarines and targets.

Top
#183427 - 2007-12-08 08:17 PM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Sealeopard]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
I would be very thankful for this present Jens!

Still have problems understanding the rules (logically), including the translation of single words of it to german \:\) , though, I have not started to think it over seriously as for the weekend mind state

Dale, you seem to got the rules right already?
_________________________



Top
#183428 - 2007-12-08 08:37 PM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Jochen]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Jochen: I wouldn't so much worry about the translation of the words. All the rules you see are essentially mathematical equations where some of the variables would need to be replaced by other variables.
For the "Hello!" it works as follows:
Knght: Hello! (three words or less, thus just one taunt)
Taunter:
<taunt>
= <sentence>
= <past-rel> <noun-phrase>
= your <past-person> <past-verb> <article> <modified-noun>
= your mother was a <noun>
= your mother was a hamster

For each of the rules we have k=1 becuase it's the first line we're feeding into the taunt generator, thus n=1, namely th first fo the choices in all of the rules.
_________________________
There are two types of vessels, submarines and targets.

Top
#183430 - 2007-12-08 10:38 PM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Sealeopard]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
uhm... a single test with zillion tests inbuilt? hmm...
_________________________
!

download KiXnet

Top
#183434 - 2007-12-09 03:18 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Lonkero]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I had to redesign the test cases a bit after everybody was against allowing a global variable as part of the KiXgolf UDF. Somehow, you need to track how much the knight has spoken already, thus I moved that tracking into the UDF itself as well. Plus the sequence of knight and taunter are dependent, thus the test cases would not have been independent of each other.

If you wish, I have a second test case consisting of 8500 lines of Knight-speak resulting in 31463 lines of Knight-Taunter banter \:\)

Let me start preparing that test case now...


Edited by Sealeopard (2007-12-09 03:21 AM)
_________________________
There are two types of vessels, submarines and targets.

Top
#183435 - 2007-12-09 03:44 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Sealeopard]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
so we need to start over?
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#183436 - 2007-12-09 04:20 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Benny69]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
No, you do not. I just tried ot explain to Jooel why there is only one test case with multiple tests embedded. The original, unposted version of the taunt generator was using each sentence of the knight as it's own test case. However, it works better if the complete knight-speak is considered only a single test case input.
_________________________
There are two types of vessels, submarines and targets.

Top
#183449 - 2007-12-10 12:50 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Sealeopard]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
Ok, I know its a !#%&@$^ PIG but, First Tee and it is working

Your solution passed all tests

KiXtart
KiXtart Version = 4.60
KiXGolf Script = kixgolf_tg.kix

Computer
OS = Windows Vista Ultimate Edition
CPU = Intel(R) Pentium(R) D CPU 2.80GHz
Speed = 2792 MHz
Memory = 2048 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Taunt Generator
Processing Start = 2007/12/09 17:46:35.228
Processing End = 2007/12/09 17:46:35.263
Duration = 0000/00/00 00:00:00.034
KiXGolf Score = 3944

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
#183451 - 2007-12-10 02:22 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Benny69]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Congratulations to Benny on his feat \:\)

So, where are the others? Below 10,000 I hope?
_________________________
There are two types of vessels, submarines and targets.

Top
#183452 - 2007-12-10 03:01 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Sealeopard]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Well done Benny.
Top
#183453 - 2007-12-10 04:27 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Shawn]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Congrats Benny, I have not even started yet. Have the idea what needs to be done, but not even a single stroke as of yet.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#183454 - 2007-12-10 09:18 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Gargoyle]
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Ok, I'm trying to warp my mind to get around this...

example one:
 Code:
Knight: Hello!

result: <sentence>
result: <past-rel>                     <noun-phrase>
result: your <past-person> <past-verb> <article> <modified-noun>
result: your mother        was         a         <noun>
result: your mother        was         a         hamster

Taunter: Your mother was a hamster.


Ok, I got that one (I think). Now the next one:

 Code:
Knight: Are you feeling alright?

result: <sentence> | <tount> <sentence>

Taunter: Coconut! Your steed is a silly duck.


I don't get why the taunt is made up of <noun>! | <sentence> instead of <sentence | <tount> <sentence>.

Does my question make sense? Because if it doesn't, I think I'm really losing my mind


* Me slaps Benny with a cod for already posting a valid score \:o
_________________________
The Code is out there

Top
#183455 - 2007-12-10 09:34 AM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Benny69]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
 Originally Posted By: Benny69
Ok, I know its a !#%&@$^ PIG but, First Tee and it is working

KiXGolf Score = 3944



A Pig??? I coded a complete Tetris Game with less strokes :o (edit: somehow I mixed up strokes with lines, sorry )
Congrats for the tee-off Dale


Edited by Jochen (2007-12-10 11:22 AM)
_________________________



Top
#183458 - 2007-12-10 01:53 PM Re: KiXgolf 2007: Taunt Generator - Private Round [Re: Jochen]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
so as to not scare people too much, i must confess that with my first post, the code i used had very large var names. i had to do that just to keep track of all the stuff that changes. i have trimmed things down a bit and considering the challenge this post is a little more reasonable:

Your solution passed all tests

KiXtart
KiXtart Version = 4.53
KiXGolf Script = kixgolf_tg.kix

Computer
OS = Windows XP Professional
CPU = Intel(R) Pentium(R) D CPU 3.20GHz
Speed = 3200 MHz
Memory = 2048 MB

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Taunt Generator
Processing Start = 2007/12/10 06:46:51.534
Processing End = 2007/12/10 06:46:51.549
Duration = 0000/00/00 00:00:00.014
KiXGolf Score = 1275

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
Page 1 of 14 12345>Last »


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

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

Generated in 0.11 seconds in which 0.039 seconds were spent on a total of 13 queries. Zlib compression enabled.

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