0
votes
0answers
2 views

Generating Euclidean rhythms

Did you know that the Euclidean algorithm is capable of generating traditional musical rhythms?. We'll see how this works by describing a similar, but slightly different algorithm to that in the ...
-1
votes
0answers
14 views

How to solve tower of hanoi? [on hold]

Can you help me solve this? Which of you can do it in lesser lines using java language? I tried to solve it by public class MainClass { public static void main(String[] args) { int nDisks ...
0
votes
0answers
21 views

Matrix property X revisited

This challenge is partly an algorithms challenge, partly an optimization challenge and partly simply a fastest code challenge. A T matrix is fully specified by its first row r and first column c. ...
10
votes
8answers
163 views

Counting in pyramids

You should write a program or function which receives a list of distinct integers as input and outputs or returns the number of occurrences of the input numbers in the following upside-down number ...
14
votes
4answers
474 views

Shifty XORyption

Write a program or function (or set of programs/functions) to encrypt and decrypt data given the following specification: Encryption Calculate an XOR hash of the input by XOR-ing every byte with ...
11
votes
2answers
109 views

Y-Wing Strategy for Sudoku

I recently got a new Sudoku app that produces really hard Sudoku's, which can't be solved using the standard strategies. So I had to learn a few new ones. One of these strategies is the Y-Wing ...
6
votes
1answer
148 views

Randomized Brainfuck Compiler

Joe is your average BF developer. He is about to check in his code changes to their repository when he gets a call from his boss. "Joe! The new client's machine is broken! The brainfuck interpreter ...
18
votes
3answers
863 views

(Somewhat) Pedantic Birthday Paradox

Background The birthday paradox is a popular problem in probability theory which defies (most people's) mathematical intuition. The problem statement is: Given N people, what is the probability ...
15
votes
0answers
212 views

Factoring a 64-bit integer

Write a GOLF assembly program that reads an integer from stdin (followed by a trailing newline), and outputs its prime factors seperated by newlines, followed by a trailing newline on stdout. The ...
28
votes
3answers
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 ...
-2
votes
0answers
171 views

Print “Stackoverflow” without using string literals [on hold]

Write the shortest program that takes no input, but prints Stackoverflow as its only output. Rules: No string literals No commands that take a number as input and output a character directly (for ...
0
votes
0answers
53 views

How do I find the longest palindrome in an integer? [on hold]

written in c programming, I need to find the longest palindrome in an integer, without using arrays or functions. using only loops and conditional operators.
0
votes
0answers
69 views

Shortest possible code to test if a string is a date [on hold]

First time thinking up a challenge, so forgive me if it's too easy, but I found this rather challenging myself when faced with it and thought I might have finally found a nice challenge for on ...
15
votes
7answers
784 views

Binary Images of Triangle Counts

My challenges tend to be a little bit hard and unattractive. So here something easy and fun. Alcuin's sequence Alcuin's sequence A(n) is defined by counting triangles. A(n) is the number of ...
6
votes
3answers
400 views

Leibniz golf in C#

I'm starting with golf code. But im only do C# so I know wont be a breaking record, but I want give it a try. Leibniz Challenge is here The first line contains the number of test cases (N) which is ...
-1
votes
0answers
57 views

You are required to manage the sales data of a car showroom. Help! [on hold]

You are required to manage the sales data of a car showroom. There are 8 salesman. At the end of the month you have to make a report. You are required to make the following calculations.Input the ...
12
votes
0answers
202 views

Determining the rotation of square given a list of points

In this challenge, you will be given a list of points. These points will lie on the perimeter of an imaginary square. Your goal is to: If possible, print out the rotation of the square, which will ...
4
votes
1answer
187 views

Word fractal plotter

Iterated Function Systems An Iterated Function System (IFS) is a method of constructing self-similar fractals. Each fractal is defined recursively as the union of several copies of itself, with each ...
11
votes
2answers
529 views

Smoothing out a list

You should write a program or function which takes a non-negative integer k and a sorted integer list Las input and outputs or returns a smoothed list M. M is created from the ascending list L by ...
-4
votes
0answers
108 views

Social Media Self Destruct [on hold]

How would one go about having a social media self destruct incase of any tragedy or something. The Program would deactivate the individual social media accounts incase an individual does not have a ...
15
votes
9answers
1k views

Compute the Hausdorff Distance

Introduction The Hausdorff distance measures the difference between two subsets of a metric space. Intuitively, a metric space is just some set with a built-in distance function; in this challenge, ...
0
votes
0answers
77 views

Finding smallest difference in an array C# [closed]

static void Main(int[]a) { Action<int[]> b = Array.Sort; b(a); a = a.Select((c, d) => (a.Length > d + 1 ? a[d + 1] - c :-1)).ToArray(); b(a); ...
8
votes
0answers
189 views

Leonhard loves labyrinths

The background My son Leonhard (4 years old) loves labyrinths. I don't know where he knows labyrinths from, but he paints them and knows quite well how they work: Recently, he started making a ...
0
votes
0answers
35 views

N-Puzzle Linear Conflict Heuristic [closed]

For the N-Puzzle Solver like https://n-puzzle-solver.appspot.com/ , I need to use Linear Conflict as the heuristic in A* search algorithm to be used. Did I get the concept of linear conflict right? ...
18
votes
3answers
483 views

Stringing a Pearl Necklace

Overview Pearls (or Masyu) is a logic game played on a grid. There are black and white pearls placed on the grid. The object is to form a single, closed loop that travels through each pearl using ...
0
votes
0answers
43 views

C# Programming arrays [closed]

I am writing a program that takes the scores of homework assignments puts them in a array then averages them. But I need to make it so that these grades range from 1-10, I am not sure how to make it ...
13
votes
6answers
401 views

Tiling a 2^N by 2^N Grid with L-Shaped Trominoes

When students are first taught about the proof technique of mathematical induction, a common example is the problem of tiling a 2N×2N grid with L-shaped trominoes, leaving one predetermined grid ...
46
votes
32answers
4k views

Telescopic Parentheses

Consider a non-empty string of correctly balanced parentheses: (()(()())()((())))(()) We can imagine that each pair of parentheses represents a ring in a collapsed telescopic construction. So let's ...
18
votes
9answers
2k views

Who wins a Spades trick

Write code to determine who wins a four-card trick in a game of Spades. Fewest bytes wins. The input is a string that lists the four cards played in sequence like TH QC JH 2H (Ten of Hearts, Queen of ...
9
votes
3answers
412 views

Capture The Flag

This is a game of capture the flag, heavily inspired and based off of Red vs. Blue - Pixel Team Battlebots. That was an awesome question (thank you very much Calvin'sHobbies; I hope you don't mind ...
26
votes
4answers
1k views

Code Explanation Formatter

Successful code golf submissions are, by nature, filled with crazy symbols all over the place. To make their submission easier to understand, many code-golfers choose to include an explanation of ...
1
vote
2answers
313 views

Write an Antiquine [closed]

Definitions: I define a "true antiquine" as follows: A true antiquine is a non-empty computer program of length n which takes no input and produces a copy of every valid program of length n in ...
17
votes
4answers
384 views

Group Therapy: Identify Groups

Write a program, that determines whether the multiplication table of the given finite magma represents a group. A magma is a set with a binary operation that is closed, that means for all a,b in G, ...
-1
votes
2answers
142 views

Java Package Correction

I have a lot of java projects and I am often making new ones. I have a few helper classes (Vector, Logger, etc.) and it takes a lot of time correcting the first line to the correct package, I would ...
0
votes
0answers
412 views

Torrent that downloads itself

This challenge is similar to Zip Files All The Way Down. Basically, I want code to make a .torrent that downloads itself, much like a zip/compressed stream that decompresses to itself. The generated ...
-1
votes
1answer
115 views

Find unique, sorted, dot+alphanumeric strings in a file not beginning with a digit/dot, not ending in dot

Write a script that can take a single pathname of a file, read it, and output the sorted, unique strings within it such that: each string begins with a letter (a-z, A-Z) all characters between the ...
-3
votes
0answers
63 views

Output the largest number possible in 1024 bytes (a kilobyte) or less [duplicate]

Other rules: infinity and other numbers generally expressed as words aren't allowed you may use decimals in this challenge, "output" means something that is output to the command line or as text in ...
8
votes
3answers
566 views

Write a Shift Interpreter

EDIT: As some of you suspected, there was a bug in the official interpreter: the order of composition in . was reversed. I had two versions of the interpreter, and used the wrong one here. The ...
7
votes
14answers
777 views

Minimum base to count to a string

The Challenge Input: alphanumeric string. You can assume that the string will only contain the characters [0-9A-Z]. This can come from a parameter, command line, or STDIN. Digits are always before ...
5
votes
4answers
119 views

Tips for golfing in Element

Since my use of Element has increased recently, I am interested in tips for golfing programs written in it. What general tips do you have for golfing in Element? I'm looking for ideas that can be ...
29
votes
13answers
3k views

Draw a Random ASCII Art Quilt

For this challenge, an ASCII art quilt will be a block of text 24 characters wide and 18 lines tall, containing the characters =-<>/\ in a quilt-like pattern that is horizontally and vertically ...
2
votes
0answers
115 views

Help My Brother Work on his Tan(gent)!

This challenge is entirely fictional. There is no time limit for this challenge. My little brother is terrible with computers! He saved up all of his money to buy a new one, and within half an hour ...
10
votes
3answers
612 views

Make the largest infinity that you can!

The ordinal number system is a system with infinite numbers. A lot of infinite numbers. So many infinite numbers that it literally does not have an infinity to represent its own infiniteness. The ...
12
votes
1answer
483 views

Two-zero-one-five puzzle

Background This puzzle is a variation on the four fours puzzle (itself the topic of a past question). Like that puzzle, the aim is to find mathematical expressions for different whole numbers, using ...
39
votes
6answers
9k views

Hodorize a String

Hodor is a slow-minded but endearing character on the show Game of Thrones (he's in the books as well of course). The only word he ever says is 'hodor'. Surprisingly, despite not having much of a ...
7
votes
0answers
183 views

Meta quine checker

This challenge, if you accept it, is to write three functions or programs A, B, and C: A is a quine that outputs all of A,B and C (which is also the whole content of the code in your submission). B ...
10
votes
4answers
1k views

Produce different behaviour in all versions of your language [duplicate]

Write a program that: if a compiled language is used, compiles without errors if an interpreted language is used, runs without syntax errors for every major release of your language, and produces ...
1
vote
1answer
82 views

Write two single line functions to encode and decode base64 [duplicate]

Write two functions of one line each that can encode and decode base64. Use any language you want, but if the language can naturally be converted to a single line (e.g. javascript) then any block of ...
5
votes
3answers
1k views

Getting a Highscore in Kuku Kube [closed]

First of all, this is more a challenge, than a serious programming question, I would like to share. Some of you might know the game Kuku kube, where you have to identify a square in a grid, which has ...
5
votes
1answer
165 views

The Gray area of n-ary codes

Write a program or function that takes a base n and a number x, and returns or outputs the n-ary Gray code of x. Rules n is an integer in the range 2 <= n <= 16. x is an integer in the range ...

15 30 50 per page