A very common task in writing a challenge is to define the allowed input/output types. These descriptions have a couple of problems as I see them:
- They can get really verbose. If I want somebody to output an ascii art image, describing the allowable outputs can get really complicated:
If you write a full program, your answer must be printed to STDOUT as a string, optionally followed by a trailing newline. If your answer is a function, you may print to STDOUT, or return a string, or return an array/list of strings (rows), or return a two-dimensional array or nested list of characters.
- There are lots of "gotcha's" in types. For example, defining the precision needed for a double, or the minimum image size for image output.
- These type descriptions are repeated a lot from challenge to challenge
It'd be great if we could come up with some sort of "type description" (e.g.
Integer -> 2D string), that allows users to quickly understand the input/output types, while covering edge cases and other problems.
Do you like this idea? If so:
- What should the syntax look like?
- How should the types be defined?
- Should types simply be a shorthand (and a full description is still required)? If the full description isn't required, how should new users figure out what the types mean?