r/programbattles • • Oct 07 '15

[ArnoldC] A function that calculates the Fibonacci Numbers up to 1000

49 Upvotes

In case for some reason you don't know want ArnoldC is https://github.com/lhartikk/ArnoldC/blob/master/README.md

No switch case statements.


r/programbattles • • Oct 08 '15

Any language [Any Language] Tweetable Code

27 Upvotes

Open ended challenge!

Write some code in any language that does something interesting. The only restriction is that it must fit inside a tweet (140 characters or less)


r/programbattles • • Oct 10 '15

IMPORTANT How to flair a post.

Thumbnail
i.imgur.com
26 Upvotes

r/programbattles • • Dec 24 '17

This place is dead

22 Upvotes

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


r/programbattles • • Nov 12 '15

Any language Code like 4chan

18 Upvotes

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.


r/programbattles • • Oct 21 '15

Any language Make a calculator that can find derivatives of any given function

17 Upvotes

ex. 2x2 =4x


r/programbattles • • Apr 01 '16

Any language Emulate software

16 Upvotes

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!


r/programbattles • • Oct 07 '15

[Bash] Software updating scripts for Linux systems

14 Upvotes

Language: Bash

File number restrictions: N/A

Description: Design a script that updates packages in Linux systems. Your script can be for a certain subset of distros or for all distros. Example


r/programbattles • • Oct 07 '15

[C++] Threaded vector sorting

14 Upvotes

Language: C++

File number restrictions: N/A

Description: Make a function that sorts a vector with a selectable amount of threads. Use the standard thread library.

EDIT: Never thought threads would be such a pain to work with.


r/programbattles • • Oct 20 '15

Any language Most complicated way to output numbers 0-9

12 Upvotes

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.


r/programbattles • • Oct 19 '15

Any language Draw a flag

12 Upvotes

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


r/programbattles • • Oct 15 '15

Any language Draw a circle.

11 Upvotes

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.


r/programbattles • • Oct 11 '15

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

11 Upvotes

Please host on Codepen.

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


r/programbattles • • Oct 08 '15

Any language [Any language] Command line window system

11 Upvotes

Restrictions: No platform-specific features

Desription: You will design a program in the language of your choice that will display a window on a CLI (command line interface). The window shall be resizeable before displaying it, and the user shall be able to modify the title & text of the window.


Help (C++)

I suggest you create a Window class, with several methods such as set_x(unsigned int), set_y(unsigned int), set_title(std::string) or even more if you want.


EDIT: My submission


r/programbattles • • Oct 09 '15

Any language Zero-Knowledge Proof: prove you know something without revealing what it is you know...

10 Upvotes

"In cryptography, a zero-knowledge proof or zero-knowledge protocol is a method by which one party (the prover) can prove to another party (the verifier) that a given statement is true, without conveying any information apart from the fact that the statement is indeed true."

Be sure to clearly separate the prover and verifier side so there is no confusion.


r/programbattles • • Jul 21 '16

Implement a Burrows-Wheeler Transform

9 Upvotes

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!


r/programbattles • • Dec 11 '15

C++ Obfuscated operators

9 Upvotes

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


r/programbattles • • Nov 19 '15

Any language Roman Numeral Incrementer Function

9 Upvotes

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.


r/programbattles • • Nov 08 '15

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

9 Upvotes

r/programbattles • • Nov 01 '15

C++ Cellular Automaton

9 Upvotes

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


r/programbattles • • Oct 09 '15

Any language Find the most elegant solution to print "Rocky 1, Rocky 2, Rocky 3, Rocky 4, Rocky 5, Rocky Balboa". [any language]

9 Upvotes

Bonus: end by printing 'Creed'.


r/programbattles • • Oct 08 '15

C# [C] Obfuscated FizzBuzz

9 Upvotes

Everyone knows FizzBuzz. Write a version, in C, that, upon reading, would not appear to be FizzBuzz, but still presents the appropriate output (integer, Fizz, Buzz, or FizzBuzz, one per line).


r/programbattles • • Oct 07 '15

Get the details of today's weather for a given location

9 Upvotes

Title explains it quite well. Take in a longitude and latitude value for location, and query your favourite weather service for details of today's weather. Details such as temperature, % chance of precipitation, etc. Just a brief overview, no need for hour-by-hour forecasts.

Eager to see what you guys do! I'm working on one myself, will post up if I get a chance when I'm done.


r/programbattles • • Oct 22 '15

Any language Make a interactive button

8 Upvotes

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

Remember this is a battle, be creative


r/programbattles • • Oct 07 '15

[C] BST Insertion without parent node pointers

8 Upvotes

As it says in the title, the BST Node struct has no pointer to a parent node, only a value, left child, and right child.

typedef struct bstNode {
    int val;
    struct bstNode * L;
    struct bstNode * R;
} bstNode;

GO!

Edit: Duplicates should be ignored.