/r/ProgrammingPrompts

Photograph via snooOG

This is a subreddit for programmers to share simple project ideas to help those who are beginning to gain experience and those who are experienced to stay sharp.

This is a subreddit for programmers to share simple project ideas to help those who are beginning to gain experience and those who are experienced to stay sharp.

NO HOMEWORK ASSIGNMENTS! Such posts will be caught, deleted and submitters will be banned without further warning.

Please keep submissions on-topic. For programming help on personal projects or homework, head to /r/learnprogramming. For questions about careers or prospects, /r/cscareerquestions is helpful.

Although we ask that you refrain from linking to long lists of pre-prepared potential projects (unless the list is very truly acutually bomb), linking to others' project ideas is a great way to spread good ideas! Please do so through in-text links like this!

Please be descriptive enough and include citations like they're a dime a dozen (in other words, don't expect others to know what is obvious to you)! If your prompt must be completed in a specific language, such as javascript, please include the name of the language it must be completed in in brackets at the end of your prompt's title. Posting solutions is very encouraged and please, always make sure to post what language was used in comments!

Remember four or more leading spaces will mark your text as code as will the backtick key inline.

Let's see if we can find every solution to every prompt!

example: Write me a Hello, World program in python!

def main():
    print(Hello, World!)
main()

/r/ProgrammingPrompts

11,584 Subscribers

7

My Two Dogs

I thought of this back when walking my dogs at my parents' mini-ranch.

Suppose we have a human walking two dogs. One is a slower bigger dog. The other is a faster smaller dog. The human is obviously the biggest and slowest. The human wants to walk the dogs in a wide circle (or whatever path you like) but the dogs keep tugging in all different directions.

Pick weights for all three. Maybe 60kg (for the human), 10kg (little dog), 25kg (bigger dog).

Pick lengths for the dog leashes. Maybe 2 meters each.

Plot or animate the three (circles or dots are fine) attempting to walk a circular path.

Or just plot the human getting dragged in whatever path the two dogs choose.

Some things to consider:

  • A dog will only exert force on the human if their leash is fully extended.
  • Both dogs will exert a different force based on their weight and speed.
  • The dogs will wander in random directions for random lengths of time.
0 Comments
2024/05/14
12:35 UTC

3

A snippet of code that looks like it does something else, but when run it prints "Gotcha!". There should be no string with value "Gotcha!". How obscure or surprising an answer can you come up with?

Extra points: It should look like it does something sensible, and not random bit managing, at first glance you would expect something, but something else happens. The ideia is not to make the code unreadable, but "easily-wrongly-readeable". I don't want to do anything shady - it's to teach a few friends about code readability. Thanks for any effort"

4 Comments
2024/02/02
00:37 UTC

2

Boxes / Containers database

I had an idea of database where you can store data about boxes in tree format. The structure of box object looks like this:

Box structure:

Attribute nameValue TypeDescription
idnumber (unique, counted globally)This number will be used for operations on that container.
attributiveskey-valueIn this object attributes like name, size, location will be stored. Attributes will be used for searching and filtering.
boxesarray of boxes objectsThis allows the boxes to form a tree structure.

Actions on that data will be preformed in javascript. The actions needed are add, delete, edit, filter and search. The data would be saved in JSON. Easy integration to other applications is needed.

2 Comments
2023/03/06
18:36 UTC

4

Quizlet Web Scraper

Create a program which requests a Quizlet flashcard set URL and scrape it for the term and definition of every card in the set.

Save the term and definition in a json, csv, or any other big data file type.

1 Comment
2023/01/21
20:23 UTC

9

Custom color-by-number

I had this idea a while ago but don't have very little programming knowledge, so I figured I'd come here!

It's a custom color-by-number, so instead of using paint, it uses Crayola colored pencils. Depending on how detailed you would like the picture, it can use either 12, 24, 36, 50, etc. count boxes.

Is this something that would be possible and the picture actually ends up looking good? Essentially you would be able to upload a picture, then a pdf would be created with all the numbers and colors to use. Finally, just print and color using standard store-bought Crayola colored pencils.

Would love some insight on this idea and if you know how to make it please reach out!

11 Comments
2022/11/11
00:55 UTC

6

Create a runoff voting system with simple UI

MVP would be a simple two-round runoff model.

A stretch goal would be to be able to select from different types of runoff voting models.

This would also be an ideal next-step after finishing the Django tutorial which includes a basic poll app.

References:
https://en.wikipedia.org/wiki/Runoff_voting
https://docs.djangoproject.com/en/4.1/intro/tutorial01/

0 Comments
2022/09/19
19:58 UTC

7

A script/bot to identify all addresses on Google Maps (in a range) that satisfy a given trait or keyword, targeting those keywords EVERYWHERE in the data associated with the address instead of just the name and default labels like Google seems to do.

I originally wanted something like this for urban exploration (post) because Google Maps has a built-in feature to identify a place as "Permanently closed," but doesn't allow you to filter for that. Simply searching "Permanently closed" shows some results but not others, and sometimes those addresses don't even display on the map (They only appear once you specifically search for it). I'm not a programmer by any means, but I was thinking that if you have a bot or script check every address in a range (either through whatever database or API Google Maps provides, or by entering addresses from an external database if it has more than Google does) it may be possible to get more results.

While that is the main draw for something like this to me, it seems like it could be useful in general as well. Searching for other keywords like "Restaurants" or "Barber" sometimes seem to do a pretty bad job at finding stuff, either not displaying things until you get really zoomed in or just straight up missing something that has those key words somewhere in the name or description. A bot that looks through all the addresses and shows a map that truly shows all the locations that satisfy that search, whether the keyword is directly in the name or hidden somewhere Google apparently doesn't check that well like a description or review, could be really useful.

2 Comments
2022/09/05
20:20 UTC

1

Universal Filter & Sort Browser Extension (Advanced?)

0 Comments
2022/05/27
13:35 UTC

0

Let’s create a “Popular Congress”

With modern technology we should be able to change the way we achieve democracy.

Rather than voting on “politicians” we should be voting on “policies”

Bio-verification in smart phones is widespread now. It’s a good time to implement a verifiable voting system via these devices so that we, the people, can choose what is best for our country. It would be a truer more direct democracy. We would no longer need to elect other people to represent us because we would be able to represent ourselves directly.

Maybe utilize a form of blockchain so that votes can’t be altered by any outside party

I just don’t know how to code. I took some codecadamy courses a while back but never got that far into it.

The hardest part would be the red tape, getting this kind of thing actually voted into the system by the very representatives it would set to dismantle.

Soooooooo, what do ya’ll think?

13 Comments
2021/10/17
19:54 UTC

17

Build a reddit search system

Build a simpler version of reddit search system that will take a query as input and return the matching post results.

Some instructions and examples are given below to get started (You can use any language you want. Instructions use javascript style just for representation)

// 1. Create some dummy data similar to reddit text posts
post1 = { title: 'Build a reddit search system', description: "Build a simpler version of reddit.....", id: 1 }

// 2. Store all the data in one data structures e.g. array
postArray = [post1, post2, ....]

// 3. Index postArray data for fast search (any changes you want to make for quick and better search. Google about "search indexing" or watch the video I shared.
function indexData(postArray){...}

// 4. Create search function that will print the returning posts
function search(query){...}

// 5. Bonus: highlight the matching lines

You can learn about key terms used in search systems using this video on how google search works. I will also build it and share my work at the end of this week.

2 Comments
2021/06/08
02:16 UTC

20

Write a network server that serves a SQLite database in your dominant language. Write a client in a different language.

2 Comments
2021/06/07
04:21 UTC

16

An Educational Game: Tribe

The Gameboard. We have Africa divided into assorted zones along with three possible start points.

So the game is for 2-3 players.

Each player gets a language development card deck.

Game play: each player rolls 1d6. This is the number of starting cards you can draw from your language development deck.

The name of your tribe is made from this initial alphabet.

Your first game piece is on the start point.

What happens during a turn?

step 1: Turn Option

A. Move an existing piece to an adjacent location.

or

B. Attack a rival on an adjacent location. This is a massacre and you take the location from your rival.

Or

C. Spawn a new piece from your start location-only if you have an existing piece on start location. The new piece is moved into an empty adjacent location.

Or

D. develop language. Roll 1d6. Draw new alphabet cards from your language deck equal in number.

Step 2: Check language Development. If you can spell a word from your drawn alphabet- words like farming, pyramid, canoe, boat, then your tribe has developed these. If you can spell canoe and have secured a location next to madagascar, you can move a game piece to the island next turn. If you can spell boat you can sail from any coastal location to madagascar next turn.

As your tribe occupies the map, in conflict with your opponent(s) the game continues until you gain all 26 letters of the alphabet before your rival, or wipe out your rival.

Its just a little educational game I created for public domain as an outflow of my linguistic archaeology research. So feel free to turn it into a billion dollar online franchise.

Game board

Cards A-M

Cards N-Z

2 Comments
2020/11/15
10:41 UTC

5

Creating a fake credit system for a school's project website.Need guidance

Hi yall. So as title say's I have created a game website. So I need to add some thing to it to look more realistic. So I have a question Can I do like fake credits system which grants like 500 like 'we happy your are signed in so here is your 500' and than I would create mini-games which costs like 50 to enter and play on website. Depending of score it would grant some more credits to persons account. So I need help or guidance from where to start. Any tips would be apprecianted. I can write codes in C++, mySQL, ,PHP , HTML, CSS, JAVASCRIPT. Keep in mind I know these language's in begginer level and I can read more on subject or something to learn much more to my requested topic . But main project is done throught PYTHON with FLASK and I can use any code language's I want to add in some thing to it. So if anyone have any tutorial links or experience in that or plan how to realise it. I would highly appreciate it. If anyone require's info on code or something from me feel free to ask and critise. Thank you in advance !

2 Comments
2020/10/30
08:24 UTC

22

Determine the least number of coins possible to make change

This is a somewhat simple one inspired by my working at a grocery store. Write a program capable of telling you the smallest number of coins you can make change with for a given amount. Examples, 25¢ should return 1, 35¢ should return 2, and 58¢ should return 6. I’m working off of American currency here but whatever you use should work just fine too as long as you adjust for it.

Bonus features for a extra work:

  1. Make the program also tell you what coins you received
  2. Write this as a recursive method
  3. Add a feature that allows the program to make change if you’re out of a certain coin. Example: 20¢ can be made with two dimes but if you’re out of dimes you’d need 4 nickels. You can take this further by making it able to work with only a certain number of coins. For example, having one dime, you can make change for 20¢ with a dime and two nickels.
  4. Combine ideas 2 and 3
  5. Create a register class that keeps track of how many of each coin you have and totals up how much is in the register, this is well combined with idea 3.
5 Comments
2020/06/14
18:46 UTC

9

Do you have space-related prompts or challenges?

Hi, I'm quite into science and space and something related to that might be encouraging to keep on learning!

5 Comments
2020/05/31
00:04 UTC

2

Word decoder

I've been trying to think of a way to do this on python,

It works as there are 5 columns with letters in it The columns can me mixed and see how many possible words you can make for example

Column 1: L O B F A K N E R I Column 2: L I N A Z U F O M E Column 3: E W T N V A L S G P

You can make the word BEN From the B in column 1, E in column 2 and N in column 3

4 Comments
2020/05/06
09:53 UTC

6

How best to implement this?

Hi all!

I feel like this is a good prompt but also might help people think outside-the-box for a problem I have!

I'm in the military and we have a scheduling problem at my job that I believe can be solved via a relatively simple tool, but the concept could be difficult to implement and I'm looking for some ideas.

We have difficulty scheduling 100+ people with shifts, training, business trips, etc. Most people tend to use excel for this sort of thing but it's a massive amount of work and just not an ideal solution.

I'm looking to create a visual schedule of all personnel, laid out horizontally, that will block off dates with activities/etc. and allow for the input of new events, changing dates, colors for different type of activities, etc. I'd really like this to be able to create a "draft" schedule and also drag/drop items around on the schedule... i.e. much more dynamic than it is in a static excel sheet.

Here's the problem: being on a military network I can't just (1) run my own web server, (2) I have access to a limited set of tools (Microsoft Access/Excel/etc.), and (3) I don't believe going to a pre-built, paid solution that's hosted by a third-party will be approved.

(I know PHP/CSS/MySQL, Java, and have dabbled in some frameworks like CakePHP.)

Any thoughts?

Appreciate any feedback!

5 Comments
2020/05/01
15:33 UTC

12

We arelooking for help in creating a corona tracking app

Hey everyone!

Under the hackathon of the german Bundesregierung we crated a BLE Tracking app.

We wanted to do this open source and as a community driven project, but until now this was not really succesfull. Iam a first grad student and dont have the time nor the knowledge to realize this alone.

https://github.com/MoritzGan/TrackCovidClusterAndroid

Iam know looking for People that maybe want to join forces and create a really open source and privacy preserving tracking App.

If you are interested and know android dev/ java/kotlin/ swift or ionic/ angular please pm me :)

Everyone is welcome!

0 Comments
2020/04/27
09:17 UTC

4

Is this possible? Please be kind

2 Comments
2020/04/14
16:07 UTC

6

optimize this function if you're bored.

private float roundTarget(float target) {
if (target > 0) {
if (target <= .5f) {//greater than zero but less than .5
return target = .5f;
}
return target = 1;//greater than .5
} else if (target < 0) {//less than 0
if (target >= -.5f) {//less than 0 but greater than -.5
return target = -.5f;
}
return target = -1;//less than -.5
}
return target = 0;
}

6 Comments
2020/04/01
13:47 UTC

6

Looking for ideas

Hi Guys! I’m a freshman and I’m looking to take part in my school’s optional self directed development project during the summer. I will have to create a web application with a database backend as part of the project. Can I have ideas on what I can develop that would meet the requirements?

3 Comments
2020/03/04
15:33 UTC

15

Please spread the word around.

I created the sub r/GoProjectIdeas/ today specifically for golang enthusiasts who cannot find an idea for a project to work on or need others to contribute to their existing go projects. Hoping to see many contributors.

3 Comments
2019/08/11
05:57 UTC

12

Fizz Buzz Challenge. Except you can only use 1 line of code.

Here is my submission using the R programming language

code:

replace(replace(replace(1:100,grepl(0,1:100%%3),"FIZZ"),grepl(0,1:100%%5),"BUZZ"),grepl(0,1:100%%3)&grepl(0,1:100%%5),"FIZZBUZZ")

output:

 [1] "1"        "2"        "FIZZ"     "4"        "BUZZ"     "FIZZ"     "7"        "8"        "FIZZ"     "BUZZ"     "11"      
 [12] "FIZZ"     "13"       "14"       "FIZZBUZZ" "16"       "17"       "FIZZ"     "19"       "BUZZ"     "FIZZ"     "22"      
 [23] "23"       "FIZZ"     "BUZZ"     "26"       "FIZZ"     "28"       "29"       "FIZZBUZZ" "31"       "32"       "FIZZ"    
 [34] "34"       "BUZZ"     "FIZZ"     "37"       "38"       "FIZZ"     "BUZZ"     "41"       "FIZZ"     "43"       "44"      
 [45] "FIZZBUZZ" "46"       "47"       "FIZZ"     "49"       "BUZZ"     "FIZZ"     "52"       "53"       "FIZZ"     "BUZZ"    
 [56] "56"       "FIZZ"     "58"       "59"       "FIZZBUZZ" "61"       "62"       "FIZZ"     "64"       "BUZZ"     "FIZZ"    
 [67] "67"       "68"       "FIZZ"     "BUZZ"     "71"       "FIZZ"     "73"       "74"       "FIZZBUZZ" "76"       "77"      
 [78] "FIZZ"     "79"       "BUZZ"     "FIZZ"     "82"       "83"       "FIZZ"     "BUZZ"     "86"       "FIZZ"     "88"      
 [89] "89"       "FIZZBUZZ" "91"       "92"       "FIZZ"     "94"       "BUZZ"     "FIZZ"     "97"       "98"       "FIZZ"    
[100] "BUZZ"
15 Comments
2019/08/07
20:13 UTC

7

"Smart Fridge" application idea

Hi there!

As you probably saw this is my very first post on Reddit :)

But let's back to the main topic here which is my idea for an application - "Smart Fridge" (this is only idea for a name). So, everything here is only an idea, but I really would like to get a feedback from you guys - what you think about this idea, etc.

----------------------------------------------------------------------------------------------------------------------------------------------------

For who?

Application is dedicated for all people who have a fridge at home.

Problem to solve?

This situation very often happens - you are in a shop but you cannot remember if you still have a milk (or some other product) in your fridge.

Why this application would be useful?

Application for user would be available via smartfon/web (firstly web application and android app later in the future). Application would show all scanned products which are available in your fridge in real time. So when you would be in a shop you can just open application/web and see what you have in a fridge available.

How would it work?

I thought about a Raspberry Pi + some mini barcode scanner module. This computer would be installed inside the fridge. When you will be put a new product into a fridge you will have to scan the barcode of this product before put into. When barcode is scanned the Raspberry Pi would communicate with the API that product with this barcode has been put into a fridge and The API would do the necessary logic. The same thing would happen if "user" is going to get some product from the fridge, he would has to scan the barcode again (maybe some switch somewhere to inform that product is getting from the fridge and not put into - this is a problem to discuss).

Pros?

  • Product that are in a fridge are available online
  • For sure this would be a cheaper solution instead of buying some fridge with cameras inside (very expensive now)
  • This solution would be available for every fridge at home (just need some space to install Raspberry PI inside)

Cons?

  • Of course the biggest disadvantage seems to be requirement to scan barcode before put/get product into/from the fridge.
  • Raspberry PI inside the fridge will not propably looks good

----------------------------------------------------------------------------------------------------------------------------------------------------

What do you think guys about this idea? I would be very grateful for you opinion and feedback :)

6 Comments
2019/06/15
20:49 UTC

19

Make a tool that scrapes the change-logs of a wikimedia image to make an animated gif

I’m looking around the web for an animated gif of the maps of LGBTQ rights around the world, found here:

https://commons.m.wikimedia.org/wiki/File:World_laws_pertaining_to_homosexual_relationships_and_expression.svg#mw-jump-to-license

Disappointed that such a thing doesn’t seem to exist, I thought it would be great to have a software tool to automatically create this. And if one were making such a tool, it might as well work for any Wikimedia image with a change history.

(And I guarantee that this particular LGBTQ rights map animated gif would be front page material on /r/dataisbeautiful or /r/MapPorn.)

If anyone does decide to make this tool, please let me know by tagging my username when you release it!

34 Comments
2019/06/11
18:54 UTC

9

Six degrees of separation Javascript problem

As I haven't been successful, I'm asking if anyone has any ideas. I have to write a Javascript application which returns a list of actors that have been in both a movie with Keanu Reeves and Nicolas Cage. Sort of like a six degrees of separation. I have an API that I'm making a request to and I'm getting some data in return but I'm not exactly sure where to go from there?

9 Comments
2018/12/31
19:05 UTC

7

Actor search

Hi reddit. So I have a programming question that I need help with. I'm writing an application in Javascript where I have to come up with a list of actors that starred in movies with both Keanu Reeves and Nicolas Cage but not necessarily at the same time but I'm not exactly sure where to start?

9 Comments
2018/12/28
23:16 UTC

1

Create a print double extension for Chrome

Basically have to get a duplicate of everything i print for a lot of documents I have to print for uni. It is of course possible to click a button to raise the amount of copies printed but having it automated would help me a lot! Please let me know if this goes way beyond what is acceptable in this subreddit. I just want to give it a try.

0 Comments
2018/08/24
13:36 UTC

7

[Medium] Fire Effect in TEXT

Back in the Mode 13h days, the fire routine used to be one of the fun "first projects" for people playing with graphics. A line of random data would be generated and then smoothed upward. The numbers would correspond to a palette of available colors. An extra vertical bump would give the flame a smoother, less smoky look.

But that's too easy. Let's do it in Text mode.

In text you have to set the Foreground color, the Background color, the Attribute (blinking, hi-intensity/bright) and then actual character.

You can either use a portable library like NCurses or the OS console API (for example: https://docs.microsoft.com/en-us/windows/console/console-reference ). Escape codes will maybe work if you're using Linux, but not Windows.

If you post your code, make sure to list which OS you're using.

Happy programming!

2 Comments
2018/06/14
22:15 UTC

3

Experimental film project

Hello guys, i am a Brazilian cinema student and i had an idea for a small project, Glauber Rocha is a brazilian director from the last century that experimented greatly on the cinematic language, he did a movie called “The age of the Earth” that is composed of 8 reels. Glauber separated the movie in 8 so that they could be played in any order, thus creating a movie with many different meanings; the possible permutations of 8 reels is 8! (40,320) so this movie could be played in many different orders. I wanted to create a program that would play the movie at a random order every time without giving the user the ability to select the order. Sadly, i don't know any programming. If any of you are interested in doing something like this as a small creative project let me know! This doesn't have any commercial interest, it is just “something to have”.

1 Comment
2018/06/11
16:06 UTC

Back To Top