/r/programbattles

Photograph via snooOG

Battle it out in your own language! Enter battles or create them!

Battle it out in your own language! Enter battles or create them!

A user will post a battle idea, or a challenge if you will. You get to enter the challenge with a script, and possibly win!

Post your code as open source. Only. You can comment your code, or link to it. Here are some places to host your code.

Make sure the parent comment is relevant to the post,, all child comments can be used to comment on their code.

General rules

  1. No overly vulgar language, racism, or hate speech. Sure, you can swear every now and again, but don't go over the top.
  2. Any malicious code will be removed on sight, and the offending user will be banned.
  3. Read posts completely before writing code and commenting. Make sure that your submission is related to the language the post specifies.
  4. Just use common sense.

Rules for submissions (creating battles)

  1. Make sure to flair your post. We cannot stress this enough
  2. Requests, such as "Please make me a bot" do not go here.
  3. No, we will not do your computer science homework.
  4. Your title must be descriptive. Please do not just use the word "Battle" or "Competition" as your post name.
  5. Your post needs to include as much detail as possible. Include tips on how to complete the battle.
  6. Do not use referral links or any type of URL shorteners to avoid the original link for reference. Reddit's URL shortener is allowed.

Rules for comments (entering battles)

  1. Yes, this was already mentioned, but there is a strict no malicious code rule. Any user seen posting malicious code will get an instant ban.
  2. Please, just read the post. Fully. Make sure that you are not entering a python script to a battle that is Java only. If the flair says that it is in any language, sure, enter in any language, but if it says Java... it means Java.
Programming Languages
/r/html
/r/cpp
/r/csharp
/r/css
/r/java
/r/php
/r/python
/r/ruby
/r/forth

Subreddit theme: /r/Lament

/r/programbattles

2,238 Subscribers

2

IP2Location Programming Contest 2020 is inviting participants to join and win prizes worth $14,444 in total!

It's time to show your coding skill and win fabulous prizes worth $14,444!

See https://contest.ip2location.com for more information.

1 Comment
2020/07/06
00:51 UTC

5

My ip2location 2018 entry. Pls upvote at Google+! Thx!

Title: Doxmyip

Description:Doxmyip is a simple IP address browser for Windows.

Homepage:https://tetramatrix.github.io/doxmyipwindowstool/

Github:https://github.com/Tetramatrix/doxmyipwindowstool

#IP2LocationContest (http://contest.ip2location.com/join-the-contest)

Google+:https://plus.google.com/+ip2location (Pls upvote here! Thx!)

Facebook:https://www.facebook.com/ip2location (Pls upvote here! Thx!)

1 Comment
2018/07/08
11:29 UTC

3

Microsoft Q# Coding Contest — Summer 2018 - Codeforces

1 Comment
2018/07/05
17:03 UTC

5

IP2Location programming contest 2018

1 Comment
2018/07/02
11:20 UTC

1 Comment
2018/06/25
21:36 UTC

1

Can Someone Help me out !!

So i've been making a website for my college project. this is a site where you can buy cheap flight tickets and hotels. its like an affiliate site..i am getting problem in making search form box where we have to input the data.. for example : https://www.trip.com/ in this site..there is a booking form having tabs of flight and hotels etc.. i am unable to design that.. and also unable to find that anywhere on the internet.. can someone help me out !! here are some more example of that booking form.. https://www.flightgala.com/ https://www.skyscanner.co.in/ https://www.yatra.com/byop

1 Comment
2018/04/06
17:40 UTC

23

This place is dead

The latest (6 month old) post is spam and nothing has been done about it.

3 Comments
2017/12/24
13:53 UTC

2

Ip2location 2017 contest

1 Comment
2017/06/04
16:04 UTC

4

Battlecode

Battlecode robot war:https://www.battlecode.org/

1 Comment
2017/01/08
10:39 UTC

1 Comment
2016/09/20
18:19 UTC

8

Implement a Burrows-Wheeler Transform

Implement a Burrows-Wheeler Transform in the language of your choice. This video from Google Developers should help you on your quest. Best of luck!

2 Comments
2016/07/21
02:09 UTC

16

Emulate software

Do your best to create a copy of a program, website, etc., be it real, from a game, movie, anything. You can choose to only create the functionality or the aesthetics, but try to do both.
No peeking into the original code!
This might take you longer than you'd expect from a challenge here, but do your best and learn a thing or two along the way!

1 Comment
2016/04/01
20:47 UTC

2

Button based game in C#

Develop a “tile based” game i.e. a game based around a grid of buttons (or other UI objects). In addition it should demonstrate a combination of a “design view” constructed UI with components for entering your name and displaying a score etc. The choice of the game is yours let the battle commence!!

1 Comment
2016/02/07
01:31 UTC

9

Obfuscated operators

Challenge

Complete the following code fragment to make it compile and return 0. The simplest solution is straight forward, so reach for an overly obfuscated one to make it fun!

Rules

  • Add only code for variable declaration, initialization and optionally class definitions and operator overloads.
  • Do not add control flow instructions (like "return 0;" in the first line).

Code

int main () {
    // add code here
    return ( p-->d<-o->b<--q );
}

edit: fixed for excitement and compilation error

5 Comments
2015/12/11
20:42 UTC

0

Date changer

Can you write something that upon opening a program, say Microsoft Word, my system's date changes to something like January 1, 2000 and then automatically updates to the current date and time when I close that program?

I'm not sure what language it would need to be in or how to apply it. To be clear, this is a "can you do this for me" type of thing, but I think it also makes for a cool challenge.

PS: Let me know if there's an appropriate language for this and I'll change the flair!

13 Comments
2015/12/01
21:59 UTC

3

Need a batch file (optional shell script) to manage my music files better

Hi guys, I just sort my music library and I did not get ahead , because everything takes forever . I used to have a batch file that has made most things automatically , but that has been lost during the last crash ( was on C : ... ) . So the following : One "artists" folder contains loose music files & some "album" folders (eg . " Album1 " , " Album2 " etc.) . In each album folder are either folders or not (eg . " Under 1 " , " Under 2 " etc.) . What I now always do by hand is an endless work. So here are the instructions: Move all! files from the subfolders ( " Under ... " ) in the parent album folder ( Album1 ) and delete the subfolder . Delete all the * .m3u & * .pl files (all playlist files) Delete all the * .jpg & * .png files (all image files) This way all my music files are on the correct level of the file path/ directory & I can tag them correctly with a regular tagging program (such as MP3Tag or GodFather). It s important that the batch doesn't foreget to move every! music file (incl. .mp3;.m4a;.wav;.flac;.aac;.wma;*.ogg) on the higher level. Damned. U would really help me a lot ;) -a reddit loyal

p.s.: regular tagging programs are not able to do that, because they consider to one strict path u give them & are not variable.

4 Comments
2015/11/22
22:06 UTC

9

Roman Numeral Incrementer Function

give a valid roman numeral your program should return the roman numeral immediately after without converting the numeral to an integer (or float).

bonus points if you can also write a function that adds two numerals together.

11 Comments
2015/11/19
19:53 UTC

3

Binary Search Tree

Create a program in C++ that allows a user to add an int data type to the tree and cleans it up, also checks if a use given int in in the tree and finally can also print out the contents inorder.

1 Comment
2015/11/18
19:58 UTC

20

Code like 4chan

I saw a post on ProgrammerHumor that a group from 4chan collectively built this https://i.imgur.com/lFYExvh.png

I want you to do the same. The code can do whaterver you want but it has to be an input and an output.

Use this 4chan code as a guide https://i.imgur.com/lFYExvh.png

Try to rename everything you can and everything have to be in caps.

6 Comments
2015/11/12
21:53 UTC

9

whay, in the lord's good name, are we not acteeive?

1 Comment
2015/11/08
14:59 UTC

9

Cellular Automaton

Build 1D cellular automaton which would display each generation in the shell.

3 Comments
2015/11/01
17:46 UTC

1

String incrementation

Restrictions: N/A

Description: Write a function that increments a string (increment the string as if it was a number in base 127)

2 Comments
2015/10/10
22:33 UTC

9

Make a interactive button

Make a interactive button that change colour/size or something like that when you press it.

Remember this is a battle, be creative

4 Comments
2015/10/22
13:31 UTC

17

Make a calculator that can find derivatives of any given function

ex. 2x^2 =4x

8 Comments
2015/10/21
13:26 UTC

12

Most complicated way to output numbers 0-9

Simple as the title, really. I want to see the most complicated, abstract ways in which one would output numbers 0-9. Points go for quality, not quantity.

14 Comments
2015/10/20
12:05 UTC

12

Draw a flag

Use any method you want but it has to be a country. Be creative, don't pic one colored flags or flags with cross.

7 Comments
2015/10/19
14:21 UTC

11

Draw a circle.

Don't be a bore and use your standard graphical library functions! Rule of thumb: if your method's posted, find a new one.

Also, ASCII art allowed, if you can manage it.

EDIT: 'flair' button not visible, help!

EDIT2: For the record, no language restrictions imposed.

23 Comments
2015/10/15
06:34 UTC

11

HTML/CSS/JS which after 5 seconds redirects you to another site, then back again forever.

Please host on Codepen.

Similar to this, it probably won't be that complex to complete.

3 Comments
2015/10/11
11:52 UTC

26

How to flair a post.

11 Comments
2015/10/10
02:32 UTC

5

Find longest increasing subsequence

Given a sequence of integers S[1..n], find the largest sequence contained within S, call it A[0..k], where A[0] < A[1] < A[2] < ... < A[k-1] < A[k]. Also, the members of A need not be neighbors in S. Or, put another way, given A[i] and A[i + 1], There may have been members of the sequence S between A[i] and A[i+1] that are not included in A.

An example solution:

So for the sequence S = [4, 3, 2, 1, 3, 4, 2, 5, 8, 9, 0, 5], the solution is A = [1, 3, 4, 5, 8, 9].

6 Comments
2015/10/10
01:53 UTC

Back To Top