Page 1 of 10 12345>Last »
Topic Options
#181185 - 2007-10-06 03:48 AM KiXgolf: Linear Pachinko - Private Round
Sealeopard Offline
KiX Master
*****

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


This problem is inspired by Pachinko, a popular game in Japan. A traditional Pachinko machine is a cross between a vertical pinball machine and a slot machine. The player launches small steel balls to the top of the machine using a plunger as in pinball. A ball drops through a maze of pins that deflect the ball, and eventually the ball either exits at a hole in the bottom and is lost, or lands in one of many gates scattered throughout the machine which reward the player with more balls in varying amounts. Players who collect enough balls can trade them in for prizes.

For the purposes of this problem, a linear Pachinko machine is a sequence of one or more of the following: holes ("."), floor tiles ("_"), walls ("|"), and mountains ("/\"). A wall or mountain will never be adjacent to another wall or mountain. To play the game, a ball is dropped at random over some character within a machine. A ball dropped into a hole falls through. A ball dropped onto a floor tile stops immediately. A ball dropped onto the left side of a mountain rolls to the left across any number of consecutive floor tiles until it falls into a hole, falls off the left end of the machine, or stops by hitting a wall or mountain. A ball dropped onto the right side of a mountain behaves similarly. A ball dropped onto a wall behaves as if it were dropped onto the left or right side of a mountain, with a 50% chance for each. If a ball is dropped at random over the machine, with all starting positions being equally likely, what is the probability that the ball will fall either through a hole or off an end?

For example, consider the following machine, where the numbers just indicate character positions and are not part of the machine itself:

 Code:
123456789
/\.|__/\.

The probabilities that a ball will fall through a hole or off the end of the machine are as follows, by position: 1=100%, 2=100%, 3=100%, 4=50%, 5=0%, 6=0%, 7=0%, 8=100%, 9=100%. The combined probability for the whole machine is just the average, which is approximately 61.111%.


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

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


Input: The input consists of a linear Pachinko machines, 1–99 characters long

Output: For each machine, compute as accurately as possible the probability that a ball will fall through a hole or off the end when dropped at random, then output that percentage truncated to an integer by dropping any fractional part.

=======
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 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 October 10 6pm EST (BBS+6 time)

2) Public coding phase: From October 10 6EST (BBS+6 time) to October 14 6pm EST (BBS+6 time)

3) Final results: October 15 11pm EST (BBS+6 time)

You will need the complete package from http://s91376351.onlinehome.us/kixtart/kixgolf_lp.zip.
_________________________
There are two types of vessels, submarines and targets.

Top
#181187 - 2007-10-06 04:22 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: Sealeopard]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Anybody playing already?
_________________________
There are two types of vessels, submarines and targets.

Top
#181188 - 2007-10-06 05:13 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: Sealeopard]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
Yup
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#181193 - 2007-10-06 06:44 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: Benny69]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
its a pig but:

Running Test 1...Done
Running Test 2...Done
Running Test 3...Done
Running Test 4...Done
Running Test 5...Done
Running Test 6...Done
Running Test 7...Done
Running Test 8...Done
Running Test 9...Done
Your solution passed all tests

Your solution passed all tests

KiXtart
KiXtart Version = 4.60
KiXGolf Script = kixgolf_lp.kix

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Linear Pachinko
Processing Start = 2007/10/05 23:44:55.092
Processing End = 2007/10/05 23:44:55.123
Duration = 0000/00/00 00:00:00.031
KiXGolf Score = 588

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
#181195 - 2007-10-06 06:49 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: Benny69]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Great work Benny - dang - you're just too frickn good at this all this KiX stuff. Congrats on first post points
Top
#181196 - 2007-10-06 07:02 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: NTDOC]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
thanks doc,
ok a little better, but still a pig:

Running Test 1...Done
Running Test 2...Done
Running Test 3...Done
Running Test 4...Done
Running Test 5...Done
Running Test 6...Done
Running Test 7...Done
Running Test 8...Done
Running Test 9...Done
Your solution passed all tests

Your solution passed all tests

KiXtart
KiXtart Version = 4.60
KiXGolf Script = kixgolf_lp.kix

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Linear Pachinko
Processing Start = 2007/10/06 00:02:00.962
Processing End = 2007/10/06 00:02:00.993
Duration = 0000/00/00 00:00:00.030
KiXGolf Score = 478

Thank you for participating in KiXtart Golf!
Press any key to continue...


Edited by Benny69 (2007-10-06 07:03 AM)
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#181197 - 2007-10-06 07:17 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: Benny69]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
ok now we are making some progress:

Running Test 1...Done
Running Test 2...Done
Running Test 3...Done
Running Test 4...Done
Running Test 5...Done
Running Test 6...Done
Running Test 7...Done
Running Test 8...Done
Running Test 9...Done
Your solution passed all tests

Your solution passed all tests

KiXtart
KiXtart Version = 4.60
KiXGolf Script = kixgolf_lp.kix

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Linear Pachinko
Processing Start = 2007/10/06 00:18:14.650
Processing End = 2007/10/06 00:18:14.681
Duration = 0000/00/00 00:00:00.030
KiXGolf Score = 369

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
#181199 - 2007-10-06 08:52 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: Benny69]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Not even half way, but I am on the board.... so to speak
 Code:

Your solution failed 5 of 9 tests.

KiXtart
KiXtart Version  = 4.51
KiXGolf Script   = kixgolf_lp.KIX

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Linear Pachinko
Processing Start = 2007/10/05 23:51:24.515
Processing End   = 2007/10/05 23:51:24.546
Duration         = 0000/00/00 00:00:00.031
KiXGolf Score    = 770
 
Thank you for participating in KiXtart Golf!

_________________________
Today is the tomorrow you worried about yesterday.

Top
#181200 - 2007-10-06 09:06 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: Gargoyle]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
good to see you in it Gar, i gota go to bed, gn
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#181201 - 2007-10-06 09:07 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: Benny69]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
I am headed the same way (the wife is telling me so)
_________________________
Today is the tomorrow you worried about yesterday.

Top
#181202 - 2007-10-06 09:19 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: Benny69]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ahhh, nice, solid, and fast tee-off Dale.

I may be having really time this time from tuesday noon on \:o
Well, lets see what I can come up with in the short breaks til then.
_________________________



Top
#181203 - 2007-10-06 09:39 AM Re: KiXgolf: Linear Pachinko - Private Round [Re: Gargoyle]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Okay, had to at least get it working before bed... \:\)

 Code:

Your solution passed all tests

KiXtart
KiXtart Version  = 4.51
KiXGolf Script   = kixgolf_lp.KIX

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Linear Pachinko
Processing Start = 2007/10/06 00:36:00.375
Processing End   = 2007/10/06 00:36:00.406
Duration         = 0000/00/00 00:00:00.030
KiXGolf Score    = 611
 
Thank you for participating in KiXtart Golf!
_________________________
Today is the tomorrow you worried about yesterday.

Top
#181204 - 2007-10-06 12:50 PM Re: KiXgolf: Linear Pachinko - Private Round [Re: Gargoyle]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Just an FYI you might be hampering your score possibly by using that version of KiX

KiXtart Version = 4.51

Top
#181205 - 2007-10-06 01:56 PM Re: KiXgolf: Linear Pachinko - Private Round [Re: NTDOC]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
I think I sort of understand the challenge. Will get some groceries, start the washing machine and then see what I can get going.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#181211 - 2007-10-06 03:39 PM Re: KiXgolf: Linear Pachinko - Private Round [Re: Mart]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
way to go Gar, for this chalenge that is a pretty good first score
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#181213 - 2007-10-06 05:28 PM Re: KiXgolf: Linear Pachinko - Private Round [Re: Benny69]
Jochen Administrator Offline
KiX Supporter
*****

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

got the logic, but am far away from first approach. Back to work then \:\(
_________________________



Top
#181214 - 2007-10-06 05:30 PM Re: KiXgolf: Linear Pachinko - Private Round [Re: Jochen]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...

Your solution passed all tests

KiXtart
KiXtart Version = 4.60
KiXGolf Script = kixgolf_lp.KIX

KiXGolf Scoring Engine
Scoring Engine = 3.3

KiXtart Golf Score
Tournament = Linear Pachinko
Processing Start = 2007/10/06 08:27:56.500
Processing End = 2007/10/06 08:27:56.546
Duration = 0000/00/00 00:00:00.045
KiXGolf Score = 544

Thank you for participating in KiXtart Golf!
_________________________
Today is the tomorrow you worried about yesterday.

Top
#181215 - 2007-10-06 05:42 PM Re: KiXgolf: Linear Pachinko - Private Round [Re: Gargoyle]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
Dang Gar your code must be solid to be able to knock off 100, I better get back to it

Edited by Benny69 (2007-10-06 05:44 PM)
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#181217 - 2007-10-06 08:56 PM Re: KiXgolf: Linear Pachinko - Private Round [Re: Benny69]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
second short break from work ... pretty traditional approach, no fancy stuff, but hey it works.


Running Test 1...Done
Running Test 2...Done
Running Test 3...Done
Running Test 4...Done
Running Test 5...Done
Running Test 6...Done
Running Test 7...Done
Running Test 8...Done
Running Test 9...Done
Your solution passed all tests

Your solution passed all tests

KiXtart
KiXtart Version  = 4.53
KiXGolf Script   = kixgolf_lp.kix

KiXGolf Scoring Engine
Scoring Engine   = 3.3

KiXtart Golf Score
Tournament       = Linear Pachinko
Processing Start = 2007/10/06 20:54:30.843
Processing End   = 2007/10/06 20:54:30.843
Duration         = 0000/00/00 00:00:00.000
KiXGolf Score    = 296

Thank you for participating in KiXtart Golf!


_________________________



Top
#181218 - 2007-10-06 09:03 PM Re: KiXgolf: Linear Pachinko - Private Round [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
btw, is version 4.53 still assumed official, since 4.60 has gone gold (With reported bugs though) ?
_________________________



Top
Page 1 of 10 12345>Last »


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

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.075 seconds in which 0.025 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