Bank of challenges & solutions from r/dailyprogrammer for people learning to program

Overview

DailyProgrammerChallenges

This repo contains all of the challenges from r/dailyprogrammer and also scripts used to pull challenges from the subreddit 3 times per week and to cleanup directories & remove unnecessary posts.

Requirements

  • Python 3
    • praw
    • pprint

Installation

$ pip3 install -r etc/requirements.txt

How to use

The script can also be run via the command line by running ./post-challenges.py <number_of_challenges> It will look for a copy of praw.ini, an example is in etc/praw.ini.example

You may wish to run this in a temporary directory, to avoid adding folders directly to the top directory of the repo. Move the various levels of challenges into their respective end points.

Example full run

$ cd DailyProgrammerChallenges
$ mkdir tmp
$ cp etc/praw.ini.example tmp/praw.ini
$ cd tmp
# Edit praw.ini with the correct info
$ ../post-challenges.py
# Take a look at what was downloaded for any 'problems'
$ mv *Easy* "Easy Challenges/."
$ mv *Intermediate* "Intermediate Challenges/."
$ mv *Hard* "Hard Challenges/."
$ cd ..
$ ./transform.py

Examine the changes that transform.py performed and check that they seem okay.

Challenges & Solutions

See a missing challenge & missing selftext? Want to add a solution to a challenge? See the CONTRIBUTING.md file for how to submit changes.


Creator: Freddie Vargus

Uses the MIT License

This project was inspired by LewisJohnson, whom I collaborated with on a similar repository.

Comments
  • Adding Table of Contents like list of the solutions to the challenges directory

    Adding Table of Contents like list of the solutions to the challenges directory

    Since we'll be having multiple solutions, possibly multiple per-language, I think it'd be nice / beneficial to have a table of contents like log of all of the solutions in the challenge directory, with a short description of the solution. This would encourage people to solve the solution different ways, and could prove a quick overview of the submitted solutions.

    This listing could also include the solution author's name, as a quick view of everyone that contributed to that challenge.

    For example, a solution that utilizes a quick sort could be submitted, and someone or even the same person could also upload a solution that utilizes a randomized quicksort.

    I think it'd also make browsing the repo more user-friendly, as you could relatively easily get a feel for what kind of solutions have already been submitted without having to open every solution file.

    Thoughts?

    discussion 
    opened by nivintw 19
  • Update to post-challenge and new challenge

    Update to post-challenge and new challenge

    I was unfamiliar with working against Reddit's APIs, so please feel full freedom to reject or request alterations to this pull request.

    What I found was:

    • It appears that the praw api has evolved since post-challenges.py was created and I have updated post-challenges.py according to what I believe is the expected behavior.
    • As a test, I have added in challenge 336, which post-challenges.py pulled from Reddit.
    • In a future pull request, I would like to update the documentation to provide guidance on how to use praw and the setting up of a reddit api access key, as that information was not in a convenient single location.
      • I would also like to update the documentation about the reference to a post_challenges script that seems to no longer exist in the repo and another script referenced inside of post-challeneges.py that is also not there (send-data.sh)
    • After we have discussed these updates, I will submit more pull requests that fit what you would prefer.
    • The naming convention appears to have shifted and challenges appear in the repo that do not follow what is requested in CONTRIBUTING.md, i.e. #336 vs 0336 and so on. Would be happy to rename and resubmit those to follow the naming convention
    opened by colbygk 13
  • File naming for open-ended solutions

    File naming for open-ended solutions

    Hello! Just got here from r/ruby and decided to poke around the repository. I've noticed that some challenges e.g.

    https://github.com/FreddieV4/DailyProgrammerChallenges/tree/master/Easy%20Challenges/Challenge%20%230002%20%5BEasy%5D

    Are open-ended and the contribution guidelines doesn't cover challenges of this nature; the calculator application can be anything from calculating acceleration to weight of an object, for instance.

    We should have a naming convention for these types of challenges too!

    discussion 
    opened by causztic 10
  • Adjust Formatting for Directory Names

    Adjust Formatting for Directory Names

    From CONTRIBUTING.md

    Please use the following name format when creating a challenge directory:

    Challenge #xxxx [Easy/Intermediate/Hard] Challenge Name

    Example:

    Challenge #0251 [Hard] ASCII Nonogram
    Challenge #0254 [Intermediate] Finding Legal Reversi Moves
    Challenge #0253 [Easy] Unconditional Loan Income
    

    The challenges in Easy Challenges have this formatting, but the challenges in Intermediate Challenges && Hard Challenges do not currently follow this format.

    hacktoberfest formatting 
    opened by freddiev4 8
  • Challenges that are tightly coupled with input files

    Challenges that are tightly coupled with input files

    The contributing guidelines don't specify what should be done for challenges that are tightly coupled with input files. Example of one is [Intermediate] no.19 which links to text file needed for the program. Should these type of files just be included in the folder for the challenge?

    discussion 
    opened by hoenn 7
  • Replace 'Trash' in Selftext

    Replace 'Trash' in Selftext

    The challenge_text.md file of some challenges contain trash in it due to some encoding errors while pulling the selftext from the respective r/dailyprogrammer post.

    Challenges Containing Trash:

    ~~- Easy Challenges/Challenge # 241 [easy] Unicode Chess/challenge_text.md~~ ~~- Easy Challenges/Challenge #114 [Easy] Word ladder steps/challenge_text.md~~

    • Easy Challenges/Challenge #166b [Easy] Planetary Gravity Calculator/challenge_text.md
    • Easy Challenges/Challenge #214 [Easy] Calculating the standard deviation/challenge_text.md
    • Extra-Bonus Challenges/Challenge #207 [Bonus] Erdos Number Calculator/challenge_text.md -Hard Challenges/Challenge # 241 [Hard] Chess Puzzle solver/challenge_text.md
    • Hard Challenges/Challenge #121 [Hard] Medal Management/challenge_text.md
    • Hard Challenges/Challenge #129 [Hard] Baking Pi/challenge_text.md
    • Hard Challenges/Challenge #208 [Hard] The Universal Machine/challenge_text.md
    • Hard Challenges/Challenge #248 [Hard] NotClick game/challenge_text.md
    • Hard Challenges/Challenge #50 [difficult]/challenge_text.md
    • Intermediate Challenges/Challenge # 241 [intermediate] ascii Bitmap Chess/challenge_text.md ~~- Intermediate Challenges/Challenge #184 [Intermediate] Radioactive Decay/challenge_text.md~~ ~~- Intermediate Challenges/Challenge #38 [intermediate]/challenge_text.md~~ ~~- Easy Challenges/Challenge #213 [Easy] Cellular Automata - Rule 90/challenge_text.md~~
    enhancement hacktoberfest 
    opened by freddiev4 6
  • Reserved characters in directory names causing errors - Windows

    Reserved characters in directory names causing errors - Windows

    When trying to clone the project (using: git clone https://github.com/FreddieV4/DailyProgrammerChallenges.git), I'm running in to errors that I think are due using a reserved character in a directory name. When I try and clone I get:

        fatal: cannot create directory at 'Easy Challenges/Challenge #0257 [Easy] In what year were most presidents alive?': Invalid argument
    

    I've googled around, and found that windows has a bunch of reserved characters that cannot be used in directory names such as:

    • < (less than)
    • (greater than)

    • : (colon)
    • " (double quote)
    • / (forward slash)
    • \ (backslash)
    • | (vertical bar or pipe)
    • ? (question mark)
    • * (asterisk)

    The question mark in "Challenge #0257 [Easy] In what year were most presidents alive?" needs to be removed, and I'd gladly do it myself but I can't clone the project to fix it.

    bug/error formatting 
    opened by JamesJDillon 4
  • Don't update repo if challenge exists

    Don't update repo if challenge exists

    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)

    enhancement 
    opened by freddiev4 2
  • Wrong name of Easy Challenge #266 folder.

    Wrong name of Easy Challenge #266 folder.

    This week's easy challenge has a : in the name of the folder, which causes some problems as we can't have : in a folder name.

    The sequence \/:?*"<> should be ignored in folders name.

    bug/error 
    opened by Ouss4 2
  • Implement go solution to Easy #257

    Implement go solution to Easy #257

    https://www.reddit.com/r/dailyprogrammer/comments/49aatn/20160307_challenge_257_easy_in_what_year_were/

    Solution is in go using Marzullo's algorithm. I haven't used go much so I implemented the solution to an easy problem to experiment with the language.

    opened by ghills 2
  • added easy & intermediate challenges for #219

    added easy & intermediate challenges for #219

    Not sure if you want to rename the directory for the Easy challenge.

    When it was originally posted to the subreddit, it was typo'd as 218 instead of 219, so it looks like there's two 218 challenges.

    opened by auwsmit 2
Owner
Freddie Vargus
SWE @github Data
Freddie Vargus
This is new projec based in apps to chat or messages people to people

Stranger This is new projec based in apps to chat or messages people to people Esta aplicacion tendra las siguientes caracteristicas: 1* Es 100% segur

Juan Duque 3 Nov 3, 2021
Software to support people learning OpenMP with our book

Software to support people learning OpenMP with our book ... The OpenMP Common Core: Making OpenMP Simple Again

Tim Mattson 53 Dec 14, 2022
Bank Management System - Written In C

Bank Management System Bank management system writtetn in c About The Project Compile And Running Usage About The Project When I researched about bank

Hakkı Anıl Ragıboğlu 10 Sep 15, 2022
A multi-bank MRAM based memory card for Roland instruments

Roland compatible multi-bank MRAM memory card (click to enlarge) This is a replacement memory card for old Roland instruments of the late 80s and earl

Joachim Fenkes 23 Nov 25, 2022
Bank Management System is based on a concept of recording customer’s account details

Bank Management System is based on a concept of recording customer’s account details. Here the user can perform all the tasks like creating an account, deposit amount, withdraw amount, check balance, view all account holders detail, close an account and modify an account. There’s no login system for this project. All the main features for banking system are set in this project.

AmrMohamed 2 Feb 12, 2022
A transaction processor for a hypothetical, general-purpose, central bank digital currency

Introduction OpenCBDC is a technical research project focused on answering open questions surrounding central bank digital currencies (CBDCs). This re

The MIT Digital Currency Initiative @ Media Lab 794 Dec 28, 2022
Open source release of challenges and other code used in the Hack-A-Sat 2 Qualifier in 2021.

Hack-a-Sat 2 Qualifier This repository contains the open source release for the Hack-a-Sat 2 qualifier from 2021. Released artifacts include: Source c

Cromulence 59 Sep 18, 2022
Capture the flag challenges

CTF-Challenge Description Internet technology will dominate the future world, but at the same time new cyber security challenges emerge. Through Techn

HKCERT 29 Nov 28, 2022
Repo of HACK@AC 2021 Challenges and deployment

HACK@AC 2021 The challenges were made by the following contributors: dbsqwerty Ocean MiloTruck Wealthyturtle Lord_Idiot daniellimws lampardnk samuzora

null 6 Mar 9, 2022
A port of the Linux x86 IOLI crackme challenges to x86-64

This is a port of the original Linux x86 IOLI crackme binaries to x86-64. The original set of IOLI crackmes can be found here: https://github.com/Maij

Julian Daeumer 4 Mar 19, 2022
Deitel & Deitel - "C How To Program" - solutions to exercises

Deitel & Deitel - "C How To Program" - solutions to exercises Intro Here you can find my solutions for Deitel & Deitel - "C How To Program". The code

Luca Braglia 77 Jan 3, 2023
Threat Emulation and Red Teaming Framework, The Hacking Software for normal people.

The Remote Hacker Probe is a Threat Emulation and Red Teaming Framework built to be easy to use. The Remote Hacker Probe is Feature Rich! Including, K

QuantumCored 179 Jan 5, 2023
A simple wrapper for 'pacman' with a syntax similar to 'apt' to help people transitioning to Arch and Arch based distributions like Manjaro.

aptpac aptpac is a program which helps with the transition to Arch Linux and Arch based distros like Manjaro. It simplifies using pacman as it works l

Itai Nelken 18 Dec 4, 2022
Off The Grid (OTG) Messenger is an easy way for people to communicate through text messages when in remote areas.

Off The Grid (OTG) Messenger is an easy way for people to communicate through text messages when in remote areas. With a theoretical transmission range of 10 miles (16kms), OTG messenger can be used by groups of people to stay connected when they are in areas not serviced by mobile connectivity.

Trevor Attema 493 Dec 10, 2022
The Xnoe Operating System, for people who want an OS that is useless.

Xnoe OS An attempt at writing an "Operating System" in x86 assembler. Hi all, I have many hobbies, one of those is torturing myself with knowledge I p

Xnoe 10 Oct 7, 2022
To turn on and off the pump, most people use a manual switch.

To turn on and off the pump, most people use a manual switch. As a result, people forget to switch off the pump from time to time, resulting in water overflow. They may forget to switch on the motor at times, resulting in a water problem later on. It also wastes a lot of electricity. To solve this problem, we need a smart device to control the pump.

Md. Asad Chowdhury Dipu 1 Aug 20, 2022
ClickLock which supports old games where the Windows ClickLock fails to work. This is a charity project, designed for people with disabilities.

Mouse ClickLock For Games This small utility works in a similar way as ClickLock available on Windows, but also supports old games where the normal Cl

null 7 Oct 8, 2022
🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.

?? ImHex A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM. Supporting If you like my work, plea

WerWolv 23k Dec 30, 2022
A repo for helping people get started with Competitive Programming and Data Structures & Algorithms

Hack CP DSA Update regarding hacktoberfest: please refer this announcement Wanna improve your problem solving skills ❓ Wanna practice collaborating on

TLE MEC 177 Dec 21, 2022