24
5
Output is a shape that encloses 1009 pixels.
- The shape must take the form of a single, closed, non-intersecting loop.
Input is a positive non-zero integer.
- Each input must yield output that is unique — that is, each output must be unique from those generated using a lower input.
Victory is decided by the largest input limit:
- Your submission's input limit is regarded as 1 less than the lowest input that gives non-unique or otherwise invalid output.
- For instance, if valid and unique output is produced for an input of 1, 2 or 3 but not 4, your input limit is 3.
There is a 1009 byte limit on source code. If there is a draw the entry with the fewest bytes wins.
Restrictions and clarifications:
- A shape's maximum size is 109 by 109 pixels. Size includes the line used to draw the shape.
- A line is constant width.
- The enclosed space must be entirely enclosed by the line - you can't use the boundary of the image file.
- The enclosed 1009 pixels refers only to enclosed space. It does not include the line.
- Output is an image.
- There are no further graphical restrictions - e.g. on colour, line thickness etc.
- An output's uniqueness refers only to the enclosed space. Changes to the line or other graphical changes are irrelevant if the enclosed space is not unique.
- A translation of shape isn't unique. Rotations, reflections and any other transformations count as unique.
- Output must be reproducible — the same input will always give the same output
- There needn't be a relation between outputs, consecutive or otherwise.
- Outside of a submission's 'input limit' there is no defined output.
- No other input or fetching of external data is permitted.
- A line must be continuous — i.e. pixels must touch (touching a corner counts).
- A pixel is the smallest unit of 'drawing' used by your method of drawing, and won't necessarily correspond to a screen pixel.
Examples:
Here is an example of a valid shape:
The following shapes are invalid:
EDIT: Line touching:
- Enclosed space must be continuous which is defined as pixels touching. Touching corners counts.
A line cannot enclose any space on its outer side. This image posted by @Sparr illustrates this point - only the first shape on each row are valid:
The outer sides of a line may touch, but not in a way that encloses space.
- Touching lines may not overlap - e.g. two touching 1 pixel thick lines would have a combined thickness of 2px, never 1px.
What about rotations of the same shape? Are they distinct? – Martin Ender – 2014-09-30T12:39:18.523
If I take a bite out of the side of the shape, is it ok to have a foreground (black) line one pixel wide? Or does it have to be 3 pixels wide, so the incoming and outgoing line don't touch? or is it Ok to have it 2 pixels wide, so the incoming and outgoing line touch, but don't overlap? – Level River St – 2014-09-30T12:49:50.167
Some more questions: 1. Can the border of the 109x109 image act as one boundary of the shape? 2. If the line thickness is up to me, can I just say it's 200 pixels, so that the shape is just white pixels on a black image? 3. Is the shape connected if its pixels only touch along a corner? 4. I'm not a big fan of the character limit. A lot of languages might use 3/4 of that just to set up the exact output specifications. – Martin Ender – 2014-09-30T12:52:14.247
@MartinBüttner Rotations: They're distinct, yes, 1: No, the enclosed space must be enclosed by the shape's outline. 2: No, the shape would then count as larger than 109*109 3: Yes 4: You're probably right, I have increased it. – jsh – 2014-09-30T13:14:31.153
@steveverrill Sorry, I don't think I understand you. You may have 1 continuous line. Pixels touching by their corner's count as continuous. – jsh – 2014-09-30T13:17:25.450
Should we include some kind of proof that all inputs less than
n
yield distinct outputs? This could be difficult for example if you used the input number to seed a PRNG. I can think of solutions without random numbers, but I'm still curious if they must be 'provably unique'. – stokastic – 2014-09-30T13:42:55.397@stokastic I would like to see those kind of answers but I suppose you're right that scoring would be contentious. The score could be marked as provisional until it can be proven or disproven. – jsh – 2014-09-30T14:05:59.570
2Question, how'd you get 1009? – Claudiu – 2014-09-30T17:20:17.883
1
Which of these shapes are valid and holeless? http://i.imgur.com/FSV0nHz.png
– Sparr – 2014-09-30T23:26:19.093@Claudiu For the pixel count? I wanted it large enough for a decent number of solutions - in hindsight being smaller could have helped in scoring. Also it's a prime just to make things awkward. :) – jsh – 2014-10-01T08:25:43.990
@Sparr Sorry to be inconsistent - I've retracted my last reply after thinking more about the implications. Only 1 and 4 (the first on each row) are valid. Otherwise it's not possible to tell where enclosed space begins and ends. The rule is that the outer part of the line cannot touch in a way that encloses space, even with pixels touching corners. Very sorry if you had started on an answer based on my original reply. – jsh – 2014-10-01T10:34:16.403
@jsh change doesn't break my theoretical solution, just makes it run a lot slower – Sparr – 2014-10-01T14:50:18.830