-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: replace problems key with exercises key #229
Conversation
"slug": "difference-of-squares", | ||
"difficulty": 1, | ||
"topics": [ | ||
"fold & map" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be two separate topics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so.
"Struct", | ||
"Enum", | ||
"Trait", | ||
"Box -- depending on implementation" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original was Math, Struct. Enum, Trait, Box -- depending on implementation
. Should Enum, Trait, Box all be on one line? What do we do with "depending on implementation"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove Trait, Enum and Box from there. I think I added those when I was trying a very different solution. Students might still use that approach, but it will be far from standard.
This was automatically generated. I did not edit the config.json after it was automatically generated, except to then remove the require 'json'
config = JSON.parse(File.read('config.json'))
problems = File.readlines('problems.md')
def topics(problem_lines, slug)
line = problem_lines.find { |l| l.start_with?(slug) }
line.split(?|).last.split(/[\.,]/).map(&:strip)
end
config['exercises'] = config['problems'].map { |slug|
{
"slug" => slug,
"difficulty" => 1,
"topics" => topics(problems, slug),
}
}
puts JSON.pretty_generate(config) |
|
Oh. You got me. That's one other thing (other than section headers) that problems.md has that this doesn't.
Ah. I'll think about whether it can possibly get merged into the README or something. |
exercism/DEPRECATED.x-api#137 confirms it is safe to do so.
Rebased for largest-series-product's addition. I think I'll merge soon and create an issue to discuss problems.md. |
History: Thanks to the hard work of #167 and #127, we have topics in problems.md that tell why we ordered problems a certain way. After #229 (motivated by #179), we copied the topics into config.json, since now all tracks can take advantage of the "topics" concept. To reduce duplication, we can remove the topics and specific problems. This commit uses something more abstract, that states our values without going into the exact implementation. This requires less maintenance, and is less likely to go out of date than specifically listing problems. Since it only has the ordering philosophy and not the actual topics, it's time to rename it to problem_ordering.md. Closes #236
#exercism/DEPRECATED.x-api#137 confirms it is safe to remove the problems key
All difficulties are 1, and topics are copied from problems.md
Completes two of the three steps in #179, with the only remaining step
being to assign difficulties.
This step will be completed at a later time.
Closes #195 via replacement
Question for reviewers: problems.md now duplicates config.json in both problem order (it was already duplicating it in this regard) and topics (added). So, what should we do about this duplication?
There is one piece of information in problems.md that is not present in config.json, if this PR were to be merged as-is: Section headers
Option 1: We could do something really silly like "the first (not ALL, that is duplication) problem of a section gets a
section_name
and asection_description
", like this:(and so on)
Option 2: Keep the problem order duplicated in problems.md along with keeping the section headers there, but remove all topics from it, pointing to config.json as the authoritative source for the topics?
Option 3: Remove problems.md completely, losing our section headers.
Option 4: Keep problems.md as-is, accepting the duplication of topics.
Please also provide alternative options, if you have any.
I find option 4 completely unacceptable, but can be convinced of the other three options. My leading option is 1, and I will execute this option shortly after merging this PR if not convinced otherwise (I can even fold it into this PR if we want)