All Questions

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

Triangulating Angles [closed]

Prompt: You are given two sets of XY coordinates along with two angles (all are floats): X1 Y1 A1 X2 Y2 A2. The angles are relative to world coordinates: 0 being ...
6
votes
1answer
113 views

How many Battleships boards are there? [closed]

Battleships is a game in which one player lays out a number of shapes ("ships") on a board (typically 10×10) and the other player then fires at them. This challenge concerns not the gameplay ...
21
votes
16answers
711 views

Can we spell a third number?

You are given two strings, each consisting of the English word for a number between 1 and 13: ...
25
votes
14answers
986 views

Make an ASCII table

We're getting markdown tables! I assume this is what they look like: ...
19
votes
13answers
659 views

Operational countdown

Given a non negative integer number \$n\$ output how many steps to reach zero using radicals, divisions or subtractions. The algorithm Get digits count ( \$d\$ ) of \$n\$. Try the following ...
-2
votes
0answers
66 views

Number of words between pages in a book [closed]

You are given a list of tuples like this: [(1, 5, "even"), (5, 15, "even"), (1, 15, "odd")] The first number in the tuple is the ...
-3
votes
2answers
125 views

Rocket Liftoff! [closed]

This code golf challenge is about making a rocket liftoff sequence. Your output should be similar to this: ...
22
votes
25answers
2k views

Quickly! Group together!

This challenge will function somewhat like an answer-chaining question, in that new answers will (somewhat) depend on old answers. However, this is (as far as I can tell) a unique form of answer-...
19
votes
24answers
1k views

Perfect radicals

Given a positive integer number \$n\$ output its perfect radical. Definition A perfect radical \$r\$ of a positive integer \$n\$ is the lowest integer root of \$n\$ of any index \$i\$: $$r = \sqrt[i]{...
25
votes
17answers
2k views

Convert negadecimal to decimal (and back)

Negadecimal, also known as base -10, is a non-standard positional numeral system. Take the number \$1337_{10}\$. In decimal, this has the value one thousand three hundred thirty seven, and can be ...
28
votes
49answers
3k views

Infinitely many ℕ

Background: A sequence of infinite naturals is a sequence that contains every natural number infinitely many times. To clarify, every number must be printed multiple times! The Challenge: Output a ...
2
votes
0answers
97 views

5 tasks in (modified) BrainF**k from the Estonian OI

Introduction This challenge appeared in the 2020 Estonian Open Informatics Olympiad and was created Sandra Schumann. I thought it was interesting because it involves symmetry and is quite hard even to ...
1
vote
12answers
486 views

just a caesar cypher… with a twist [closed]

I have been going to puzzling.se, and people over there write stuff in rot13 a lot, sot this gave me an idea: Write a program that takes 2 inputs, a string and integer: the message to encode or ...
2
votes
0answers
128 views

Clock with ASCII art [closed]

It is quite simple, any language, make output show the time in the HH:MM or HH:MM:SS while the numbers and the colons being ascii art(The output is ascii art not the program) Sample output: ...
67
votes
21answers
11k views

“Hello, World!” in zero lines of code

NPM's sloc is a moderately popular tool for counting source lines of code in a file. The tool will attempt to strip out both single and multiline comments and count the remaining lines in order to get ...
-5
votes
0answers
61 views

Adding together Summations on python [closed]

I'm trying to add the summation of a function from x to f. Where x=0 and f is from range (0,m) where m is some integer. How do I add the summation of this for python?
28
votes
48answers
3k views

Multiply or Divide by n

Here's a simple challenge, so hopefully lots of languages will be able to participate. Given a positive integer \$n\$, output \$A076039(n)\$ from the OEIS. That is, start with \$a(1)=1\$. Then for \$n&...
11
votes
3answers
626 views

How to golf evaluation of math expression in MySQL?

The challenge given to me is comparatively easy, and specific to MySQL only. I'm given a table expressions which have mathematical calculations done by a kid. ...
28
votes
17answers
2k views

Gluttonous Colluding Numbers

Here's an easy one, with just enough complexity to make golfing non-trivial. Input A list of non-negative numbers representing people waiting in line for Thanksgiving dessert. The first (leftmost) ...
16
votes
20answers
2k views

Find distance between the closest 3D points

Your task is to take \$n \ge 2\$ points in 3D space, represented as 3 floating point values, and output the Euclidean distance between the two closest points. For example $$A = (0, 0, 0) \\ B = (1, 1, ...
21
votes
19answers
977 views

Compatible strings

When studying numerology, you can say two words (strings consisting entirely of letters) are compatible if they produce the same number under the following operation (let's use the string ...
36
votes
15answers
3k views

NATO phonetic spelling can take long

NATO phonetic alphabet is a spelling alphabet that associate to each of the 26 letters of the English alphabet one word (table below) that is easy to understand over the radio or telephone. For ...
1
vote
0answers
102 views

Printing Hello World using fewest characters [duplicate]

I saw a problem which asks you to print "Hello World" using the fewest characters, including spaces. How can I further shorten this code? Thank you in advance! ...
16
votes
14answers
1k views

Centerless Polygons

A centered polygonal number is a positive integer given by the number of vertices when a point is surrounded by (increasingly larger) polygons with the same number of sides, as shown below. For ...
19
votes
13answers
2k views

NESCA: New English Stroke Count Alphabet

TLDR: Sort your input according to a new English alphabet somewhat based on Chinese stroke count methods. Background: In a Chinese glossary/index, finding terms that are contained within the book is ...
31
votes
4answers
4k views

High throughput Fizz Buzz

Fizz Buzz is a common challenge given during interviews. The challenge goes something like this: Write a program that prints the numbers from 1 to n. If a number is divisible by 3, write Fizz instead....
13
votes
5answers
737 views

Write a Unicode Unpacker

We all know scoring by characters is ripe for abuse. Let's prove this. The Challenge Output the following: ...
9
votes
2answers
395 views

Edit distance where a substitution only costs the first time

This challenge is about the following variant of edit distance. Say we have a cost of 1 for inserts, deletes and substitutions as usual with one exception. A substitution for a given letter ...
16
votes
13answers
1k views

All-inclusive semi-primes

\$723 = 3 \times 241\$ is a semi-prime (the product of two primes) whose prime factors include all digits from \$1\$ to \$n\$, where \$n\$ is the total number of digits between them. Another way to ...
2
votes
0answers
99 views

Dobble Double Challenge [closed]

I have a problem, which I haven't found a solution for. Solutions to the first part are well documented, but I have yet to find anyone who has solved the second part. I call this the "Dobble"...
7
votes
1answer
280 views

How to golf wrap-around assignments?

This is a relatively simple question. I'm trying to golf a Snake game I've written, and I'm trying to work out if there's a way to golf the following conditional assignments which control x and y ...
8
votes
7answers
2k views

Fastest square root of an arbitrary size

We do seem to have a fastest square root challenge, but it's very restrictive. In this challenge, your program (or function) will be given an arbitrarily sized nonnegative integer, which is the square ...
18
votes
17answers
491 views

Align a list of numbers [duplicate]

Perhaps something like this is here already, but I couldn't find it. It is not the same as Aligning Lines!. Example: Input: 98.6 $2,750.17 -$23 -86 3,120,487.19 ...
19
votes
32answers
2k views

Make a minimal and maximal 2-digit number from digits of two 3-digit numbers

Let's solve this user's homework; I think it's an interesting exercise! Input Two 3-digit natural numbers. Outputs Two 2-digit numbers. In each of the output numbers, one digit is taken from one input ...
24
votes
7answers
2k views

Are these states connected?

With the US election going on right now, I noticed that there is one (completely meaningless, but still) thing which Trump can still achieve and which is out of reach for Biden: Having the won states ...
17
votes
5answers
2k views

Convert Magic the Gathering colours to a Colour based deck name

Magic the gathering has many unique names for colour combinations in decks, as an example when Blue and White appear together in a deck, the deck maye sometimes be named after the Ravnican Guild that ...
1
vote
1answer
332 views

Hacker Challenge: Guess the Correct Password

In an attempt to “liberate” their fellow birds, a group of highly intelligent hens are attempting to compromise the zoo’s security system. To get access to the zoo’s mainframe, the hens first need to ...
13
votes
5answers
560 views

Wuxings in Positive Action

Background Wuxings(五行) are the five "elements" in Chinese philosophy. They are Fire(火), Water(水), Wood(木), Metal(金), and Soil(土). You can find them on East Asian calendar, where some days (...
33
votes
22answers
3k views

Narcissistic loop lengths

A narcissistic number is a natural number which is equal to the sum of its digits when each digit is taken to the power of the number digits. For example \$8208 = 8^4 + 2^4 + 0^4 + 8^4\$, so is ...
22
votes
15answers
1k views

Convert height to US Men’s Jacket size

In the US, clothing size sometimes has rough designations like M, L, XXL, etc. The US designation of the "men's jacket" category depends on the height of the person. So, in this challenge, ...
23
votes
36answers
1k views

Display the exponent from a binary floating point number as a decimal value

Had my software final exams recently, one of the last questions had me thinking for a while after the exam had finished. Background IEEE754 numbers are according to the below layout The exponent is ...
-7
votes
4answers
192 views

Generate a RecursionError [closed]

Write the shortest possible code cause an error due to recursion too deep Example error in python RecursionError: maximum recursion depth exceeded Example error in ...
7
votes
9answers
356 views

Almost Illegal Strings, Mark II (Robbers)

This is the robbers' thread for 'Almost Illegal Strings'. See the cop's thread for information on participating. A section from the post is included here for convenience. The Robbers' Challenge Find ...
18
votes
12answers
641 views

Almost Illegal Strings, Mark II (Cops)

Edit 2020-11-06: This challenge has been edited with new provisions to encourage participation. The edits have been bolded for emphasis. Welcome to a cops and robbers version of Find an Illegal ...
18
votes
26answers
3k views

Is It A Rainbow Color?

Challenge: The challenge is to determine whether or not a color, given it's name, is one of the colors in the rainbow. When supplied with a color, your program should output a truthy value if it is a ...
10
votes
1answer
321 views

Total resistance from unit resistors

This problem is based on, A337517, the most recent OEIS sequence with the keyword "nice". \$a(n)\$ is the number of distinct resistances that can be produced from a circuit with exactly \$n\...
11
votes
13answers
816 views

Prefix divisibility

Inspiration Given a positive integer \$1 \le n \le 9\$, output all positive \$n\$-digit integers \$i\$ for which the following is true: Each digit from \$1\$ to \$n\$ appears exactly once in \$i\$. ...
25
votes
29answers
2k views

Not so triangular numbers

Let's consider the sequence \$S\$ consisting of one \$1\$ and one \$0\$, followed by two \$1\$'s and two \$0\$'s, and so on: $$1,0,1,1,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,0,...$$ (This is A118175: Binary ...
-1
votes
1answer
176 views

Square root of a base 10 positive integer, digit by digit [closed]

It is possible (Wikipedia reference) to compute the square root of any number in a digit by digit fashion using a simple (I had learned it in primary school) algorithm. Challenge: read a positive ...
6
votes
8answers
832 views

Bi-directional translator

Bi-directional translator The challenge is to create a translator that can translate a [a-zA-Z ] string into another string according to the mappings below. The ...

15 30 50 per page
1
2 3 4 5
238