Imposes a restriction on the source code used to solve the challenge, for example, having no numbers in the source code.
55
votes
19answers
3k views
Tweetable hash function challenge
In this code-challenge you will write a hash function in 140 bytes1 or less of source code. The hash function must take an ASCII string as input, and return a 24-bit unsigned integer ([0, 224-1]) as ...
-5
votes
4answers
127 views
Write a palindrome that prints “Hello, World!” without using comments [duplicate]
Your Task: Print "Hello, World!" using a palindrome.
Simple, right?
Nope.
You have one restriction: you may not use comments.
"Comments" include
Normal // or # comments
Adding extraneous ...
35
votes
2answers
468 views
JSF**k with only 5 symbols?
This is not a challenge but a question, I figured it was on topic because of
Non-challenge questions that are related to solving programming puzzles or a particular type of challenge are also on ...
-2
votes
1answer
176 views
Implement branchless binary search
Challenge
Implement binary search on a list of length 256 with no branches.
Specification
Input an integer X and a strictly increasing list of integers
Output is the greatest element of the list ...
-3
votes
1answer
93 views
Implement decimal-multiplication modulo
Most people can't easily do modulus (or work out if a number is divisible by another number) in their heads because long division is harder than addition, subtraction and multiplication. The following ...
27
votes
7answers
6k views
Build a twisted “Hello world!”
Your job is quite simple, write a program that prints Hello, world!, that when twisted creates a program that prints Twister!.
How strings are twisted
The twisting algorithm is very simple. Each ...
21
votes
8answers
713 views
Official Dyalog APL 2016 Year Game
If you think this could be fun, but too much work, consider participating in this much smaller challenge.
A bit of fun (and possibly frustration!) for 2016... Dyalog's "puzzle of the year". Enjoy!
...
-8
votes
2answers
143 views
Unique multiplication by ten [closed]
People, it's a popularity contest, you have to do somthing cool here.
Think about cool ways of breaking the code in most languages, not about validating for everyting!
Initially this ...
5
votes
14answers
653 views
10 9 8 7 6 5 4 3 2 1… Print 2016
As a spin-off to my challenge over at Puzzling, your goal is to output 2016.
Rules:
You must include the numbers 10 9 8 7 6 5 4 3 2 1 in that order. They can be used as individual integers or ...
3
votes
1answer
294 views
Detect my accent
Your task is to write a program or function that detects accents in UTF-8 input. The catch is that your code must be written entirely in an 8-bit character encoding. The code will output a single ...
26
votes
2answers
508 views
Lipogram “quine”
Task
Take a single Unicode character as input.
Output a program in the same language that also obeys this specification, but which does not contain the input character.
If your program is run with ...
5
votes
6answers
226 views
Using Symbols for Letters
Input: A single word as a string (matches [a-zA-Z]+). If the input doesn't follow these guidelines, print "Error" (but no error should be thrown)
Output: The NATO pronunciation of the word. Print ...
17
votes
10answers
2k views
Print the QWERTY keyboard using keys that are as close together as possible
Normally, challenges are scored in bytes, or sometimes Levenshtein distance, but for this one we're using keyboard distance -- the number of keys between the keys used to type the program (use the ...
-2
votes
3answers
200 views
Does the string contain 2016? [closed]
Given a string input, your task is to write a program that prints a truthy value to STDOUT or equivalent if the input contains "2016" anywhere in it without using any built-in contains, match, ...
23
votes
12answers
2k views
The Complement Cat
Objective Write a full program that outputs (to STDOUT or closest alternative) an arbitrary string of text, no more than 64 characters long. Simple enough, right? Well, here's the catch: You may not ...
7
votes
19answers
480 views
Maximizing output from minimal input
Obviously, code golfing is all about making the most of the least code. Who really cares what the actual output is?
While we have had a challenge for highest input-to-output ratio, this is a call for ...
51
votes
54answers
3k views
No strings (or numbers) attached
If you like this, you may also like Official Dyalog APL 2016 Year Game.
Make 12 snippets/expressions, in the same language, that result in the numbers 0 through 10, and 42 respectively, but without ...
38
votes
26answers
3k views
Check if a UUID is valid without using regexes
Given a string input, write a program that prints a truthy value to STDOUT or equivalent if the input is a valid UUID, without using regexes.
A valid UUID is
32 hexadecimal digits, displayed in ...
-1
votes
1answer
121 views
Write a code that lists every ASCII character not in the code itself [duplicate]
The question title says more or less everything.
Write a program/function that outputs every 8-bit ASCII character not present in the code itself, onto a file (or the screen itself; I'm not sure if ...
14
votes
1answer
683 views
90° Self-Rotating Program
Introduction
Write a complete program that rotates a rectangular block of ASCII characters 90 degrees clockwise. When the program itself is rotated 90 degrees clockwise, it rotates a block of ASCII ...
59
votes
18answers
7k views
Programming a Pristine World
Let's define a pristine program as a program that does not have any errors itself but will error if you modify it by removing any contiguous substring of N characters, where 1 <= N < program ...
9
votes
4answers
432 views
Avoid repeating letters between five simple programs
You're challenge is to write 5 different full programs for the 5 following tasks:
Print Hello, World!
Given an input with STDIN, output the factorial, you can assume that the input is an integer >= ...
18
votes
5answers
2k views
The jQuery showdown
Some time after this incident…
There are some of us who are against this defiling order of jQuery. It is an unholy presence, of which must be exterminated. I therefore call on you, the loyal ...
15
votes
5answers
1k views
Print a Symbolic Negative of your Code
(This is a variation on Print a Negative of your Code, which I enjoyed a lot! Thanks to Martin Büttner♦ - almost all of this text is his.)
Let's consider the symbols to be the following printable ...
23
votes
16answers
3k views
Print the Capitals without the Capitals
Whoa, whoa, whoa ... stop typing your program. No, I don't mean "print ABC...." I'm talking the capitals of the United States.
Specifically, print all the city/state combinations given in the ...
13
votes
38answers
1k views
Palindrome Hello, World
Your task is to create a program that prints "Greetings, Planet!" exactly to the console. Seems simple enough, right? Well, here's the trick. The code must be a palindrome, meaning it reads from right ...
4
votes
11answers
2k views
Shoot the ASCII Moon
(Previously on "Print the __ without using __" ... this one and this one)
The game of Hearts has a popular scoring variant called "Shooting the Moon," whereby instead of trying to not acquire penalty ...
93
votes
36answers
5k views
Source code ecological footprint
You've just been hired by a German car manufacturing company. Your first task, as an engineer, is to write a program that computes the ecological footprint of ASCII strings.
The ecological footprint ...
-9
votes
5answers
390 views
A Perplexing Puzzle
The Challenge
Create a program or function that takes no input, and outputs (or returns):
I'm a programming paradox — no I'm not.
Without using a character twice in any string, or digit twice in ...
24
votes
7answers
1k views
Heterograms, Palindromes, oh my!
(First challenge, please let me know if there are any problems with it.)
A heterogram is a word where no letter of the alphabet occurs more than once, and a palindrome is a phrase that is the same ...
45
votes
11answers
5k views
Just repeat yourself
Write a program that outputs
Do not repeat yourself!
Your program code must respect the following constraints :
its length must be an even number
each character that is in position 2n (where n ...
34
votes
4answers
533 views
Splitting up ASCII
Given the 95 printable characters in ASCII plus newline, break it apart into two equal, 48 character groups (hereafter called group A and group B). Create a one-to-one mapping of your choice (you have ...
22
votes
23answers
1k views
Lookup without conditional statements
This challenge was inspired by programming an Arduino microcontroller. I have 6 LEDs and 6 buttons connected to various pins on the board. In the code, each button and LED is assigned an ID number ...
7
votes
2answers
200 views
Output ISO8601 date
The Task
Given the positive value of unix timestamp output any of two valid ISO 8601 time formats:
YYYY-MM-DDTHH:mm:SS or, alternatively,
YYYY-MM-DD HH:mm:SS
You may ignore any leap seconds, if ...
17
votes
5answers
978 views
Fibonacci in +!()[]script
Write a piece of JavaScript code that calls alert with an array containing the first 50 Fibonacci numbers in order. You may only use the following characters: +!()[].
As a reference, your code must ...
2
votes
8answers
261 views
Exponentiation of natural numbers using only primitive integer operations [duplicate]
The challenge
Implement the C equivalent of the pow() function (exponentiation) for natural numbers, in a language of your choosing, using only addition, subtraction (which includes negation and ...
4
votes
0answers
373 views
C# program containing `? null :` that is still valid without `null` [closed]
I found an old post on Jon Skeet's blog that pointed out a puzzle from a tweet by Vladimir Reshetnikov:
C# quiz: write a valid C# program containing a sequence of three tokens ? null : that ...
31
votes
19answers
6k views
Holy Hole In A Donut, Batman!
Holy Hole In A Donut, Batman!
Some characters are more holy than others. Using as few unholy letters as possible, display the statement above.
Challenge
Write a full program to print Holy Hole In A ...
-4
votes
4answers
403 views
Write “Code Golf” without using any letters [duplicate]
Goal
Your goal is to write "Code Golf" without using any letters [A-Z, a-z], even in your source code. It can't use of the following special characters either (!, _, <, (, ), ., {, }, ', and >).
...
-8
votes
1answer
1k views
Output your username without using any of the characters in your username! [duplicate]
This is a little meta...
I need you to golf some code that takes no input whatsoever but outputs your username. That may seem easy enough, but you are code restricted. For example, if my username was ...
-4
votes
2answers
282 views
Isn't It Ironic? A Little Too Ironic? [duplicate]
I made a joke the other day and sent it to some friends. One replied back "I love the irony!" and I looked at it and realized there was some irony in it. But that wasn't the irony she saw - the irony ...
1
vote
0answers
194 views
Recursive zipper reincarnation
Recursive zipper reincarnation
Objective:
Code two separate programs A and B that when concatenating their respective outputs OA + OB creates a third program: C.
When program C runs it should ...
30
votes
6answers
3k views
Write A Program That Outputs Its Mirror Level
There are 95 printable ASCII characters:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
In the Consolas font (the Stack Exchange code ...
13
votes
5answers
462 views
Print strings without sharing characters
Edit: Allowed to reuse whitespaces.
Your task is to write n programs (or functions, or bodies of functions without using parameters or the function names) in the same language. The kth program ...
34
votes
45answers
4k views
Capitalize first letter of each word of input
This is a relatively quick one, but I'm sure you'll like it.
Codegolf a program that will take input in the form of a sentence and then provide the output with the first letter capitalized in each ...
15
votes
6answers
404 views
Princely Prefix by a Program in Pattern
You should write a program or function which outputs or returns as much of Chapter I of The Little Prince as it can. Your program or function has to be an M-by-N block of code containing only ...
29
votes
4answers
3k views
Quick! Escape the black hole!
It is the year 87,539,319 and solitary space-walking is now commonplace, many people travel into space by themselves, propelled by nothing but a jetpack on their backs, programming their course with a ...
7
votes
4answers
677 views
Write an URL compressor
Today your goal is to invent URL compression. You must write two programs: a compressor and a decompressor.
The compressor will be called with one URL on stdin and its output will be read on stdout.
...
15
votes
5answers
533 views
Unwise bit operations
I like to golf in dc, but I'm sometimes frustrated because dc doesn't have bitwise operations.
Challenge
Provide four named functions which implement the equivalent of the c bitwise operations ...
-3
votes
5answers
352 views
Print the Longest Sentence
I've searched around, and cannot find a challenge too similar to this one--however, it would not surprise me if this is not the first of its kind. My apologies if I've overlooked something.
The ...