All Questions

Filter by
Sorted by
Tagged with
11
votes
6answers
310 views

Billiard balls collision

Given the 2-dimensional positions and velocities of a pair of billiard balls right before impact, calculate their velocities after a perfectly elastic collision. The balls are assumed to be ideal ...
5
votes
23answers
356 views

Talk interpreter

"Talk" is a baroquified accumulator-based language that is created in response to Dennis's quote on talk.tryitonline.net. ...
13
votes
21answers
520 views

Tex Quotes(UVa 272)

Given a string, replace all left-double-quotes into two backticks and all right-double-quotes into two single-quotes. Left-quotes means the quotes that starts a quote. Right-quotes means the quotes ...
8
votes
6answers
196 views

Church Subtraction

Church Subtraction Lambda calculus has always been a fascination of mine and the emergent behaviors of passing functions into each other is delightfully complex. Church numerals are representations ...
5
votes
6answers
446 views

The Knight's estate

And then the King said: You fought bravely, Knight, and your deed will not be forgotten for centuries. For your valor I grant you this castle and the lands around it. Things rush me, and I can not ...
21
votes
10answers
864 views

Nothing like a good ol' game of ModTen

Disclaimer: ModTen is a fictional card game which was created for the sole purpose of this challenge. The rules of ModTen ModTen is played with a standard 52-card deck. Because the full rules are ...
16
votes
3answers
389 views

The fastest Sudoku solver

The goal of a game of Sudoku is to fill the board with the numbers 1-9, one in each cell, in such a way that each row, column and box only contains each number once. A very important aspect of a ...
-1
votes
0answers
43 views

DCC model estimation with t-Student distribution rmgarch [on hold]

I was analyzing and implementing the DCC model (Dynamic Conditional Correlation) for the one-day forecast calculation of the variance-covariance matrix of a system consisting of, approximately, 30 ...
11
votes
54answers
2k views

Round towards zero

This is a simple task. Given a positive or negative real number, round it to the next whole integer closer to zero. The challenge Take input through any reasonable form (stdin, function, etc.) of ...
17
votes
30answers
2k views

Numbers Decrease while Letters Increase

Randomly inspired by Numbers Increase While Letters Decrease Given a list of mixed letters and integers (e.g., ['a', 2, 3, 'b']) increase the letters by one ...
10
votes
13answers
1k views

Irish Snap: Variant Rules

Introduction Recently, me and a couple of my friends decided to play some cards, and one of them suggested the game 'Irish Snap', which was the inspiration for this challenge. However, I later learnt ...
52
votes
14answers
6k views

Who was president of the USA?

Challenge Write a program that takes as input a day from April 30, 1789 to August 21, 2019 and returns as output who was president of the USA that day. Notes For the list of US presidents, the ...
14
votes
21answers
1k views

Start from ones

Given a strictly positive integer n, follow these steps: Create an array A with n 1s. If A only has one element, terminate. Otherwise, starting from the first element, replace each pair of A with its ...
16
votes
4answers
2k views

Fancy String Replace

let S, a and b each represent a string Goal: Write a standard string replace function where ...
8
votes
4answers
287 views

Weigh your words!

The challenge Given two strings, each of length up to 30, consisting of printable ASCII characters (codes \$[32, 126]\$), put them onto a balance scale in the fewest bytes of code! This consists of ...
6
votes
23answers
380 views

caN it be acrOnymised? [duplicate]

The Typical Way to Make an Acronym Out of a Phrase Is to Take the First Letter of Each Word: TTWMAOPITFLEW. howeveR, sometimEs, you can make an acronym of random ...
32
votes
19answers
6k views

Church Booleans

Church booleans A Church boolean is a function that returns x for true and y for false where ...
53
votes
50answers
10k views

How much code would a codegolf golf if a codegolf could golf code?

Write a function or program that takes two words as input and outputs variants of the popular English tongue-twister "How much wood would a woodchuck chuck if a woodchuck could chuck wood?". The ...
3
votes
2answers
247 views

Identical grids

You’re given two \$r×c\$ grids. Each cell contains either 0 or 1. What are the minimum number of swaps (between horizontally and vertically adjacent cell elements, no wrapping i.e no swapping between ...
12
votes
1answer
293 views

Write a radiation-hardened irradiator

The task is to write a radiation-hardened irradiator. What do I mean by that, exactly? An irradiator is a program that, when given a string as input, will output all possible versions of the string ...
1
vote
9answers
664 views

Lazy brainfuck programmer [closed]

Background Joe is working on his new Brainfuck answer on Codegolf. The algorithm he's using to solve the challenge is a bit complicated, so Joe came up with idea of simplifying his Brainfuck notation ...
21
votes
60answers
8k views

!I!n!s!e!r!t! !n!b!e!t!w!e!e!n!

Posted from here. This challenge is highly "distilled" from this question. Special thanks to @Akababa! In this task, you should insert an exclamation mark at the start of the string and after every ...
19
votes
9answers
2k views

Levenshtein Neighbours

Most square numbers have at least 1 different square number with which their Levenshtein distance is exactly 1. For a given square \$x\$, each square that meets this condition is called a Levenshtein ...
-1
votes
0answers
110 views

A prescribed time length [closed]

Challenge Write a program that takes as input an integer 1 <= n <= 50 and returns a text string of length n stating a time in the English language. Example Input: 20 Output: "It's six thirty-...
28
votes
29answers
2k views

The Lucky House

There's a minigame in Super Mario 3D World known as the Lucky House. It consists of a slot machine with 4 blocks. Each block may be one of 5 different icons (Flower, Leaf, Bell, Cherry or Boomerang) ...
26
votes
29answers
2k views

Output with the same length always

With challenges like Output with the same length as the code and Create output twice the length of the code, I thought of a separate, but similar challenge. The task is to produce an output. It can ...
-6
votes
0answers
82 views

JSON data exchange between Python files [closed]

I'm having a hard time in my code. The question may be silly but for me it's pretty hard because I'm starting with python I have this selenium python code. I just simply need to return a JSON if one ...
9
votes
0answers
146 views

Decompose Commutators

A theorem in this paper1 states that every integral n-by-n matrix M over the integers with trace M = 0 is a commutator, that means there are two integral matrices A,B of the same size ...
24
votes
14answers
7k views

Build a mob of suspiciously happy lenny faces ( ͡° ͜ʖ ͡°)

I was going through a bizarre thread on Reddit, and came across this: ( ͡°( ͡° ͜ʖ( ͡° ͜ʖ ͡°)ʖ ͡°) ͡°) It's representing a group of people smiling somewhat suspiciously. (In the challenge below ...
-5
votes
2answers
122 views

Elimination ordering

Your task is to remove smallest amount elements from a list, so the most elements are on their corresponding place. The element is on it's corresponding place, when it's value is equal to it's ...
-4
votes
0answers
151 views

Smallest self-hosting golfing language [closed]

Implement a golfing language that is implemented in itself. Formally speaking: The original compiler O (an executable file assumed to be implemented in other language X), when given its own source ...
4
votes
8answers
205 views

Shortest Program To Find Lowest Common Ancestor of Two Nodes in a Binary Tree

Any two separate nodes in a binary tree have a common ancestor, which is the root of a binary tree. The lowest common ancestor(LCA) is thus defined as the node that is furthest from the root and that ...
2
votes
20answers
500 views

Number in overlapping range

You are given two integers between lets say 1 and 12, one and two and a integer between lets say 0 and 4 which is called ...
10
votes
1answer
207 views

Interpreter for number theory, modulo n

A sentence of number theory (for our purposes) is a sequence of the following symbols: 0 and ' (successor) - successor means <...
27
votes
31answers
2k views

Output the list of musical notes

This task is simple: Write a program or function that outputs the list of all musical notes (using English note names) from A♭ to G♯. All notes without a name consisting of a single letter (i.e. ...
15
votes
17answers
4k views

Attacking the Hydra

Instead of being a skillful warrior capable of slaying Hydras (see here and here), this time you are a warrior that has no prior knowledge on how to kill one or which weapons to use against the ...
9
votes
7answers
968 views

An array battle with odd secret powers

Here is a relatively simple two dimensional array challenge. Imagine a battlefield of 625 foot soldiers. You command the odd troops, but unfortunately the strength of the even troops overwhelms you. ...
10
votes
33answers
978 views

Chunk + Enumerate a list of digits

I have a list of decimal digits: 4, 4, 4, 7, 7, 9, 9, 9, 9, 2, 2, 2, 4, 4 The list of decimal digits are known as items. We can form "chunks" from these items by ...
20
votes
12answers
2k views

Lípínguapua dopo Pêpê

Língua do Pê, or P Language, is a language game spoken in Brazil and Portugal with Portuguese. It is also known in other languages, such as Dutch and Afrikaans. (Wikipedia) There are some dialects in ...
11
votes
2answers
488 views

Create the least compressible picture

"A picture is worth a thousand words"—so the old saying goes. The average word is about four characters long, so a picture conveys 4kB of information. But how much entropy, rather than information, ...
32
votes
21answers
5k views

Telephone number in spoken words

Goal Write a program or function that translates a numerical telephone number into text that makes it easy to say. When digits are repeated, they should be read as "double n" or "triple n". ...
10
votes
7answers
230 views

Crossing sequences

Crossing Sequences Given a list of positive integers A, call it an increasing sequence if each element is greater than or equal to the previous one; and call it a ...
15
votes
18answers
2k views

Simplification of numbers

How, you can’t remember the 6 or 7-digit phone number that appeared on the TV screen for a second?! Using the special technique described below, you will turn into a walking phonebook! Obviously, the ...
32
votes
33answers
6k views

Is this n-speak?

Inspired by Is it double speak?, I devised a harder challenge. Given a string, determine if the string is n-speak, for any \$n\geq 2\$. N-speak is defined by repeating each letter \$n\$ times. With \$...
1
vote
5answers
194 views

Print an array as a table [closed]

Write a program that prints an associative array (key-value) to a table. Requirements Standard loopholes are forbidden Please include a link to an online interpreter and the byte count in the ...
30
votes
34answers
7k views

The cat ate your input again!

Create a cat program, a.k.a a program that takes an input and prints it. ...Except, the program will randomly take characters away from your input and print that instead. Each character in the input ...
33
votes
15answers
6k views

Generate Brainfuck for the numbers 1–255

Write a program that, for the numbers 1 through 255, prints out BF code that will produce the given number in some byte of the array, plus a newline. For example, the first four lines of the output ...
0
votes
1answer
209 views

The Practice of Programming

At 1998, Brian Kernighan, while working on the book "The Practice of Programming", wanted to demonstrate realisation of regular expression engine. But struggled to find small engine, that cod could ...
18
votes
7answers
3k views

Y2K… in 2019?

It's August 10th, 2019, but your task still involves Y2K. Weird, right? Create a program that prints itself, with a two digit number appended to it. The first time you run it, it should append 00 to ...
5
votes
7answers
290 views

Bucket interpreter

Create a program that interprets the programming language Bucket. Bucket works on two buckets: the first can hold A and the second can hold B units of liquid. The things you can do with these buckets ...

15 30 50 per page