12
4
There has already been a 9 Hole Challenge (and another one here), but that was soooo last year. And besides, I have only been around for 2 months (although it seems like forever). And it is considerably different.
Leader Board: (note that weighting for holes are not established yet)
+---------------+------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
|Competitor | Language | Hole 1 | Hole 2 | Hole 3 | Hole 4 | Hole 5 | Hole 6 | Hole 7 | Hole 8 | Hole 9 | Total |
+----------------------------------------------------------------------------------------------------------------------+
|Dennis |CJam | | 31 | | | | | | | | 31 |
+----------------------------------------------------------------------------------------------------------------------+
|Optimizer |CJam | | 35 | | | | | | | | 35 |
+----------------------------------------------------------------------------------------------------------------------+
|Martin Büttner |Mathematica | | 222 | | | | | | | | 222 |
+----------------------------------------------------------------------------------------------------------------------+
|Cameron |Python | 878 | | | | | | | | | 878 |
+----------------------------------------------------------------------------------------------------------------------+
|bubalou |Processing 2| 717 | | | | | | | | | 717 |
+----------------------------------------------------------------------------------------------------------------------+
|Doorknob |Python 2 | | |0.079711| | | | | | |0.079711|
+----------------------------------------------------------------------------------------------------------------------+
|Vulcan |Java | | |0.6949 | | | | | | |0.6949 |
+----------------------------------------------------------------------------------------------------------------------+
|Eli |C++ | | |1.42042 | | | | | | |1.42042 |
+---------------+------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+
Other Holes:
It's been slow around here lately, so I am here to kick off the next 9 hole golf course, involving a smattering of all that I have seen here in my (albeit limited) experience. This will entail:
- Ascii Art
- Graphical Output
- Conway's Game of Life
- King of the Hill
- Kolmogorov complexity
- Quines
- Image processing
- Math
- Classic code golf.
I am really looking forward to seeing what you can do!
Competition Rules
- You will choose 1 language for all of the holes (that you participate in...see point 4 for more info).
- For all holes - standard loopholes are (still) not funny.
- The next challenge will appear when I see that there are enough submissions given a reasonable amount of time. King of the hill, for example, will take longer.
- You do not have to participate in all of the holes. If you find a hole particularly challenging, don't have the time to do it, etc, you will receive 2 times as many points as the lowest score. Please do not take advantage of this rule by leaving 1 golfscript answer with 12 characters and taking 24 as a score.
Scoring
- Your score is based on the culmination of the scores from all of the holes
- Lowest score wins (as per real golf)
- The leaderboard will be placed at the top of this page
I will try my very best to make sure that no questions are duplicates, all questions have objective criteria, are well written, and that they all have (relatively) equal weight in the context of the whole contest.
However, Please be patient when I fail.
And, without further ado, the first challenge!
The Plasma Globe
A plasma globe is everyone's favorite toy:
Your job it to draw one.
You must draw a base:
a globe:
A tesla thingy (?)
And, of course, cool plasma shoots:
However, when you put your hand near a plasma globe (or a conductive object as Wikipedia tells me), it attracts the plasma.
Your globe should reflect that.
To put it quantitatively, your globe has a maximum of 16 shoots (see above picture). An "object" on the surface of the globe (given by an angle in radians) will contain "conductive power", that is, the amount of beams it attracts. So an object with a power of 5 will attract 5 beams (a single line with thickness 5) leaving 11 to spread evenly among the rest of the globe:
Note that
1. the black circle in the middle remains above the plasma
2. that in this example, the angle would be pi/2.
You may have more than one conductive object, and in that event, it is not required that the shoots are equally spaced apart. However, they be relatively spaced out. For example, this is ok for 2 objects, 1 at angle pi/4 power 5 and another at angle 5pi/3 power 3:
You should be able to see each of the end points of the shoots (of plasma).
However, given an object (or sum of objects) with power greater than 16, the globe will "break":
Notes
- The globe's diameter is 1.5 times bigger than the length of the base, which is a square
- When the globe breaks, the globe is on the right side. It is tangent to the right side of the base as well as the ground. There should be no plasma when the plasma globe is broken (why? safety features of course! No word on how it broke in the first place.)
- The color of everything except the shoots must be black, and 1 pixel thick. The color of the plasma has hue 245 - 280, and saturation/value 100. Use this under "HSV" if you have no idea what I am talking about.
Input
Input can be through STDIN/command line args/whatever or through function arguments.
There should be 2 inputs - length of the base of the plasma globe (include an axis if using vector graphics), and an array of objects like this:
[[angle,power],[angle,power],[angle,power]]
So for no objects (see first picture with 16 lines) the input would be
100,[]
For the next (one object, power 5) it would be:
100,[[1.570796,5]]
For the last example:
100,[[0.785398,5],[5.23598,3]]
This is code-golf, so shortest code in bytes wins.
@MartinBüttner If the image does not get smaller when the base-length get smaller, include an axis – Stretch Maniac – 2014-10-12T23:29:20.790
In your second example. What if the second object was at
-3/8π
? In that case it would overlap exactly with one of the other beams. Do we have to rotate all the beams in such a case? If so, I think you need to specify how far away the individual beams need to be from the object-induced beams. – Martin Ender – 2014-10-12T23:43:27.390You should rotate the rest of the beams in the event of an exact overlap, as you said. Each beam should be visually distinct from one another, so I should see the object induced beam as being separate from the beam it is close to. If you need more specification, you can use .1 as the minimum angle. However, I don't want to specify this too much, because a beam of power 15 will cover much more than a beam of power 3, therefore needing a much greater buffer distance. – Stretch Maniac – 2014-10-12T23:53:03.753
1er.... why the column "hole 2" of the board is already filled even if there are no answers? – xem – 2014-10-17T20:28:47.830
How big should the square become? Is it required to have a line (or anything else that visually distinguishes it from the background)? – user2428118 – 2014-10-17T22:44:03.013
Does the globe have to be exactly centered at the top of the square? – user2428118 – 2014-10-17T22:59:36.820
2
A little help to better visualize this: http://inear.se/plasmaball/
– CSᵠ – 2014-10-18T00:09:54.623@user2428118 The globe should be centered above (and tangent to) the square... Within a pixel or 2 is fine. The square should be visible - so yes, it should be distinguishable from the background. – Stretch Maniac – 2014-10-18T00:32:21.543
1@xem um, there are answers to hole 2, so why not post them? This doesn't necessarily have to go in order... – Stretch Maniac – 2014-10-18T00:34:15.083
If only I could think of a reliable way to ensure that object-induced beams and leftover beams never overlap... – Martin Ender – 2014-10-18T01:41:11.770
ah ok each hole has its own thread. nevermind ten ;) – xem – 2014-10-18T06:14:14.813
@StretchManiac Acc. to your rules. If answers in first and second hole remain like what they are now, Cameron gets over 800 point advantage over the rest of the 3 participants. (Re: if you do not participate in a hole, you get double of worst score) – Optimizer – 2014-10-19T17:32:06.930
@Optimizer I was going to do update weights and no answers only periodically (rather than every time someone answers). Otherwise, it would require substantial changes whenever anyone answers. Think of it as a raw score table, not as the actual winning table (though I will throw one up eventually). – Stretch Maniac – 2014-10-19T21:24:27.070
@StretchManiac You did not get my point. Your that rule is putting the other three contenders to a great disadvantage. – Optimizer – 2014-10-20T05:45:47.453
@Optimizer All of the scores will eventually become the same weight - so the hole 2 scores might be multiplied by 30 (as an example) to even the scores out. Then the double rule will take effect. – Stretch Maniac – 2014-10-21T00:05:33.640