Skip to main content

Questions tagged [code-golf]

Code-golf is a competition to solve a particular problem in the fewest bytes of source code.

3 votes
7 answers
341 views

Find the most isolated point

Given two non-empty sets of points \$P,T = \{(x,y)\ |\ x,y \in \mathbb{Z} \}\$, find the point \$p \in P\$ such that it is the "most isolated" from all points in \$T\$. The "most ...
bigyihsuan's user avatar
  • 10.2k
5 votes
3 answers
295 views

Clicks for minesweeper [duplicate]

Given a mine map of minesweeper, output how many left clicks at least needed to win the game. Each left click reveals a cell, and if there's no mine in the 3x3 range, recursively reveal nearby 3x3 ...
l4m2's user avatar
  • 25k
20 votes
23 answers
1k views

Is this a valid PZN?

Is this a valid PZN? A Pharmazentralnummer, or PZN, is an eight-digit code which uniquely identifies medications, medical products, and similar items in the German healthcare system. Examples include ...
Ciaran_McCarthy's user avatar
10 votes
14 answers
733 views

Looping counter extended

The looping counter is a challenge that prints an infinite number of lines. The first line has one *, the next line has one more ...
None1's user avatar
  • 1,115
17 votes
18 answers
1k views

Output the inventory sequence

Goal Write a program that outputs this list: ...
12431234123412341234123's user avatar
5 votes
5 answers
301 views

Calculating Graph Powers

Calculating Graph Powers (very similar to my other question asked here) According to Wikipedia, "the \$k\$th power \$G^k\$ of an undirected graph \$G\$ is another graph that has the same set of ...
SanguineL's user avatar
  • 738
8 votes
13 answers
4k views

Cellular Automata Rule 30

What are cellular automata? Cellular automata describes a broad category of computational models that covers various cellular automations, some of the most intriguing of which involve 'simple' rules ...
stevec's user avatar
  • 197
20 votes
30 answers
2k views

Break a word into vowels and consonants

Objective Given an string \$n\$, output two strings, namely the string consisting of vowels "a", "e", "i", "o", and "u", and the string consisting of ...
Arunabh's user avatar
  • 311
14 votes
8 answers
1k views

Compare two strings, with NaC

I just thought of this idea: if we have NaN ("not a number") for floats, how about NaC ("not a character") for a single unknown character in a string? Your input should be two ...
3-1-4-One-Five's user avatar
9 votes
14 answers
814 views

Convert CSV tables to MediaWiki tables

Input a CSV table, like this: data00,data01,data02,...,data0m data10,data11,data12,...,data1m ... datan0,datan1,datan2,...,datanm The cells in the CSV table is ...
None1's user avatar
  • 1,115
15 votes
5 answers
1k views

Is this a solvable Numberlink?

Challenge Per Wikipedia: Numberlink is a type of logic puzzle involving finding paths to connect numbers in a grid. The player has to pair up all the matching numbers on the grid with single ...
badatgolf's user avatar
  • 1,477
8 votes
7 answers
681 views

Complex Exponentiation [closed]

As the title says! Raise one complex number to the power of another. (a+bi)^(c+di)(using the principal branch of the complex logarithm) Requires four inputs a, b, c, d. You can combine a, b, c, d into ...
ThePlaneGuy45's user avatar
21 votes
14 answers
3k views

Cold Bee and Old Beer

Introduction: Inspired by this silly meme video, which states 'COLD BEER', but is slightly too large for the scrolling advertisement board, causing it to display either 'COLD BEE' or 'OLD BEER' ...
Kevin Cruijssen's user avatar
6 votes
4 answers
1k views

Hoop, Hoop, Hoop, Hoop, Eye-Eye-Eye-Eye

The Horrible Histories song "Learn Your Hieroglyphics" mentions a fanmade number system. Numbers are written as a sum of 10's ("hoops") and 1's ("eyes"), for example 99 ...
3-1-4-One-Five's user avatar
14 votes
5 answers
1k views

Decode a Caesar ciphertext with high probability

Caesar ciphers A Caesar cipher with shift=N is the process of replacing any alphabetic character in a string with the letter which is N positions ahead in the alphabet (wrapping back at the beginning)....
Nicola Sap's user avatar
  • 3,684

15 30 50 per page