Home

Awesome

ChallengeBase

Swift package aimed to work jointly with Swift projects to provide a relatively straightforward way to work with numerous Coding Challenge websites.

Some examples of compatible Coding Challenge websites include, but are not limited to:

See it in Action!

Check out my Code Challenges Repository for a demonstration on how to use this package to its fullest.

How Would You Use This?

There are a couple of ways in which you could use this package.

Start with our Challenge Starter Template

Over at my Challenge Starter Template Project, I have prepared a bare-bones Xcode application that can be used to get started quickly. Please do check it out!

Through Swift Package Manager

If you have an existing Xcode/Swift project that you'd like to add this package to, you can follow these instructions:

  1. Within Xcode, with your project open, select File > Add Packages... from the menu bar.
  2. On the dialog window, enter the URL for this repository: https://github.com/Kaitachi/ChallengeBase
  3. Thus far, it is recommended that you set a Branch dependency rule that follows the main branch

Swift Package Manager

How It Works

This package is built with a relatively simple and encompassing set of observations about Coding Challenges:

  1. Coding Challenges oftentimes contain a set of sample data on which to execute some algorithm to solve a specific problem
  2. When this sample data is executed, and output results match expected results, we can then perform the same algorithm against some "real" data that will output the result required to answer the given problem

Using these very same rules, the following concepts were developed:

There can exist more than one Test Case per Solution, and there can definitely exist more than one Solution per Challenge. All of these concepts are further developed in the Challenge Starter Repo and the Code Challenges Repo. Be sure to check those out!

Reducing Coding Challenges to just these three components, essentially everything needed for solving them can be created using these building blocks! You can check out a working version of this over in my Code Challenges Repo.

NOTE: This package doesn't add a huge variety of utility methods. This is done purposefully, mainly to encourage your own helper methods on your own projects. So, get creative! =D

Want to Contribute?

Contributions are by all means allowed and encouraged here! It is likely that things can be improved for readability, comments explaining how certain parts of the code work, or even to Swift-ify things around. Whatever improvement you see, it will be more than welcome.