Page 1 of 3 123>
Topic Options
#212907 - 2017-11-19 06:01 PM Kixgolf - 99 Bottles Of Beer - Private Round
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
=================================
The Challenge - 99 Bottles of Beer
=================================


Almost everyone knows the all-time evergreen song for long hikes "99 Bottles Of Beer On The Wall".
This challenge is all about generating readable lyrics for different amounts of bottles.
As we are civilised people we don't want to just print out Numbers but instead use the cardinal numbers as written in english (Hope I get those right \:\) )

Examples (Common grammar rules as upper case words at start of sentences and singular/plural apply)
One two three four five
Eleven twelve thirteen fourteen fifteen
Twenty-one twenty-two twenty-three and so on

As this little song of course has to continue when we run out of beer someone needs to go and get some more.
More about this event in section Inputs and Outputs

So crack open a cold one and get to work. I promise you will soon forget the meaning of the word bottle for a while

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

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


Input
String of amount of bottles of beer

Example Input
89

Output
String of the correct line of song lyrics

Example Output
Eighty-nine bottles of beer on the wall, eighty-nine bottles of beer. Take one down and pass it around, eighty-eight bottles of beer on the wall.

Special input case 1
Output
One bottle of beer on the wall, one bottle of beer. Take one down and pass it around, no more bottles of beer on the wall.

Special input case 0
Output
No more bottles of beer on the wall, no more bottles of beer. Go to the store and buy some more, ninety-nine bottles of beer on the wall.

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

- The scoring engine has added code to help diagnose which cases are failing. To see test case results:
 Code:
   kix32 kixgolf_drc $verbose=1 ;shows failing results
   kix32 kixgolf_drc $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: 2017-11-19 to 2017-11-26 (Official Count down clock will determine end time)

2) Public coding phase: 2017-11-26 to 2017-12-03

3) Final results: 2017-12-03


Attachments
kixgolf_bob.zip (295 downloads)
Description:


_________________________



Top
#212908 - 2017-11-19 06:03 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

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

Edited by Jochen (2017-11-26 06:01 PM)
_________________________



Top
#212911 - 2017-11-19 06:28 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

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



Top
#212912 - 2017-11-20 04:28 AM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Jochen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Nothing here to see but a working code... Given time I might be able to do much better.

 Code:
KiXtart Version  = 4.66
KiXGolf Script   = kixgolf_bob.KIX
Scoring Engine   = 3.3
OS               = Windows 10 Pro
CPU              = Intel Pentium III Xeon
Speed            = 3392 MHz
Memory           = 16384 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/19 22:22:43.306
Processing End   = 2017/11/19 22:22:43.368
Duration         = 0000/00/00 00:00:00.062
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 1640

Top
#212913 - 2017-11-20 09:02 AM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Allen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hey, early tee off.
Well, it's something

I expect you to shave more than half of them strokes though!
_________________________



Top
#212918 - 2017-11-20 11:10 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Jochen]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Probably still some golfing to do. But happy with the start.
 Code:

KiXtart Version  = 4.66
KiXGolf Script   = kixgolf_bob.kix
Scoring Engine   = 3.3
OS               = Windows 7 Enterprise Edition
CPU              = Intel Pentium III Xeon
Speed            = 2594 MHz
Memory           = 8192 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/20 16:08:00.332
Processing End   = 2017/11/20 16:08:00.348
Duration         = 0000/00/00 00:00:00.015
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 781

Thank you for participating in KiXtart Golf!

Top
#212919 - 2017-11-21 10:20 AM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: ShaneEP]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Near my score (didn't golf too much) so there's plenty room for improvement.
Your turn Allen \:\)
_________________________



Top
#212921 - 2017-11-21 04:39 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Jochen]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Getting warmer...
 Code:

KiXtart Version  = 4.66
KiXGolf Script   = kixgolf_bob.kix
Scoring Engine   = 3.3
OS               = Windows 7 Enterprise Edition
CPU              = Intel Pentium III Xeon
Speed            = 2594 MHz
Memory           = 8192 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/21 09:38:49.716
Processing End   = 2017/11/21 09:38:49.736
Duration         = 0000/00/00 00:00:00.019
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 757

Thank you for participating in KiXtart Golf!

Top
#212922 - 2017-11-21 04:41 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Doh. Missed a simple one...
 Code:
KiXtart Version  = 4.66
KiXGolf Script   = kixgolf_bob.kix
Scoring Engine   = 3.3
OS               = Windows 7 Enterprise Edition
CPU              = Intel Pentium III Xeon
Speed            = 2594 MHz
Memory           = 8192 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/21 09:40:31.260
Processing End   = 2017/11/21 09:40:31.270
Duration         = 0000/00/00 00:00:00.009
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 749

Thank you for participating in KiXtart Golf!

Top
#212923 - 2017-11-21 04:49 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
 Code:
KiXtart Version  = 4.66
KiXGolf Script   = kixgolf_bob.kix
Scoring Engine   = 3.3
OS               = Windows 7 Enterprise Edition
CPU              = Intel Pentium III Xeon
Speed            = 2594 MHz
Memory           = 8192 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/21 09:49:14.513
Processing End   = 2017/11/21 09:49:14.523
Duration         = 0000/00/00 00:00:00.010
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 731

Thank you for participating in KiXtart Golf!

Top
#212925 - 2017-11-21 07:58 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
I think I'm about at my limits...Seems like there should be more though. Just can't see it right now.

 Code:
KiXtart Version  = 4.67
KiXGolf Script   = kixgolf_bob.kix
Scoring Engine   = 3.3
OS               = Windows 7 Enterprise Edition
CPU              = Intel Pentium III Xeon
Speed            = 2594 MHz
Memory           = 8192 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/21 12:58:24.778
Processing End   = 2017/11/21 12:58:24.795
Duration         = 0000/00/00 00:00:00.016
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 728

Thank you for participating in KiXtart Golf!

Top
#212927 - 2017-11-21 09:29 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Found some more...Good thing work is slow around the holiday.

 Code:
KiXtart Version  = 4.67
KiXGolf Script   = kixgolf_bob.kix
Scoring Engine   = 3.3
OS               = Windows 7 Enterprise Edition
CPU              = Intel Pentium III Xeon
Speed            = 2594 MHz
Memory           = 8192 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/21 14:28:37.129
Processing End   = 2017/11/21 14:28:37.148
Duration         = 0000/00/00 00:00:00.019
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 663

Thank you for participating in KiXtart Golf!

Top
#212928 - 2017-11-21 09:46 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: ShaneEP]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Comeon man... show me up by a 1000
Top
#212930 - 2017-11-21 10:01 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Allen]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
I know you have the skill Allen. You just need to take some time to apply yourself. The lady will forgive you eventually. lol
Top
#212935 - 2017-11-22 05:50 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Getting pretty tough now...But I know someone (Allen) will see something really obvious once public round starts.
 Code:
KiXtart Version  = 4.67
KiXGolf Script   = kixgolf_bob.kix
Scoring Engine   = 3.3
OS               = Windows 7 Enterprise Edition
CPU              = Intel Pentium III Xeon
Speed            = 2594 MHz
Memory           = 8192 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/22 10:48:58.220
Processing End   = 2017/11/22 10:48:58.242
Duration         = 0000/00/00 00:00:00.021
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 660

Thank you for participating in KiXtart Golf!

Top
#212937 - 2017-11-22 06:00 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: ShaneEP]
Jochen Administrator Offline
KiX Supporter
*****

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

50 strokes below my testing code (done in between two other tasks @work) seems to be good to play on with 4 days left.
Not that there is much competition here \:\(

Allen?
_________________________



Top
#212938 - 2017-11-22 07:22 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Jochen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
If there will be any further developments from me it will be tomorrow, Thanksgiving day.
Top
#212939 - 2017-11-23 08:42 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
All I have time for right now.

 Code:
KiXtart Version  = 4.66
KiXGolf Script   = kixgolf_bob.KIX
Scoring Engine   = 3.3
OS               = Windows 10 Pro
CPU              = Intel Pentium III Xeon
Speed            = 3392 MHz
Memory           = 16384 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/23 14:40:46.912
Processing End   = 2017/11/23 14:40:46.953
Duration         = 0000/00/00 00:00:00.041
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 818

Top
#212940 - 2017-11-23 09:16 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Oh gawd... Now I'm golfin and my honey is

 Code:
KiXtart Version  = 4.66
KiXGolf Script   = kixgolf_bob.KIX
Scoring Engine   = 3.3
OS               = Windows 10 Pro
CPU              = Intel Pentium III Xeon
Speed            = 3392 MHz
Memory           = 16384 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/23 15:11:12.247
Processing End   = 2017/11/23 15:11:12.302
Duration         = 0000/00/00 00:00:00.055
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 702

Top
#212941 - 2017-11-23 09:18 PM Re: Kixgolf - 99 Bottles Of Beer - Private Round [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Missed an easy one...

 Code:
KiXtart Version  = 4.66
KiXGolf Script   = kixgolf_bob.KIX
Scoring Engine   = 3.3
OS               = Windows 10 Pro
CPU              = Intel Pentium III Xeon
Speed            = 3392 MHz
Memory           = 16384 MB

Tournament       = 99 Bottles of Beer
Processing Start = 2017/11/23 15:17:20.208
Processing End   = 2017/11/23 15:17:20.258
Duration         = 0000/00/00 00:00:00.050
# Tests Run      = 21
# Tests Passed   = 21
# Tests Failed   = 0
Result           = Passed
KiXGolf Score    = 700

Top
Page 1 of 3 123>


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

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.068 seconds in which 0.023 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