Tagged Questions
Code-golf is a competition to solve a particular problem in the fewest characters or bytes of source code. A competition which scores on a mixture of source length and some other criterion should be tagged [code-challenge] instead.
5
votes
20answers
443 views
Find words containing every vowel
Your program must find all the words in this wordlist that contain all the vowels (a e i o u y). There are easy ways to do this, but I am looking for the shortest answer. I will take any language, but ...
-2
votes
0answers
51 views
Shortest code to calculate A + B until EOF
Write the shortest code you can for calculating the sum of two numbers until EOF.
Rules:
You can only use 5 languages: C, C++, Python, Java and FPC
Not only expression, the whole code.
Example:
...
3
votes
2answers
92 views
Print a specific value in the infinite Walsh matrix
The Walsh matrix is an interesting fractal matrix with the property that every single value in a Walsh matrix has a value of either -1 or 1. Additionally, the size of a Walsh matrix is always a power ...
27
votes
13answers
4k views
It's a rainy day
Context
It's Valentines Day. The only one you ever loved left you yesterday
for this guy she always found "stupid and uninteresting". On your
way home, you've been stuck in traffic, listening ...
6
votes
2answers
585 views
Shortest a -> b -> (a -> b) function in Haskell
I got this question at a test:
Write a function f with the following type a -> b -> (a -> b). a and b should not be bound in any sense, the shorter the code, the better.
I came up with ...
4
votes
3answers
258 views
3 and 5 Litre Jug Puzzle
You may have seen this one in Die Hard: With a Vengeance... This question is based on the famous 3 and 5 Litre Jug Puzzle, but with a slightly different slant.
Golf up some code that when given an ...
4
votes
7answers
256 views
Sum of indices of second least significant bit
This is a pure code-golf question.
Input: A non-negative integer n
Output: Sum of the indices of the second least significant set bit in the binary representation of the integers 0...n. If the ...
0
votes
0answers
73 views
Implement a GolfScript interpreter [duplicate]
The challenge is to write a complete interpreter for the entire GolfScript language, you may use any language you choose except GolfScript itself.
Constraints:
You may only the standard library for ...
7
votes
0answers
176 views
Create a C preprocessor
The goal is to create a preprocessor for the C language, as small as possible in terms of source code size in bytes, in your preferred language.
Its input will be a C source file, and its output will ...
-2
votes
3answers
72 views
Compute the greater common divisor & the smallest common multiple of N numbers
Your mission is to write 2 functions that accept a list of N integers (positive or negative).
N can be higher than 2.
The first one returns the greater common divisor of the N numbers
Example: [10, ...
10
votes
2answers
559 views
Flappy Bird Clones :)
Everyone's been freaking out about that stupid "Flappy Bird" game being removed. So, your task is to crate a Flappy Bird Clone game. Its really simple. Here are the guide lines:
It can use either ...
10
votes
6answers
485 views
Create a Roman Numeral calculator
Create a basic calculator for Roman numerals.
Requirements
Supports +,-,*,/
Input and output should expect only one subtractor prefix per symbol (i.e. 3 can't be IIV because there are two I's ...
2
votes
0answers
94 views
Tips for Golfing in Batch
Windows Batch (CMD) is probably the least suitable language for code golfing.
Avoid newline characters. If you're looking for the shortest code in bytes, as opposed to characters, you will want to ...
1
vote
2answers
85 views
Prepare data for JS renderer
It's asked to write a script to generate a source data to feed a JavaScript renderer.
:JS Renderer documentation
The JS renderer is this script:
function o(x){
r=x.split(' ');
...
6
votes
14answers
608 views
Write a program for splitting the string with alternative spaces
Want to write a program in minimum number of code,all programming language accepted
Runtime criteria also challanged
Example:
Input : abcdef
Output: a b c d e f
ab cd ef
abc def
...