Newest Questions

Filter by
Sorted by
Tagged with
2 votes
2 answers
184 views

Background This video goes into ways you can humanize binary, including creating a more compact writing notation using . and | ...
user119818's user avatar
  • 1,631
11 votes
2 answers
306 views

We are going to define a simple little language. A word in this language is a binary string where the longest run of consecutive \$0\$s, is shorter than every (maximal) run of \$1\$s. So for example: \...
Wheat Wizard's user avatar
  • 103k
3 votes
2 answers
158 views

Say there are three multisets A, B, C. An infix condition has form <ON|FACING|NEAR> <a multiset> where ON requires ...
l4m2's user avatar
  • 32.5k
11 votes
4 answers
527 views

Given two sorted lists of same length \$\{a_i\}\$ and \$\{b_i\}\$, find the smallest \$w\$ such that it's possible to connect each pair of points \$(0,a_i)\$ and \$(w,b_i)\$ with paths such that x-...
l4m2's user avatar
  • 32.5k
0 votes
1 answer
108 views

You have to code in python, and the number generated by your code must be bigger than all other current submissions. You need to make your code as small as possible, it has to terminate but you can ...
IAmNotLarry's user avatar
-1 votes
1 answer
131 views

Given a String of opening brackets and the letter G, such that it makes a applicative tree of the leaf node G and ( representing ...
malediscord kitten's user avatar
8 votes
4 answers
596 views

Objective Given a prime number \$p\$ and an integer \$n \geq 2\$, find a degree-\$n\$ primitive polynomial modulo \$p\$. Mathematical explanation When we perform "modular arithmetic" over ...
Dannyu NDos's user avatar
  • 7,381
4 votes
1 answer
196 views

Given a wall maze of 50x50, exactly same generating algorithm, at different RNG, so every two positions are connected by exactly one path, etc. Write two functions: One takes the maze as input and ...
l4m2's user avatar
  • 32.5k
4 votes
1 answer
121 views

What is Buckshot Roulette? Buckshot Roulette is an indie game, released by Mike Klubnika to itch.io in 2023. Okay, but how do you play? To quote from the wiki: "At its core, Buckshot Roulette is ...
Natelolzzz's user avatar
14 votes
10 answers
1k views

The most common way to represent a polynomial is writing it as a linear combination of monomials, i.e., powers of the variable. For example, the polynomial \$p(x) = x^3 + 2x^2 + x + 1\$ is a linear ...
alephalpha's user avatar
  • 51.9k
17 votes
18 answers
2k views

Task Given an unsorted list of integers, order it in such a way that the absolute difference of every two adjacent elements will always be equal to 1: \$|dx| = 1\$ There will be guaranteed one or more ...
Glory2Ukraine's user avatar
2 votes
0 answers
175 views

Given a wall maze of 50x50, write two functions: One takes the maze as input and returns a positive integer; The other takes the integer and walk through the maze from left-top to right-bottom. At ...
l4m2's user avatar
  • 32.5k
11 votes
7 answers
610 views

This was originally a question from interviewstreet.com over a decade ago You are given an array (or whatever - your choice of input) of positive integers \$y_1,\ldots,y_n\$ that represents \$n\$ line ...
Henry's user avatar
  • 219
18 votes
8 answers
1k views

Introduction: When saying numbers out loud, the order is slightly different in Dutch than in English. For a number like \$1234\$: in English you'd say: one thousand, two hundred and thirty-four in ...
Kevin Cruijssen's user avatar
11 votes
17 answers
922 views

A redundant regular expression (regex) is defined here as a regex which has some amount of characters which can be removed while not affecting its functionality -- i.e. it matches the exact same set ...
97.100.97.109's user avatar
8 votes
8 answers
970 views

This is inspired by this homework assignment. Telomeres are regions of repetitive DNA sequences that occur at the ends of linear chromosomes in eukaryotes (such as humans and other mammals). In ...
M--'s user avatar
  • 986
29 votes
27 answers
5k views

a XAND b a AND b, but not at the same time. I've always found the idea of an XAND gate amusing. Many would claim such a gate can not exist, but I suspect they're just not trying hard enough. ...
Albert Renshaw's user avatar
8 votes
6 answers
949 views

I was thinking when SQL can be less verbose than traditional programming languages and came up with this challenge. Input Natural number N Generating data We ...
Dr Y Wit's user avatar
  • 519
18 votes
3 answers
998 views

Here is a game: Start with the set {1,2,3,...,n} of natural numbers. At any turn of the game, you may pick two numbers from this set, a and b, then replace them with their product a*b. Since it is a ...
Fabius Wiesner's user avatar
-7 votes
8 answers
313 views

Write the shortest program or function that accepts a sequence of three or more letters and returns its I18n-style numeronym, preserving the original letter case. The I18n-style numeronym is formed by ...
Steve Bennett's user avatar
1 vote
2 answers
230 views

Bands and Bonds is a browser clicker game about delving in a dungeon. It has the particularity that only one of the actions you may take can be auto-repeated at the same time: You may start several ...
Themoonisacheese's user avatar
9 votes
3 answers
320 views

Divide 1 by a sum/difference of square roots Input: An expression that is a sum/difference of square roots of positive integers. You can assme it will not equal 0. The general form is \$\pm\sqrt{a_1}\...
Lucenaposition's user avatar
5 votes
4 answers
357 views

DNA is read in groups of three nucleotides (the letters you see in a sequence), called codons, for determining what protein sequence the portion of DNA will yield. I already used this in a previous ...
Whitehot's user avatar
  • 633
6 votes
9 answers
698 views

Parse rpip7 musical notation rpip7 is a minimalist music notation derived from ip7, designed for simple playback (for example, on an Arduino with a buzzer). It supports only these symbols: ...
islptng's user avatar
  • 435
21 votes
17 answers
1k views

I was looking for a simple sequence that's not yet referenced on the OEIS and came up with this one(*): \$a_1=2\$ \$a_2=3\$ For \$n>2\$, \$a_n\$ is the smallest number of the form \$a_i\times a_j+...
Arnauld's user avatar
  • 206k
14 votes
17 answers
1k views

Each quarterback in the NFL is given a passer rating at the end of the game, which measures how good their forward passes were. It is not strictly a basic arithmetic formula, and is calculated as ...
Parcly Taxel's user avatar
  • 4,749
10 votes
8 answers
751 views

An extension of Find the closest palindromic number mixed with Numbers Interpreted in Smallest Valid Base. A number is a palindrome if its sequence of digits is the same when reading them from left to ...
Value Ink's user avatar
  • 13.6k
15 votes
18 answers
1k views

This is a sequel to Numbers Interpreted in Smallest Valid Base. Let us define the operation of rebasing a number as writing out its digits in decimal form, then interpreting them in the smallest base <...
SquareFinder's user avatar
19 votes
13 answers
2k views

G-code is a set of instructions used to manipulate machines in CNC, 3d printing, or other similar applications. It controlls the position of a tool, manuvering it to create a path. Your goal is to ...
Ted's user avatar
  • 2,417
20 votes
31 answers
2k views

Let us define the operation of rebasing a number as writing out its digits in decimal form, then interpreting them in the smallest base N possible (...
SquareFinder's user avatar
-5 votes
14 answers
445 views

Input: A string, can be multi-line. The newlines must to be real newline (e.g., you cannot request that each newline be (n)). There is another input, a number (not ...
QOO-OOKALAN's user avatar
8 votes
3 answers
334 views

Sandbox In this king-of-the-hill challenge, you will be playing a variant of the popular game The Mind. In this variant, every round, a deck of K cards labeled 1 - K are shuffled, and hands of size N ...
Rushabh Mehta's user avatar
15 votes
10 answers
2k views

Verify a Chinese ID Number The Resident Identity Card (居民身份证) is a document issued to most Chinese citizens. It contains information about its holder, including their name, address, and ID number, an ...
CanonNi's user avatar
  • 259
11 votes
7 answers
739 views

This challenge is from a video game, Keep Talking And Nobody Explodes. A yes or no choice isn’t too bad. Unfortunately you have to make five of them and any of them could be your last. — from the ...
Dannyu NDos's user avatar
  • 7,381
12 votes
12 answers
747 views

Challenge: Given inputs \$i\$ and \$n\$, calculate \$R_i(n)\$ where: $$R_0(n)=n \\ R_i(n)=\sum_{j=0}^nR_{i-1}(j)$$ Note that \$R_1\$ is triangular function, and \$R_2\$ is tetrahedral function. This ...
Fmbalbuena's user avatar
  • 5,085
10 votes
2 answers
370 views

Task: Your task is make a program to check if there exists integers \$a \ge 2, b \ge 2\$ such that \$a^b=i\$ where \$i\$ is the input integer at least 2. The catch is that your program must return a ...
Fmbalbuena's user avatar
  • 5,085
8 votes
12 answers
2k views

Introduction In my CS4 class I worked with another student to golf this lab as much as possible. I learned a lot about Ruby with it, and I am curious what optimizations could be done. :D Challenge A ...
packjack's user avatar
11 votes
11 answers
794 views

Challenge: Find integers \$a\$ and \$b\$ defining linear function \$f(x) = ax + b\$ with \$a > 0, b \ge 0\$ such that the sum of the elements of the input list \$l\$ located at the values of the ...
Fmbalbuena's user avatar
  • 5,085
5 votes
13 answers
856 views

Given a printable ASCII string, return any letter which is not present (ignoring case), if possible, else return the empty string. Test Cases: ...
Steve Bennett's user avatar
13 votes
4 answers
705 views

Write a program or function which, given a clockwise spiral as input, extends that spiral by one character. When given no input, your function returns the start of the spiral: ...
Steve Bennett's user avatar
5 votes
3 answers
978 views

Your goal is to write a program which will take an input and multiply it by 2. However, there are some catches. You will get an input in one of a few forms: A number (...
Ted's user avatar
  • 2,417
1 vote
1 answer
149 views

I would like to create a language that is specifically designed for compiling/translating to another Turing tarpit language. I want to make the program of the target language to be as short as ...
Fmbalbuena's user avatar
  • 5,085
18 votes
18 answers
1k views

Write a program/function to output a peg solitaire board in its starting position: ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ○ ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ...
Steve Bennett's user avatar
17 votes
22 answers
2k views

I had this problem come up for me recently and I thought it would make a fun code-golf. You will receive as input a list of positive integers. e.g. ...
Wheat Wizard's user avatar
  • 103k
16 votes
11 answers
2k views

When code golfing, it can be useful to write numbers succinctly. This challenge involves using a source language to generate code for a target language. For the submission to be valid, it must ...
Charles's user avatar
  • 3,071
8 votes
6 answers
839 views

Challenge: NSDT is like a calculus model invented by me that contains only 4 commands and grouping. Your task is to check in which way the program ends. The program is read from left to right. There ...
Fmbalbuena's user avatar
  • 5,085
3 votes
4 answers
778 views

Write a program or function to output an N x N sunburst image made of red, orange and yellow emoji icons. For N=40, it should look roughly like this: ...
Steve Bennett's user avatar
17 votes
10 answers
1k views

Should be relatively easy to do, given an input of a resistance (in ohms) and a tolerance (%), output the colour codes for a 4 band resistor, left to right. Input will always be a valid ohm value and %...
Natelolzzz's user avatar
12 votes
2 answers
232 views

You will be given a block of text and a cursor position at the end of a possibly incomplete word. You must output a suggestion for what this word (let's call it w) ...
Ted's user avatar
  • 2,417
14 votes
20 answers
2k views

This is the 2D version of Sum of neighbours: Given a 2D grid of integers, output a grid of the same size where each cell contains the sum of the values of its orthogonal and diagonal neighbors (up to ...
turalson's user avatar
  • 581

15 30 50 per page
1
2 3 4 5
290