@NewMainPosts re: this challenge, I've already found a loophole-abuse question in Jelly; it's unlikely to be reopened, so shall I post the answer CMC-style?
err, @cairdcoinheringaahing, see the previous comment
(the hard part is not "write a program to not use these characters" – that's trivial in Incident – but "write an Incident program to print this string", which is a hard task even in practical languages)
@user56656 no, but it's invariant under replacing any character with any other character
Incident has progressed to the point where I am no longer sure where tokens come from. I used to be able to see what I was doing to create or destroy tokens by accident but now everything is so carefully stacked that it's behavior is unpredictable.
this account is from Puzzling and has enough rep to chat
that's the only reason I'm using it here
out of interest, has anyone here actually learned Incident control flow / semantics or the like? or are they just preserving my program literally and simply keeping the token sequence the same?
(the advantage of Incident though is that it basically doesn't exclude anything, the whole token thing was designed so that it'd always be possible to create or uncreate tokens regardless of fixed requirements)
Write a piece of code that takes a string as input, and outputs a piece of code in the same language that, when run, will output the initial input string.
It must be able to handle any combination of characters A-Z, a-z, and 0-9.
Example in Python:
import sys
print "print('" + sys.argv[1] + "...
this means that you have to do something like use the top stack element as a temporary counter that holds the entire state of the program while you're moving up and down
that's actually a bit harder than the mini-flak construction, but should still be doable
Yeah. The goal of lost was to make it easy to write programs despite the randomness. I hope to one day make a second version that has fewer commmands available.
> There's also an exception that changes the meaning of an otherwise valid program:
If a command would trivially cause an infinite loop, it is skipped and has no effect. A command is defined as causing a trivial infinite loop if it pushes a value to a stack, it has pushed that value to that stack before, and no stack has been popped since then.
one of the reasons isn't a puzzle, it's basically to rescue polyglots that get stuck in an infinite loop early
the other one is
(that said, you could also break the infinite loop simply by screwing with the tokens in it…)
Incident was designed pretty slowly over a period of months so designs that seemed necessary early in its design sometimes turned out to be unnecessary later on
which is annoying for languages like Tableaux which were intended as golfing languages
(it was an interesting idea, working out the most powerful primitives to use for a language with a very small number of commands; unfortunately they ended up too powerful and the resulting language can do things that Turing-complete languages can't)
there's nothing ambiguous or unclear about Tableaux's spec and it's possible to work out how programs behave in it mathematically
it's just impossible to implement, in the sense that for any Tableaux interpreter, there must mathematically be at least one program it doesn't handle correctly
You must write a program in your desired language to return the following output:
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.
98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bottle...
in response to your comment on my sed answer, I noticed that in the string "Word Icicle!", it removes the second c before the first c, when it should do it the other way around
Curve Matching
code-golfarray
Given two lists a, b of the same length n find a third list x of indices such that a(i) = b(x(i)) for all indices i and x(i) <= x(i+1) for all applicable indices i and x(1) = 1 and x(n) = n.
Details
The list x is not necessarily unique (for instance when b has a...
Input: Two decimal integers. These can be given to the code in standard input, as arguments to the program or function, or as a list.
Output: Their product, as a decimal integer. For example, the input 5 16 would lead to the output 80.
Restrictions: No standard loopholes please. This is code-go...
if I give you lots of binary strings of the same length, is there a more efficient way to find the pair with the minimum hamming distance than just naively testing each pair?
In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. In other words, it measures the minimum number of substitutions required to change one string into the other, or the minimum number of errors that could have transformed one string into the other. In a more general context, the Hamming distance is one of several string metrics for measuring the edit distance between two sequences.
A major application is in coding theory, more specifically to block codes, in which the equal-length strings are...
Given an input (a string , array , integer) , Your job is to append one of the following to it.
st , nd , rd , th .
If you are unable to understand what this is. Here is an example :
1 ---> 1st
2 ---> 2nd
3 ---> 3rd
4 ---> 4th
11 ---> 11th
12 ---> 12th
13 ---> 13th
14 ---> 14th
and so on and ...
@user202729 Well I'm asking here because I'm frustrated restarting the computer everytime the error is showing. And idk the difference between 32 bit codeblocks and 64 bit codeblocks. Also which app in details you're talking about ? is it .cpp or .exe ?
Having a function f that takes arguments x1, x2, …, xn
– ie. f : X1 × X2 × … × Xn → Y
– currying redefines f as a function taking a single argument a1 which maps to yet another function. This technique is useful for partial application, fo...
ordinal string check
Description :
Given a string as input , check if it is a valid ordinal number or not. If it is valid return true otherwise return false along with the real ordinal number.
Possible inputs :
21st ---> true
12nd ---> false 12th
1nd ---> false 1st
....
Your output can eith...
@Neil: I don't know JavaScript but if I understand correctly you can remove the ternary.. I changed the specs a few minutes after posting, st. you're only required to support input-functions with ≥2 arguments, maybe you didn't see that - sorry!
Finnish cinema
You're given the map of a cinema theatre as a boolean matrix: 0 represents a free seat, 1 - occupied.
Each Finn who walks in chooses the seat farthest away
(Euclidean distance) from the nearest occupied one,
or if several such exist - the first among them in row-major order.
Outpu...
This is a code golf puzzle (Shortest byte count wins). The program should to do the following (Standard loopholes forbidden):
Input a hexadecimal number
Convert to octal
Create a number with exactly the same digits in binary (765 octal -> 765 decimal)
Divide the number by two
Convert to hexadec...
Description :
Given a string as input , check if it is a valid ordinal number or not. If it is valid return true otherwise return the corrected ordinal number.
Possible inputs :
21st ---> true
12nd ---> 12th
1nd ---> 1st
....
Your output can either be an array or a string (You can replace sp...
FileFormat seems to have a nice list. The link above is list of Consolas characters, because this seems to be the font that has the least characters of default monospace fonts in IDE's.
Suppose you have an odd number of white balls and the same number of black. How many partitions have an odd number of white balls and an odd number of black balls in each subset?
Description :
Given a string as input, check if it is a valid ordinal number or not. If it is valid return true otherwise return the corrected ordinal number.
Possible inputs :
21st ---> true
12nd ---> 12th
1nd ---> 1st
....
Your output can either be an array or a string (You can replace spa...
so in terms of a generating function it seems to be
sum_{k=1}^{\infty} (x + x^3 + x^5...)^k (y + y^3 + y^5 + ...)^k and you then look for the coefficient of x^a y^b when you have a white balls and b black balls
This is a code golf question. Shortest byte count wins, and standard loopholes are forbidden.
Everyone has heard of factors, the list of numbers that can be multiplied to result in a number (24=1,2,3,4,6,8,12,24). Common factors are the factors that 2 or more numbers share.
The Challenge:
Buil...
My 8 for 6 white balls is: (wwwwwbbbbb)(wb) (wwwwwbbb)(wbbb) (wwwwwb)(wbbbbb) (wwwbbbbb)(wwwb) (wwwbbb)(wwwbbb) (wwwbbb)(wb)(wb)(wb) (wwwb)(wbbb)(wb)(wb) (wb)(wb)(wb)(wb)(wb)(wb)