Giter Club home page Giter Club logo

advent-of-code-runner's People

Contributors

beakerandjake avatar dependabot[bot] avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

advent-of-code-runner's Issues

Add progress command.

Potential things to output:

  • Fastest solution runtime ever
  • % of year successfully completed
  • Average solution runtime.
  • % correct on first attempt
  • Average number of attempts
  • num of completed problems
  • most failed attempts

Store rate limit data elsewhere

This should probably be stored in an ignored file in the users repository instead of being checked into source control via the user data file. It's annoying to have git changes every time you fail a problem, also you can easily beat the rate limit by just reverting the file.

Manual set answer command

If user has submitted answers outside of CLI there isn't a way for cli to store the fact that the puzzle has been answered. Add command which lets the user manually set the correct answer for a puzzle.

Init command - ask user questions

Get user input during the init command. Something interactive like eslint init or npm init. Probably need library like inquirer.

  • Inform user that init will overwrite existing files in the repository - Y/N
  • Bail if no package.json is present - Tell them to run npm init.
  • Warn if package.json isn't of type module - Ask them if they want a fix?
  • Update package.json and add scripts to run
  • Ask for Year
  • Ask for Token
  • Create .env file (use template file)
  • Create .gitignore file (use template file)
  • Create README.MD file (use template file)
  • Create solution files - Ask for folder (default /src/solutions)

Store fastest runtime per problem.

If the user successfully answers the problem, store the execution time. Update this whenever the user re-solves the problem and gets a faster execution time.

Enhance CLI Actions

Add decorator / chain of responsibility / builder ability to CLI actions. Instead of passing actual action to the command pass in a special function. The function takes a chain of validators / decorators as its first param and the actual command action as its second param.

The function will create an args object from whatever commander passes to it, then it will invoke each function in the chain of validators lineally. If a function is a validator it can throw an exception if a precondition is not met. A function can also mutate the args passed into it by returning an object, this object will be the args that is passed to the next function and finally to the actual action function.

If none of the validators in the chain throw an exception the action will be invoked with the args object.

Recover and resolve certain errors via cmd

Some errors we can provide a fix for. Errors like SolutionFileNotFound or SolutionFileMissingFunction. If these errors are raised, we can prompt the user asking them if they want to fix the problem.

For

  • SolutionFileNotFound - create the solution file
  • SolutionFileMissingFunction - add the function to the end of the file.

Require .env file?

Minimum needed is year / token. If these are not present bail.

Don't allow override via command line?

How handle multiple years in one user repo if add this?

Correct answer is not set

After getting a problem correct, the correct answer field is not set in the user data file, instead it is added to the incorrect answers array.

Dont require token until absolutely necessary

Currently in order to run most commands a .env file with the auth token must be present, without this token the commands will fail. The .env file is secret and is not meant to be checked into source control. This creates an issue where a users repository can only be ran on their machine.

As a user solves problems their input files are downloaded and cached, and should be committed to source control. Since the input file is present an auth token is not required to solve a puzzle with a cached input file. If another user wants to download someone else's repository and run their solutions they will not be able to even though they technically should be able to.

Change the solve commands to not require auth immediately, instead only attempt to grab the auth token when downloading an input file.

Add watch command

Watches for changes in solution files and executes that file. Something like nodemon.

Add test command

This command will re-execute every solution file which has a correct answer. It will compare the returned answer with the correct answer and fail the test if the answers do not match.

This can help them ensure that their code still works when they perform refactoring or changes.

Store version in aocr-data.json

Store version of application that the data was init with, this will help with potential migrations in the future if there are breaking changes.

Better data storage

Lots of io when reading / writing to data store json file. Could potentially cache the contents and invalidate cache on write. Might need to watch file for changes too.

Could potentially move to a different solution like sqlite but that would increase module dependencies and size.

Update Rate Limit on API Failure

An api call is an api call, update the rate limit even if an error is thrown during the api call (for example a bad response)

Add autosolve / autosubmit command.

Instead of the user having to specify which problem to answer, instead automatically choose the earliest unsolved problem and run that one.

Ex. If they have completed all parts of days 1,2,3,6,7,8 and only part 1 of day 4 and part 2 of day 5, then the command would choose day 4 part 2 because that's the earliest problem they have not solved.

Init command overwrites .gitignore

If the user has a .gitignore file which does not include the required .env line, the init command will replace the entire file contents instead of appending.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.