The Post's Correspondence Problem (PCP) gives you a list of pairs of strings, P_1 ... P_n. Your task is to find a k, and some sequence of k indices such that fst(P_i1) ... fst(P_ik) = snd(P_i1) ... snd(P_ik)
We're trying to find some sequence of the pairs where the word we build from the first p...
Stackylogic is a logic-based programming language I made up that take in 0's and 1's for input and outputs a single 0 or 1 upon completion.
A Stackylogic program consists of lines that can only contain the three characters 01? as well as exactly one < at the end of one of the lines. Lines may no...
Turing completeness is a theoretical concept that assumes impossible conditions like infinite memory and has very little impact in real world coding. Brainfuck is Turing complete, but completely useless for most tasks.
@DestructibleWatermelon Though you could have 9 different programs, one for each bit of the output for the input of two 8 bit numbers (or just add a "print the last popped value" command)
Create the shortest function that finds the factorial of a natural number.
The factorial is found by multiplying a number by each of the numbers that lead up to it.
5! = 5 * 4 * 3 * 2 * 1 = 120
Requirements:
Does not use any built-in libraries that can calculate the factorial (this includes...
How allowed is it to not meet specs? Because it definitely won't be able to compute 125! in under a minute (I'd be surprised if any computer had enough memory to compute it at all)
On Stackoverflow, if you click on an invalid link, you will be redirected to a 404 page with this polyglot:
# define v putchar
# define print(x) main(){v(4+v(v(52)-4));return 0;}/*
#>+++++++4+[>++++++<-]>++++.----.++++.*/
print(202*2);exit();
#define/*>.@*/exit()
(Originally written by Mark ...
For this golf, you will need to use more than one language.
The task
A Rube Goldberg machine is a contraption that takes an enormous number of complicated steps in order to execute a very simple task. The goal of this golf is to output Rube Goldberg... but not directly.
The machine
Your "mach...
@Quill Yeah, but it isn't an interesting challenge at all.
@Dennis I'm not really sure what to do about that challenge. I kinda want to delete it so I can come up with something more interesting, but you and quill would both lose rep.
@DrGreenEggsandIronMan Two options: 1. Change the rule about major versions, abandon, move on, post a different challenge. 2. Ask us to delete our answers so you can delete the challenge. I'll probably hit the rep cap anyway.
@LeakyNun If you save 404 to a file, it prints nothing. You have to run it inside the J REPL, so it wouldn't be a full program, at least in my opinion.
Definition
Define the nth term of the CRAU sequence as follows.
Begin with the singleton array A = [n].
Do the following n times:
For each integer k in A, replace the entry k with k natural numbers, counting from 1 to k.
Compute the sum of all integers in A.
For example, if n = 3, we start ...
Challenge:
In your preferred programming language, you must parse a String into a real number (int or float). The String will only contain number characters (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) and may contain a . to create a floating point. However, you may not use any pre-existing parsing functions ...
@LegionMammal978 That's an idea... it would be intensely difficult to work with, but maybe I could find a way. Comma separated unary would make adding easy and multiplication wouldn't be too bad. Hmmm. I can multiply in unary because I can recurse over each element and replace with the commas of another. So I guess I could recurse over binary values and implement AND, OR, XOR, NOT, etc. Not sure how to do carries. Hmm....
Maybe my list preprocessor library would help (it allows easy handling of values surrounded in parentheses). Unfortunately, I haven't quite been able to get my map function to work...
@LeakyNun Seemed novel enough and it sorta was. I was going to post this initially, but I thought, hey, adding the results will make verification easier. It made a lot of things easier, unfortunately...
V
You should golf in V because it's different, competitive, and powerful. V is a very interesting language, that functions very differently than any other language I have ever used. Most of the quirks of V make it somewhat hard to learn, but also offer a lot of potential for golfing.
V is diffe...
In this question, we will only focus on losing weight by doing exercise, although there are still many ways to lose weight.
Different sports burn different amount of calories.
For example, playing billiards for an hour can burn 102 calories[1], while playing basketball for 15 minutes can alread...
In this popular (and essential) computer science book, An Introduction to Formal Languages and Automata by Peter Linz, the following formal language is frequently stated.
mainly because this language can not be processed with finite-state automatons.
This expression mean "Language "L" consists...