Quantcast
Channel: Active questions tagged code-challenge - Code Golf Stack Exchange
Browsing latest articles
Browse All 40 View Live

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 1, the second one 2...

View Article



Definite integral of polynomial functions

You will need to evaluate the definite integral (bounded by \$a\$ and \$b\$) of a certain polynomial function that takes the form of:$$\int_a^b \left( k_n x^n + k_{n-1} x^{n-1} + \cdots + k_2x^2 + k_1x...

View Article

Code close to the challenge: Sum of integers

This is a simple challenge:Given a sequence of integers, find the sum of all integers in it.But with a twist.Your score is the Levenshtein distance between your code and the following phrase (The...

View Article

Build a fewest-moves freecell solver

In the game of Freecell, you are tasked with building four foundation piles in suit from ace to king, on a layout where you build downward in alternating colours. However, you can only build one card...

View Article

I irradiate your source code, you irradiate your output

Your task is to write a program \$p\$ which outputs a string \$s\$ with the same length as \$p\$, where \$s \neq p\$.If I remove the \$n\$th byte from your program to get program \$q\$, then either...

View Article


Say Hello to the Pioneers of Computer Science

Choose your favorite famous computer scientist or computer science pioneer who was born in 1942 or earlier (as 1943 marks the start of the creation of the 'first' computer). They should have a...

View Article

What is the smallest positive base 10 integer that can be printed by a...

I think the question as above is clear, but just in case:Write a full program (not just a function) which prints a positive base 10 integer, optionally followed by a single newline.Qualifying programs...

View Article

The many ways to skin a `cat` [duplicate]

The well known cat command simply copies its stdin directly to stdout unchanged. But there are plenty of other commandline tools that exist...What other commands can be used to duplicate the...

View Article


A Programming Puzzle of Mode Golf

Your task is to print the text Good morning, Green orb!, with every character repeated in place as many times as the most frequent byte in your source (the mode). A trailing newline is permitted and...

View Article


50 digits of π in HQ0-9+-INCOMPUTABLE?

BackgroundHQ0-9+-INCOMPUTABLE?! is a half-joke programming language introduced in Internet Problem Solving Contest 2011, Problem H.HQ9+ is an esoteric programming language specialized for certaintasks....

View Article

Distinguish between Masculine and Feminine Nouns in French within 100 characters

You are to write a very small program within 100 characters. Your program must distinguish between masculine and feminine french nouns. The output should be un if it is masculine and une if it is...

View Article

Restricted Meta-Cat

Your challenge, should you choose to accept it, is to write a program in a language of your choice that, when given a string (limited to printable ASCII) as input, outputs a new program in the same...

View Article

One OEIS after another

As of 13/03/2018 16:45 UTC, the winner is answer #345, by Khuldraeseth na'Barya. This means the contest is officially over, but feel free to continue posting answers, just so long as they follow the...

View Article


Image may be NSFW.
Clik here to view.

Paint Starry Night, objectively, in 1kB of code

Note: a 1000 point bounty is still available for this challenge, which I will create and award if anyone takes the top score without using built-in compression.Below is a 386x320 png representation of...

View Article

The alphabet in programming languages

Our task is to, for each letter of the (English) alphabet, write a program that prints the alphabet, in a language whose name starts with that...

View Article


Largest Number Printable

Your goal is to write a program that prints a number. The bigger the number, the more points you'll get. But be careful! Code length is both limited and heavily weighted in the scoring function. Your...

View Article

Fewest (distinct) characters for Turing Completeness

Summary:For any given language, what is the smallest amount of unique characters for your language to be Turing-Complete?Challenge:For any language of your choice, find the smallest subset of...

View Article


Print the banned characters based on the most common characters

This is an answer-chaining post, so in this challenge every answer (except the first answer) depends on the previous answer.The goal of this challenge is to output the restricted characters. The...

View Article

Magical BF: BF code that works in two ways

ChallengeIn this challenge, we will use a language that is very similar to Brainfuck but slightly different.This variant of BF does not have any input and output commands; instead, it simply takes a...

View Article

Convert maximum values to bit widths

BackgroundThe newest version of the C standard, C23, adds preprocessor macros like INT_WIDTH, ULONG_WIDTH, and SIZE_WIDTH that tell you the bit width of various integer types (here, int, unsigned long,...

View Article

Image may be NSFW.
Clik here to view.

Without using numbers, get the highest salary you can. But don't exaggerate!

As I'm applying for some jobs whose job advert doesn't state the salary, I imagined a particularly evil interviewer that would give the candidate the possibility to decide their own salary ...by...

View Article


nimi ale lon toki pona! (Every word in Toki Pona!)

"nimi ale lon toki pona" is a song by YouTuber jan Misali which lists 137 common words in the constructed language Toki Pona. This challenge is not a duplicate of "How high can you count?" or "Alphabet...

View Article


Evening Commute Solver

I recently moved to an apartment overlooking the inner ring-road of town, and every day, a beautiful scene unfolds. The traffic lights are apparently so confusing (mostly because the Dutch are used to...

View Article

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+$, as in only 0-9. The TwistYour source...

View Article

Generate the longest error message in C++

Write a short program, that would generate the longest possible error message, in a standard C++ compiler (gcc, cl.exe, icc, or clang).The score of each entry is the number of characters in the longest...

View Article


Create the characters you can write on a MacOS US English Keyboard (as...

IntroductionThis is a small challenge I came up with while trying to make some compact code for my younger brother to use. I don't think it's particularly interesting, but I believe it presents some...

View Article

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 bytes...

View Article

Build a working game of Tetris in Conway's Game of Life

Here is a theoretical question - one that doesn't afford an easy answer in any case, not even the trivial one.In Conway's Game of Life, there exist constructs such as the metapixel which allow the Game...

View Article

BigNum Bakeoff Reboot

Some of you may be familiar with the BigNum Bakeoff, which ended up quite interestingly. The goal can more or less be summarized as writing a C program who's output would be the largest, under some...

View Article



Evolution of OEIS

In this challenge, the goal is to recreate the On-Line Encyclopedia of Integer Sequences one sequence at a time. Similar to the Evolution of Hello World, each answer depends on a previous answer.Over...

View Article
Browsing latest articles
Browse All 40 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>