Questions tagged [decision-problem]
For challenges which involve deciding whether or not the input meets certain criteria, and outputting some data, representing that decision.
802 questions
30
votes
13
answers
3k
views
Infinite ordinals from a well-ordering
Your task is to write a short program that represents a large (infinite) ordinal, using a well-ordering of the set of positive integers. Your program will take two different positive integers and ...
27
votes
9
answers
3k
views
The matrix has U
Given a matrix of size at least 3×3 formed by positive integers, determine if it contains at least one "U" pattern, defined as
...
57
votes
34
answers
10k
views
Check if computer is connected to the internet
Write a program which, according to whether the script has access to the internet, produces an output which is "Truthy/Falsey". You may try and connect to any existing site, at your own discretion (...
59
votes
145
answers
21k
views
Is this number evil?
Introduction
In number theory, a number is considered evil if there are an even number of 1's in its binary representation. In today's challenge, you will be identifying whether or not a given number ...
14
votes
7
answers
696
views
Parse Ternary Lambda Calculus for correctness
Wheat Wizard has once tried to come up with a parsing problem unsuitable for regex, but it failed due to Anders Kaseorg's Perl regex answer. This is the second attempt. Now that we know that Perl ...
57
votes
51
answers
15k
views
Is my OS 32-bit or 64-bit?
It's not too important anymore, but occasionally somebody needs to know.
Here is a simple golf: Taking no user input, tell me if the computer on which the code is run is on a 64-bit operating system, ...
17
votes
11
answers
1k
views
Directory traversal attack detection
Given a path to a file or a directory, detect whether the path can traverse to outside the current working directory, or attempt to traverse to the "parent directory" of the root directory.
...
37
votes
63
answers
5k
views
All together now
Given a list of digits 1 through 9, output whether each digit is grouped together as a single contiguous block. In other words, no two of the same digit are separated by different digits. It's OK if a ...
33
votes
9
answers
2k
views
Can I sweep the mines?
Minesweeper is a popular puzzle game where you must discover which tiles are "mines" without clicking on those tiles. Instead, you click on nearby tiles to reveal the number of adjacent ...
14
votes
18
answers
1k
views
Identify Redundant Regex
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 ...
86
votes
101
answers
20k
views
Golf all the 16 logic gates with 2 inputs and 1 output!
For example, the gate A and B is a logic gate with 2 inputs and 1 output.
There are exactly 16 of them, because:
each logic gate takes two inputs, which can be ...
86
votes
81
answers
15k
views
Is this relationship creepy?
According to this XKCD comic, there is a formula to determine whether or not the age gap in a relationship is "creepy". This formula is defined as:
(Age/2) + 7
...
83
votes
273
answers
28k
views
Is this even or odd?
Note: There is not been a vanilla parity test challenge yet (There is a C/C++ one but that disallows the ability to use languages other than C/C++, and other non-vanilla ones are mostly closed too), ...
18
votes
24
answers
910
views
Is there an even distance pair?
In this challenge you will receive a list of integers as input. Your program should then determine if there are two equal values in the list at an even distance from each other.
This is code-golf so ...
50
votes
93
answers
9k
views
Is this number a factorial?
The Task
Given a natural number as input, your task is to output a truthy or falsey value based on whether the input is a factorial of any natural number. You can assume that the input number will ...