Newest Questions

Filter by
Sorted by
Tagged with
13 votes
15 answers
1k views

Rebase Until Inert

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 <...
19 votes
13 answers
2k views

Interpret G-code

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
Ted
  • 2,407
18 votes
26 answers
1k views

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 N possible (...
-5 votes
13 answers
366 views

Text Flattening Program

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 ...
5 votes
2 answers
210 views

The Mind: King of the Hill Edition

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 ...
15 votes
10 answers
2k views

Verify a Chinese ID Number

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 ...
11 votes
7 answers
673 views

On the Subject of Switches

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 ...
12 votes
12 answers
631 views

Recursive cumulative sum [duplicate]

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 ...
10 votes
2 answers
345 views

Check if a number is a power with its program value being a power

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 ...
7 votes
10 answers
1k views

Return sum of last 3 odd numbers

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 ...
-2 votes
0 answers
69 views

How to find the Longest Common Substring among command-line arguments in JS? Hardest golfing [duplicate]

I'm writing a Node.js script that takes multiple strings as command-line arguments and needs to find their Longest Common Substring (LCS). Smallest JavaScript code size wins. Requirements: If no ...
11 votes
11 answers
732 views

Find a linear function such that if f(0), f(1), f(2), ⋯ are indices of the elements of the list, the sum must equal to its slope

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 ...
4 votes
13 answers
798 views

Which letter is missing? [closed]

Given a printable ASCII string, return any letter which is not present (ignoring case), if possible, else return the empty string. Test Cases: ...
13 votes
4 answers
647 views

Continue the spiral

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: ...
5 votes
3 answers
911 views

Multiply the input by 2

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 (...

15 30 50 per page
1
2 3 4 5
...
965