Skip to content

Conversation

@tomer953
Copy link
Contributor

@tomer953 tomer953 commented Oct 2, 2023

As discussed here: #154

I implemented sorting by difficulty.

challenge-number.json contains counters for each difficulty:

{
  "total": 35,
  "🟢": 12,
  "🟠": 116,
  "🔴": 207
}

Notes

  1. I chose to use 1, 101, 201 (and not 100, 200) to be consist (since "easy" starting with 1, and not from 0)
  2. I first reordered manually all the items by diffulty (first commit), and test it, then moved to the generator.ts part

I found two bugs in the current implementaion (regardless to the sort order) -
a. new challanges is created with the wrong index (try to create one now, the filename will be 35-foo, when its need to be 36-foo, since 35 already taken)
b. even in dry-run mode, two files were created, this is because you used writeFile (and readFile) from fs instead of nx tree

I fixed them both.

please review and test

@tomalaforge
Copy link
Owner

Yes that's true about the bugs. I fixed them but didn't push the code 😅 But thanks for fixing it

@tomalaforge
Copy link
Owner

This is really nice and perfect. UX is so much nicer 🔥

Thanks a lot for this PR.

@tomalaforge tomalaforge merged commit e37ab68 into tomalaforge:main Oct 2, 2023
@tomalaforge
Copy link
Owner

@all-contributors add @tomer953 for doc,code

@allcontributors
Copy link
Contributor

@tomalaforge

I've put up a pull request to add @tomer953! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants