freddiev4 / dailyprogrammerchallenges

Bank of challenges & solutions from r/dailyprogrammer for people learning to program
http://reddit.com/r/dailyprogrammer
MIT License
311 stars 64 forks source link

Don't update repo if challenge exists #163

Closed freddiev4 closed 7 years ago

freddiev4 commented 8 years ago

Every M/W/F, the repository is updated with that day's E/I/H challenge; this assumes that, on all three days, there is a new challenge. Some week's there are not three challenges, just one or two. If this occurs, the script will end up pulling a second copy of the already existing challenge(s) and won't move them into the correct directory, and keep them in the parent directory.

The scripts should be updated such that if the challenge already exists, the repeat challenge will be removed; this would either be invoked by an error or by cross-checking pulled challenge names with existing ones (though the latter would be much more expensive)

ieabbas commented 8 years ago

Two questions about this. First, what language are the scripts in? I assume Python, but haven't had a chance to learn it yet. Second, even if the latter method is expensive, wouldn't it be better to implement it and then go on from there optimizing afterwards?

freddiev4 commented 8 years ago

@ieabbas the scripts are in Python; as far implementing the latter method of checking for existing challenge names, I suppose it could be implemented and then later optimized. Just haven't gotten around to doing it.