Post History
Something I would like to see here are explicit and specific constraints on how submitted solutions are expected to accept the challenge input and output their solutions (if output is the goal). F...
Answer
#3: Post edited
- Something I would like to see here are explicit and specific constraints on how submitted solutions are expected to accept the challenge input and output their solutions (if output is the goal).
For example, if a challenge states that your goal is to "find the string of least length"... then all of the solutions below are valid, despite serving different purposes.- ```py
- min(s,key=len)
- ```
- ```py
- a=min(s,key=len)
- ```
- ```py
- print(min(s,key=len))
- ```
- ```py
- import sys
- min(sys.argv[1:],key=len)
- ```
- ```py
- import sys
- a=min(sys.argv[1:],key=len)
- ```
- ```py
- import sys
- print(min(sys.argv[1:],key=len))
- ```
- I briefly (very briefly) looked around for some kind of template or ruleset, but I wasn't able to immediately find anything. This community would greatly benefit from a tab/link on the topbar/sidebar that points to a clearly defined set of rules and expectations for anyone wanting to post a challenge or submit a solution to a given challenge.
- ---
- (This is a criticism, but hopefully not read as an angry one)
- The challenge I'm working on is <https://codegolf.codidact.com/posts/279434>. This is a great challenge concept. My issue with it is that it is not clear how my solution should accept the challenge input, nor is it clear what constitutes a valid solution.
- >Given a list of strings(and optionally, their length) as input, weave the strings together.
- I can make assumptions on how to accept the input, but the submitted solutions don't follow that assumption. Some take interactive input. Some assume the input is in some pre-existing variable (which makes golfing really easy, since accepting input or reading `argv` would require extra characters).
- Working out what is a "valid" solution is a bit harder, though. Does it need to be a function? Can it be assigned to a variable? Can it just be the bare-minimum code that you *would* assign to a variable? (See the code blocks above for an example.)
- ---
- I know exactly how easy it is to make the mistake of not being clear enough in the requirements of a challenge. A few years ago, I posted a mini-challenge in the community I moderate in, where the challenge was to convert seconds into a human-readable format (aka convert `61` seconds into `1m, 1s`, with weeks being the maximum unit). I also explained to drop all `0`s (and their corresponding unit), so `60` seconds would become `1m` instead of `1m, 1s`.
- I then gathered the submissions in order to measure the elapsed time of them. It was then that I realized my error. Nearly everyone had submitted something that **outputted** the solution rather than **returned** the solution. I asked them to resubmit their solutions as functions that returned the value instead, as writing to STDOUT adds extra time and skews the results.
- I ended up having to revise the rules multiple times because I just underestimated how easy it is to misinterpret/misunderstand something unless you are **annoyingly explicit** about it.
- ---
- The only standard rule I can think of is to make all challenge input be read into the program as a space-separated list of strings, and to make the program write the answer to STDOUT. This would make it really easy to verify whether the output is correct or not. At the very least, I think a template for challenge authors could be extremely useful. It could be like those default templates you see for GitHub issues, but for challenge problems instead.
- Lastly, I apologize for my admittedly clunky writing. It's been years since I've wrote an essay. Also, if I've somehow just overlooked the ruleset, please yell at me.
- ---
- Edit: The point I was mostly trying to make is that a template would help nudge challenge authors to be more descriptive and specific in their requirements. A hard ruleset probably isn't necessary. You can never have too much information, however.
- Something I would like to see here are explicit and specific constraints on how submitted solutions are expected to accept the challenge input and output their solutions (if output is the goal).
- For example, if a challenge states that your goal is to "find the string of least length in a list"... then all of the solutions below are valid, despite serving different purposes.
- ```py
- min(s,key=len)
- ```
- ```py
- a=min(s,key=len)
- ```
- ```py
- print(min(s,key=len))
- ```
- ```py
- import sys
- min(sys.argv[1:],key=len)
- ```
- ```py
- import sys
- a=min(sys.argv[1:],key=len)
- ```
- ```py
- import sys
- print(min(sys.argv[1:],key=len))
- ```
- I briefly (very briefly) looked around for some kind of template or ruleset, but I wasn't able to immediately find anything. This community would greatly benefit from a tab/link on the topbar/sidebar that points to a clearly defined set of rules and expectations for anyone wanting to post a challenge or submit a solution to a given challenge.
- ---
- (This is a criticism, but hopefully not read as an angry one)
- The challenge I'm working on is <https://codegolf.codidact.com/posts/279434>. This is a great challenge concept. My issue with it is that it is not clear how my solution should accept the challenge input, nor is it clear what constitutes a valid solution.
- >Given a list of strings(and optionally, their length) as input, weave the strings together.
- I can make assumptions on how to accept the input, but the submitted solutions don't follow that assumption. Some take interactive input. Some assume the input is in some pre-existing variable (which makes golfing really easy, since accepting input or reading `argv` would require extra characters).
- Working out what is a "valid" solution is a bit harder, though. Does it need to be a function? Can it be assigned to a variable? Can it just be the bare-minimum code that you *would* assign to a variable? (See the code blocks above for an example.)
- ---
- I know exactly how easy it is to make the mistake of not being clear enough in the requirements of a challenge. A few years ago, I posted a mini-challenge in the community I moderate in, where the challenge was to convert seconds into a human-readable format (aka convert `61` seconds into `1m, 1s`, with weeks being the maximum unit). I also explained to drop all `0`s (and their corresponding unit), so `60` seconds would become `1m` instead of `1m, 1s`.
- I then gathered the submissions in order to measure the elapsed time of them. It was then that I realized my error. Nearly everyone had submitted something that **outputted** the solution rather than **returned** the solution. I asked them to resubmit their solutions as functions that returned the value instead, as writing to STDOUT adds extra time and skews the results.
- I ended up having to revise the rules multiple times because I just underestimated how easy it is to misinterpret/misunderstand something unless you are **annoyingly explicit** about it.
- ---
- The only standard rule I can think of is to make all challenge input be read into the program as a space-separated list of strings, and to make the program write the answer to STDOUT. This would make it really easy to verify whether the output is correct or not. At the very least, I think a template for challenge authors could be extremely useful. It could be like those default templates you see for GitHub issues, but for challenge problems instead.
- Lastly, I apologize for my admittedly clunky writing. It's been years since I've wrote an essay. Also, if I've somehow just overlooked the ruleset, please yell at me.
- ---
- Edit: The point I was mostly trying to make is that a template would help nudge challenge authors to be more descriptive and specific in their requirements. A hard ruleset probably isn't necessary. You can never have too much information, however.
#2: Post edited
- Something I would like to see here are explicit and specific constraints on how submitted solutions are expected to accept the challenge input and output their solutions (if output is the goal).
- For example, if a challenge states that your goal is to "find the string of least length"... then all of the solutions below are valid, despite serving different purposes.
- ```py
- min(s,key=len)
- ```
- ```py
- a=min(s,key=len)
- ```
- ```py
- print(min(s,key=len))
- ```
- ```py
- import sys
- min(sys.argv[1:],key=len)
- ```
- ```py
- import sys
- a=min(sys.argv[1:],key=len)
- ```
- ```py
- import sys
- print(min(sys.argv[1:],key=len))
- ```
- I briefly (very briefly) looked around for some kind of template or ruleset, but I wasn't able to immediately find anything. This community would greatly benefit from a tab/link on the topbar/sidebar that points to a clearly defined set of rules and expectations for anyone wanting to post a challenge or submit a solution to a given challenge.
- ---
- (This is a criticism, but hopefully not read as an angry one)
- The challenge I'm working on is <https://codegolf.codidact.com/posts/279434>. This is a great challenge concept. My issue with it is that it is not clear how my solution should accept the challenge input, nor is it clear what constitutes a valid solution.
- >Given a list of strings(and optionally, their length) as input, weave the strings together.
- I can make assumptions on how to accept the input, but the submitted solutions don't follow that assumption. Some take interactive input. Some assume the input is in some pre-existing variable (which makes golfing really easy, since accepting input or reading `argv` would require extra characters).
- Working out what is a "valid" solution is a bit harder, though. Does it need to be a function? Can it be assigned to a variable? Can it just be the bare-minimum code that you *would* assign to a variable? (See the code blocks above for an example.)
- ---
- I know exactly how easy it is to make the mistake of not being clear enough in the requirements of a challenge. A few years ago, I posted a mini-challenge in the community I moderate in, where the challenge was to convert seconds into a human-readable format (aka convert `61` seconds into `1m, 1s`, with weeks being the maximum unit). I also explained to drop all `0`s (and their corresponding unit), so `60` seconds would become `1m` instead of `1m, 1s`.
- I then gathered the submissions in order to measure the elapsed time of them. It was then that I realized my error. Nearly everyone had submitted something that **outputted** the solution rather than **returned** the solution. I asked them to resubmit their solutions as functions that returned the value instead, as writing to STDOUT adds extra time and skews the results.
- I ended up having to revise the rules multiple times because I just underestimated how easy it is to misinterpret/misunderstand something unless you are **annoyingly explicit** about it.
- ---
- The only standard rule I can think of is to make all challenge input be read into the program as a space-separated list of strings, and to make the program write the answer to STDOUT. This would make it really easy to verify whether the output is correct or not. At the very least, I think a template for challenge authors could be extremely useful. It could be like those default templates you see for GitHub issues, but for challenge problems instead.
Lastly, I apologize for my admittedly clunky writing. It's been years since I've wrote an essay. Also, if I've somehow just overlooked the ruleset, please yell at me.
- Something I would like to see here are explicit and specific constraints on how submitted solutions are expected to accept the challenge input and output their solutions (if output is the goal).
- For example, if a challenge states that your goal is to "find the string of least length"... then all of the solutions below are valid, despite serving different purposes.
- ```py
- min(s,key=len)
- ```
- ```py
- a=min(s,key=len)
- ```
- ```py
- print(min(s,key=len))
- ```
- ```py
- import sys
- min(sys.argv[1:],key=len)
- ```
- ```py
- import sys
- a=min(sys.argv[1:],key=len)
- ```
- ```py
- import sys
- print(min(sys.argv[1:],key=len))
- ```
- I briefly (very briefly) looked around for some kind of template or ruleset, but I wasn't able to immediately find anything. This community would greatly benefit from a tab/link on the topbar/sidebar that points to a clearly defined set of rules and expectations for anyone wanting to post a challenge or submit a solution to a given challenge.
- ---
- (This is a criticism, but hopefully not read as an angry one)
- The challenge I'm working on is <https://codegolf.codidact.com/posts/279434>. This is a great challenge concept. My issue with it is that it is not clear how my solution should accept the challenge input, nor is it clear what constitutes a valid solution.
- >Given a list of strings(and optionally, their length) as input, weave the strings together.
- I can make assumptions on how to accept the input, but the submitted solutions don't follow that assumption. Some take interactive input. Some assume the input is in some pre-existing variable (which makes golfing really easy, since accepting input or reading `argv` would require extra characters).
- Working out what is a "valid" solution is a bit harder, though. Does it need to be a function? Can it be assigned to a variable? Can it just be the bare-minimum code that you *would* assign to a variable? (See the code blocks above for an example.)
- ---
- I know exactly how easy it is to make the mistake of not being clear enough in the requirements of a challenge. A few years ago, I posted a mini-challenge in the community I moderate in, where the challenge was to convert seconds into a human-readable format (aka convert `61` seconds into `1m, 1s`, with weeks being the maximum unit). I also explained to drop all `0`s (and their corresponding unit), so `60` seconds would become `1m` instead of `1m, 1s`.
- I then gathered the submissions in order to measure the elapsed time of them. It was then that I realized my error. Nearly everyone had submitted something that **outputted** the solution rather than **returned** the solution. I asked them to resubmit their solutions as functions that returned the value instead, as writing to STDOUT adds extra time and skews the results.
- I ended up having to revise the rules multiple times because I just underestimated how easy it is to misinterpret/misunderstand something unless you are **annoyingly explicit** about it.
- ---
- The only standard rule I can think of is to make all challenge input be read into the program as a space-separated list of strings, and to make the program write the answer to STDOUT. This would make it really easy to verify whether the output is correct or not. At the very least, I think a template for challenge authors could be extremely useful. It could be like those default templates you see for GitHub issues, but for challenge problems instead.
- Lastly, I apologize for my admittedly clunky writing. It's been years since I've wrote an essay. Also, if I've somehow just overlooked the ruleset, please yell at me.
- ---
- Edit: The point I was mostly trying to make is that a template would help nudge challenge authors to be more descriptive and specific in their requirements. A hard ruleset probably isn't necessary. You can never have too much information, however.
#1: Initial revision
Something I would like to see here are explicit and specific constraints on how submitted solutions are expected to accept the challenge input and output their solutions (if output is the goal). For example, if a challenge states that your goal is to "find the string of least length"... then all of the solutions below are valid, despite serving different purposes. ```py min(s,key=len) ``` ```py a=min(s,key=len) ``` ```py print(min(s,key=len)) ``` ```py import sys min(sys.argv[1:],key=len) ``` ```py import sys a=min(sys.argv[1:],key=len) ``` ```py import sys print(min(sys.argv[1:],key=len)) ``` I briefly (very briefly) looked around for some kind of template or ruleset, but I wasn't able to immediately find anything. This community would greatly benefit from a tab/link on the topbar/sidebar that points to a clearly defined set of rules and expectations for anyone wanting to post a challenge or submit a solution to a given challenge. --- (This is a criticism, but hopefully not read as an angry one) The challenge I'm working on is <https://codegolf.codidact.com/posts/279434>. This is a great challenge concept. My issue with it is that it is not clear how my solution should accept the challenge input, nor is it clear what constitutes a valid solution. >Given a list of strings(and optionally, their length) as input, weave the strings together. I can make assumptions on how to accept the input, but the submitted solutions don't follow that assumption. Some take interactive input. Some assume the input is in some pre-existing variable (which makes golfing really easy, since accepting input or reading `argv` would require extra characters). Working out what is a "valid" solution is a bit harder, though. Does it need to be a function? Can it be assigned to a variable? Can it just be the bare-minimum code that you *would* assign to a variable? (See the code blocks above for an example.) --- I know exactly how easy it is to make the mistake of not being clear enough in the requirements of a challenge. A few years ago, I posted a mini-challenge in the community I moderate in, where the challenge was to convert seconds into a human-readable format (aka convert `61` seconds into `1m, 1s`, with weeks being the maximum unit). I also explained to drop all `0`s (and their corresponding unit), so `60` seconds would become `1m` instead of `1m, 1s`. I then gathered the submissions in order to measure the elapsed time of them. It was then that I realized my error. Nearly everyone had submitted something that **outputted** the solution rather than **returned** the solution. I asked them to resubmit their solutions as functions that returned the value instead, as writing to STDOUT adds extra time and skews the results. I ended up having to revise the rules multiple times because I just underestimated how easy it is to misinterpret/misunderstand something unless you are **annoyingly explicit** about it. --- The only standard rule I can think of is to make all challenge input be read into the program as a space-separated list of strings, and to make the program write the answer to STDOUT. This would make it really easy to verify whether the output is correct or not. At the very least, I think a template for challenge authors could be extremely useful. It could be like those default templates you see for GitHub issues, but for challenge problems instead. Lastly, I apologize for my admittedly clunky writing. It's been years since I've wrote an essay. Also, if I've somehow just overlooked the ruleset, please yell at me.