1
vote
0answers
42 views

KOTH: Warring Towns

Introduction The game takes is strongly inspired by Manu's Game of Town. It takes place in a world of swords and magic. The king who ruled the whole continent just died, and the lords of the many ...
8
votes
8answers
459 views

The Jigsaw Code Puzzle

This is an answer-dependent challenge! The order of answers matters, and your exact task depends on the last answer that was posted. You might want to sort the answers by oldest. Let's piece ...
6
votes
9answers
627 views

Generate the Stöhr sequence

I am learning Ruby and wrote my first nontrivial code to solve this problem. The challenge is to generate the first n elements of the Stöhr sequence, S, which is defined as follows: S[0] = 1 ...
5
votes
4answers
267 views

Write a binary counter in quine

Write two code fragments, which we will call s_zero and s_one. Program (l, n) consists of l copies of s_zero and s_one corresponding with the digits of n in binary, padded with s_zero on the left. ...
10
votes
2answers
308 views

Trucks in a parking lot

There are P parking spaces in a parking lot, though some spaces are occupied by cars represented by octothorpes # while the free spaces are dots .. Soon there arrive T trucks, each of which will take ...
4
votes
2answers
359 views

Solve a 2x2 Eigensystem

For those with a little linear algebra background, the challenge is as simple as this: determine the eigenvalues and eigenvectors of a given complex 2x2 matrix. You may skip ahead to The Challenge for ...
4
votes
2answers
187 views

Building a long chain of words

This challenge is to find the longest chain of English words where the first 3 characters of the next word match the last 3 characters of the last word. You will use an common dictionary available in ...
11
votes
11answers
1k views

Print out the first N characters of your code

You should write a program or function that receives a positive integer N as input and prints out the first N characters of your code. If N is larger than the length of your code you should continue ...
14
votes
3answers
590 views

Words within words within words within words . . .

In this pixelated font of uppercase letters of the alphabet, all the characters are 5 units wide and 5 tall. ███ ████ ███ ████ █████ █████ ████ █ █ █████ █ █ █ █ █ █ █ █ █ █ ...
0
votes
1answer
43 views

Implement range function without using numbers in code [duplicate]

You have to create a function range, such that it takes two (integer) arguments a and b (a < b) and returns all the numbers in between them. So: range(5, 10) // should output 6, 7, 8, 9 range(-5, ...
6
votes
1answer
126 views

Confused badminton players

Introduction Jim and Bob are playing badminton doubles against two other players, but mid-game they face a dilemma: After a fast-paced rally they have no idea who has to serve next and where they ...
2
votes
0answers
110 views

Cell-phone golf [duplicate]

Older cellphones have 3 or 4 characters mapped to each number from 2-9 and that number must be pressed a certain number of times to get the required character. Let's assume our cellphone has this map: ...
-5
votes
0answers
42 views

Help me quickly please [on hold]

write an assembly language on emulator 1_ it request the upper limit from the user , the upper limit can contain up two digit 2_once it gets the user input , it multiplies all the odd value starting ...
6
votes
2answers
116 views

Remove a weight so the rest can't be balanced

This code-golf challenge is based on the following puzzle: You have an odd number of tokens whose weights are known whole numbers, and they don't all have the same weight. Show that there's a ...
4
votes
1answer
94 views

Create a universal two-dimensional cellular automaton cell using two-way universal logic processors

In Conway's Game of Life, a cell is in a state of either on or off, depending on the on-and-off state of the eight cells surrounding it. We can simulate this using a logic gate network with some sort ...
-1
votes
2answers
88 views

Find Anagrams in the Dictionary [on hold]

This a code challenge. The winner will be the person to provide the most efficient implementation of the solution. Assume you have a dictionary (for implementation in linux and OS X, you can find a ...
9
votes
5answers
317 views

Put the line in the code you nut and shake it all up

Using one programming language write 5 single-line programs, each of which outputs a different line of the first verse to Harry Nilsson's 1972 song "Coconut" when run individually: Brother bought ...
-1
votes
0answers
82 views

A practical use of a riddle about three light bulbs [on hold]

There is a classical riddle about three light bulbs: A windowless room contains three identical light fixtures, each containing an identical light bulb or light globe. Each light is connected to ...
11
votes
22answers
1k views

String to Binary

This is a code golf challenge. Just like the title says, write a program to covert a string of ascii characters into binary. For example: "Hello World!" should turn into 1001000 1100101 1101100 ...
13
votes
17answers
1k views

Find the substring with the most 1's in a sequence

Introduction I want to find the substring with the most 1's in a sequence of 0's and 1's. Input Your program has two inputs, the sequence and the substring length. The sequence is any number of ...
3
votes
3answers
401 views

Generate all 4-perfect numbers

Your program or function should output all the 36 4-perfect numbers in increasing order separated by newlines. An n positive integer is a k-perfect number (multiply perfect number) if the sum of its ...
-5
votes
2answers
96 views

Make a caeser cipher [on hold]

I love my encryption but I need a program that is dedicated to making a caeser cipher. It will take an input string and will output a ciphered text with the number to decode it. The number can be made ...
-2
votes
0answers
31 views

Validation to prevent user returning to a previous value [on hold]

Requirement: When users set lead to 'Qualified' I want validation to prevent them returning to any other status. The below works, but I need to accommodate for 'Converted' status for when the lead ...
12
votes
15answers
2k views

Keep your distance!

Every player has a number. Can yours be the farthest from them all? Requirements Write a Java, Python 2, or Ruby function named choose() that accepts three arguments: an integer - the number of ...
24
votes
3answers
688 views
+100

Identity sequences on the Rubik's Cube

A move sequence is a sequence of moves (turns) on a Rubik's Cube (for the notation look down below). Beside the empty move sequence, there are many other other move sequences, that have no effect on ...
-1
votes
0answers
43 views

Foreward DCC GARCH correlation forecasts [closed]

First post please be nice. I'm having trouble figuring out how to get foreward correlation forecasts in dcc.estimation in package ccgarch. I've done it for the variance forecast to 5 periods ahead. ...
6
votes
3answers
354 views

The Great, White, North!

Eh! You know, the problem with us Canadians is that sometimes, after a long day of moose hunting and dam repairing, we forget our way back to our cabins! Wouldn't it be great if our handy laptop ...
-1
votes
6answers
111 views

Double Factorial [duplicate]

Challenge The objective is simple, in the shortest amount of bytes, write a function or program that takes a number and prints its double factorial. The input must be taken from stdin or a function ...
-4
votes
1answer
74 views

Listing links from pages — with error handling

In my previous question Debunking Stroustrup's debunking of the myth “C++ is for large, complicated, programs only”, a lot of people complained that comparison with Stroustrup's program isn't fair, ...
0
votes
4answers
323 views

All those duplicate questions deserve duplicate code to show them off

All those questions that are duplicates... Ignored and marginalized by society. It is just not... right. We have to do something. There surely must be love for them too. They feel appreciated if a ...
81
votes
19answers
7k views

Lab Rat Race: an exercise in genetic algorithms

This is Fortnightly Challenge #3. Theme: Genetic Algorithms This challenge is a bit of an experiment. We wanted to see what we could do, challenge-wise, with genetic algorithms. Not everything may be ...
2
votes
1answer
347 views

Billy Lost his Pen

tl;dr [True] Billy got a Stack Overflow pen from Tim Post. Billy was stupid enough to use the pen, knowing that he was not worthy. Billy's friend took the pen apart, so Billy put the pen in a drawer ...
10
votes
1answer
466 views
+50

A fastest algorithm scheduling challenge

This is my first experiment with an asymptotic complexity challenge although I am happy with answers entirely in code as long as they come with an explanation of their time complexity. I have the ...
133
votes
59answers
12k views

Showcase your language one vote at a time [experimental challenge]

In this experimental popularity contest users will be able to showcase their favorite programming languages. However, the amount of code they are allowed to write is dependent on the number of votes ...
20
votes
7answers
1k views

Cover a Region with Rectangles

Input Your input in this challenge is a list of integer pairs. They represent the southwest corners of unit squares on the plane, and the list represents their union as a subset of the plane. For ...
10
votes
4answers
201 views

H Tree Directories

Programmers are often obsessed with drawing fractals. I think we need a new computer based medium. The H tree is a fairly simple type of fractal made of horizontal and vertical lines. Here it is at ...
14
votes
7answers
571 views

Sum the powers to n

Directions Write a program that, given an input integer n (n >= 0), outputs the smallest positive integer m where: n = a[1]^b[1] + a[2]^b[2] + a[3]^b[3] + ... + a[k]^b[k] a and b are finite ...
24
votes
3answers
951 views

Looking for programs in a huge Boggle board

Each character in this 64 by 64 block of text has been chosen randomly and uniformly from the 95 printable ASCII characters. /rq$:Zy5*g'$DeGXX2o8y "{@Cg:FR9qih}xh >5$DsF1Fs5Ao~smFp;.RJbV )U ...
7
votes
24answers
1k views

Cops and Robbers bowling (Robbers)

Robbers' Thread In this challenge, your goal is to crack some code written by the Cops (their code is here) by modifying it. You have cracked their code if: Your modified code has a maximum ...
15
votes
26answers
1k views

Cops and Robbers bowling (Cops)

Cops' Thread In this challenge, your goal is to write a function that accepts a integer N, and that function will return the first N primes. However, you must do this in the most characters ...
6
votes
1answer
204 views

Combinator quines

Background You have just learned what combinatory logic is. Intrigued by the various combinators you spend quite a bit of time learning about them. You finally stumble upon this particular ...
5
votes
2answers
280 views

Heaps of trouble

Challenge You must, in the least bytes possible, implement the Binary Heap data structure and each of the following methods that operate on it: A function which takes no arguments and returns an ...
36
votes
14answers
5k views

Into how many pieces can you cut this string?

Consider a piece of string (as in "rope", not as in "a bunch of characters"), which is folded back and forth on the real line. We can describe the shape of the string with a list of points it passes ...
-4
votes
2answers
145 views

Implement slow sorting algorithm [duplicate]

All good coders know some good sorting algorithms like quicksort or merge sort. There is also slow sorting algorithms, e.g. bubble sort and insertion sort. But those are such easy to implement and ...
14
votes
2answers
441 views

Winning Strategies for a String Construction Game

Background Alice and Bob play a game called construct a binary word. To play the game, you fix a length n >= 0, a set G of length-n binary words called the goal set, and a length-n string t ...
6
votes
0answers
82 views

Find the Straightest Path in a Maze [duplicate]

In this challenge, your job is to find the straightest path from point A to point B in a two-dimensional maze. This is very similar to finding the shortest path, which has been done to death, but ...
27
votes
15answers
1k views

The Game of Towns

Introduction The game takes place in a small world with different towns. The rulers of the towns hate each other and would like to rule the world. The people are divided into two groups, warriors and ...
-11
votes
1answer
220 views

It's 2015 where's my hoverboard!

Make a program that prints out: "Back to the Future" (no quotes). The source code must contain "It's 2015 where's my hover-board!" over and over again, with a minimum of extra characters and syntax. ...
11
votes
1answer
316 views

Score a game of Kingdom Builder

I want to try a new form of code golf here. Similar to bonuses, not all parts of the challenge have to be completed, but each answer has to implement a subset of certain size (and there is a core that ...
19
votes
8answers
2k views

Code Golf Image Downloader

In many image-processing challenges, the post contains images, which must be saved to a file in order to be able to work on the problem. This is an especially tedious manual task. We programmers ...

15 30 50 per page