Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [code-challenge]

A code challenge is a competition for creative ways to solve a programming puzzle with an objective winning criterion not covered by other scoring tags (e.g. code-golf).

17
votes
12answers
4k views

All your base 97 are belong to us

Many programming languages are written using solely printable ASCII, tabs and newlines. These 97 characters are then stored in 8-bit bytes (which are actually capable of holding 256 different ...
23
votes
6answers
1k views

Polyglot the (non constant) OEIS!

Disclaimer: This is heavily inspired by "Polyglot the OEIS!" but fixes the problem that lead to closure (see the output section) and was re-posted as to not invalidate answers. Introduction We all ...
22
votes
9answers
1k views

Is it a noun or not?

Given a string as input, determine whether it is a noun or not. You will be scored on the 1000 most common English words, by how many you correctly label as a noun or not. The program or function ...
42
votes
12answers
3k views

Polyglot the OEIS! [duplicate]

Note: This challenge has been moved to Polyglot the (non constant) OEIS! to avoid closure. Introduction We all know and love the on-line encyclopedia of integer sequences (OEIS). So what if we made ...
11
votes
35answers
3k views

“Hello, World!” (Robbers' thread)

This is the robbers' thread. The cops' thread is here. Your challenge is to take an uncracked submission from the cops' thread and find, for what input or inputs, the program will print ...
12
votes
13answers
1k views

Solving Secret Swapping Sequences

This is a cops-and-robbers challenge, the cops thread can be found here. This is the robbers thread, your job here is to take submissions on the cops thread and try to find the hidden sequences. If ...
1
vote
0answers
331 views

Write a semi-compact FizzBuzz that can scale handle to “unlimited” if cases [closed]

I saw Tom Scott's video on FizzBuzz https://www.youtube.com/watch?v=QPZ0pIK_wsc so I felt to write my own more "complex" version,this is what I came up with, its very flexibly and easy to scale, and ...
1
vote
5answers
158 views

Output a text that doesn't output any of the characters used in the instructions to output the text [duplicate]

Main objective The main objective is to output a text, it doesn't mind which text or where the text gets its output (it can be on a browser window, the default console etc). It just requires the ...
19
votes
4answers
2k views

Most efficient cubifier

Cubically is too tedious to manually write any code in. Your challenge is to translate ASCII text into Cubically source code. Cubically This is just a quick run-down of Cubically; the repository has ...
92
votes
346answers
16k views

One OEIS after another

As of 13/03/2018 16:45 UTC, the winner is answer #345, by Scrooble. This means the contest is officially over, but feel free to continue posting answers, just so long as they follow the rules. As ...
76
votes
43answers
6k views

Find an Illegal String

The challenge is to find a string of characters that cannot appear in any legal program in your programming language of choice. That includes comments, strings, or other "non-executable" parts. ...
46
votes
5answers
1k views

TryItOnquine Challenge

(based on this post and the ensuing discussion on chat -- also, much thanks to Dennis for TIO!) The Challenge Choose a language that's currently available on the TryItOnline site, for example ...
-6
votes
2answers
163 views

Interpret as many languages as possible [closed]

You must create one program that interprets as many languages as possible Input You will take language name, code, input. These may be taken in any reasonable format, and in an order of your choice. ...
8
votes
2answers
865 views

Smallest chess game compression

Inspiration: Heavily inspired by Smallest chess board compression I decided to make a similar but distinctly different competition. tl;dr Take the file Chess_Games.txt and compress it as much as ...
15
votes
4answers
519 views

Make a Minecraft Crafting Table

Don't you hate it when you can't remember how to craft something in Minecraft? Well, time to remedy that! Task Your task is to take an input, either as a 1D or 2D list and output what item is a ...
16
votes
5answers
1k views

Fastest tweetable integer factorizer

The task is to find a non-trivial factor of a composite number. Write code that finds a non-trivial factor of a composite number as quickly as possible subject to your code being no more than 140 ...
6
votes
0answers
93 views

Every Nth Char in Source Outputs N [duplicate]

Heavily inspired by Hello, World! (Every other character) Write a program that outputs 1. When the first, third, fifth, etc. chars are removed, it outputs ...
21
votes
6answers
593 views

Transposes and Diagonals

For this challenge, you should write a program or function which outputs the diagonals of a given square matrix. However, if you transpose the rows and columns of your solution's source code, it ...
-1
votes
9answers
181 views

Flip rows and columns [duplicate]

Objective To flip the rows and columns of a table in a code-golf challenge. Instructions You will be passed a "table" of 3 arrays/lists with 3 items each as input. Your job is to flip the rows and ...
14
votes
7answers
798 views

Finding the smallest sets

Consider three sets A, B and C each containing n ...
82
votes
76answers
9k views

Unique is Cheap

Write a function or program that determines the cost of a given string, where the cost of each character equals the number of how many times the character has occurred up to this point in the string,...
4
votes
3answers
179 views

How many valid programs can you write? [closed]

Backstory: I think that my boss might finally realize that I don't any enough work, despite being paid by the hour. I want to throw him off track, by writing as many valid programs as I can to send ...
5
votes
16answers
904 views

Emoticon numbers!

(related) Your challenge is to output the highest number you can. You can output as a number or as a string. You must output something that matches the regex ^\d+$,...
21
votes
13answers
2k views

Create the slowest growing function you can in under 100 bytes

Your job is to create the slowest growing function you can in no more than 100 bytes. Your program will take as input a nonnegative integer, and output a nonnegative integer. Let's call your program ...
42
votes
85answers
13k views

Goodbye Cruel World!

Background Hello golfers! I would like to learn all the programming languages! But I kinda have a short attention span... and copying all the Hello World examples gets boring... but I like fire! ^w^ ...
-5
votes
1answer
145 views

Reverse the file [duplicate]

I remember this was exam question long long long time ago. There is a file say MyFile.txt, it can be any size and contains aphanumeric only your task is to revese the words example : "Go beyond the ...
6
votes
2answers
448 views

Generate all halting Smallfuck programs of length n

Your task is to write a program that, given a number n, returns a list of all valid, halting Smallfuck programs of length n, in any order. Actually, we're using a variation of Smallfuck called F2, ...
13
votes
2answers
452 views

Dodge your death!

Introduction "Muhuhuhahahah!" The mad scientist laughs. "You're trapped in my own little game!" In front of you is a deadly pit of snakes, while behind you is a bottomless chasm. There's no way out, ...
8
votes
1answer
305 views

How high can you count in different languages?

Based on How high can you count? let us give an advantage to the polyglot people. Challenge: Your task is to write as many programs / functions / snippets as you can, where each one outputs / prints ...
150
votes
57answers
21k views

How high can you count?

Challenge: Your task is to write as many programs / functions / snippets as you can, where each one outputs / prints / returns an integer. The first program must output the integer ...
23
votes
28answers
2k views

Take a stand against long lines

Recently, someone proposed more stringent limits for Python's default line length: Clearly, no program should ever use more than 80 characters per line, for a whole host of reasons. First and ...
2
votes
1answer
112 views

Interpret the interpreted [duplicate]

Task You must write a program in Language A that will output the source code for a program in Language B which will then output the source code for a program in Language C and so on and so forth. The ...
5
votes
4answers
252 views

Let's get the gang back together! [closed]

A narcissist program is a program that only accepts its own source code. A bigotous program is a program that only accepts the source code of programs semantically equivalent to itself. A gang member ...
4
votes
0answers
218 views

Minecraft Pumpkin / Melon overload [closed]

DONT EVALUATE YET, ALMOST FINISHED, NEED A CLEAR WINNING CRITERION Make me rich in minecraft Minecraft is a 3D game made of blocks that you can destroy and place. There are some interesting farms ...
10
votes
1answer
286 views

Radiation hardened cyclic quine polyglot

Challenge Write two programs that: run in two different programming languages. These may not be two versions of one language. when one program is run, it outputs the second program, and vice versa....
12
votes
4answers
1k views

Remove the Salutations

Challenge Hi, given a string as input, remove any salutations found at the start of the string. The program which performs the most correct substitutions in under 50 bytes wins. Salutations Hey, a ...
8
votes
6answers
927 views

It's Anagram Quine, not just Quine!

The Task In this challenge, your task is to write a program, which takes in no input, with as many anagrams that are quine of themselves as possible. Your score will be the number of anagrams of ...
16
votes
2answers
753 views

Binary Tetris in tweets

There was recently (a few years back) some buzz on programming websites about an implementation of Tetris in 140 Bytes. ... It turns out that although it is small, it is a simplified version of ...
19
votes
6answers
1k views

Anaglot Polygrams

Task Write some code that can be rearranged into n different programs in n different languages each outputting a distinct number from 1 to n. No two languages should be the same however different ...
5
votes
1answer
200 views

Create a black window with as little memory as possible [closed]

Today I installed MonoGame and ran the test application, which creates a basic colored window. I was surprised to see that the process was using 32.2 MiB of memory, and I thought it could be improved. ...
26
votes
1answer
648 views

Unrestricted Languages

One of my favorite types of challenges on this site are restricted-source challenges. These challenges impose a computer tractable restriction that the sources of potential answers must pass. I like ...
28
votes
2answers
2k views

Zero an arbitrarily large cell in Brainf***

Your task is to write a piece of code that zeros the current cell in the Brainfuck variant that, each cell can contain a signed integer of arbitrarily large magnitude, instead of the normal 0 to 255. ...
42
votes
28answers
2k views

Surprise Party for Brain-Flak

This question is part of a series Brain-flak Birthday challenges designed to celebrate Brain-Flak's first Birthday. You can find more information about Brain-Flak's Birthday here. Today is Brain-Flak'...
1
vote
0answers
79 views

Build a date shift cipher, which skips punctuation and whitespace and uses a modular lowercase then uppercase alphabet [closed]

Your program must: - Take a date as input, in 8 figure format (day or month, month or day, year) - Take input of a string of any length. - Shift the first letter by the first figure of the date, the ...
6
votes
3answers
546 views

The Big Bang Polyglot [duplicate]

Everyone loves The Big Bang Theory, right? And everyone loves polyglots, right? So let's combine them! Task Your task in each language is quite basic. You must output the name of the one of the 5 ...
26
votes
5answers
1k views

Same code different characters

Note: This challenge only allows answers in compiled languages Task Your task is pretty simple, make two different programs that when compiled result in the same output. Scoring Here is where the ...
7
votes
1answer
453 views

Large Numbers in BF

Background The language BrainF*** (or simply BF), is an extremely minimal programming language. We're going to strip it back even further by eliminating IO operations; only the sub-langage defined by ...
23
votes
14answers
3k views

Reuse your code!

In this challenge we try to solve two important problems at once. They are: Given integers a and b, tell if ab-1 is a prime number. Given integers a and b, return nCr(a, b). Specifically, you must ...
2
votes
5answers
215 views

Match this random string [duplicate]

To-Do: Come up with a Better Title Specification: This challenge is similar to kolmogorov-complexity, but with a twist. You goal is to output a finite string that resembles the following string of ...
13
votes
3answers
423 views

Let's Play Hide and Seek!

The user will hide, and the computer will try to find them. First, the program will take an input, for the size of the grid. Like 5x5, 10x10, 15x15, etc. The grid won't always be a perfect square. ...