@Rogem It's completely valid but it may make golfing less interesting.
The only justifications I can think of for compressing code are (a) if it can get the overall win or (b) optimizing for compressed size is more interesting (to the golfer and/or reader) than golfing in the base language.
I tried to understand A well linked challenge before anybody answered it, and I found it to be really ambiguous/poorly-worded. That problem is still there. I don't know how anybody understood it enough to write an answer. Is anybody actually sure their answer is valid as per OP's intended meaning?
For example this sentence:
If we play around with this for a little while we will find that some strings can only be drawn so that closed loops contain all or none of the letters (like our first example).
Does it really mean this?
If we play around with this for a little while we will find that some strings can only be drawn so that closed loops contain all of the letters, or none (like our first example).
I think the description is intended to be confusing, but if it were not it seems like it would be easier to put it as whether the lines necessarily form one connected piece.
@TRITICIMAGVS Just realized you also need to specify it's a strict substring (i.e. it can't be the whole string), otherwise all the True examples would be False
Hmmm... my regex matches the test cases correctly, and Doorknob's and Jonah's answers (which also match themselves), but it does not match @Neil's program. The Jelly and J answers match themselves, and match Neil's program. I don't know if Neil's program matches itself, because it takes more than 60 seconds and TIO times out.
Mine also matches Erik the Outgolfer's program (and the Jelly and J answers also match it).
I think I found some of the worst syntax of any "serious" programming language. Here is a recursive definition of the natural numbers as written in Epigram:
( ! ( ! ( n : Nat !
data !---------! where !----------! ; !-----------!
! Nat : * ) !zero : Nat) !suc n : Nat)
@TRITICIMAGVS Did you leave out part of the definition of being well-linked from the Hint? Is a string only well-linked if every character appears a total even number of times? Or is that only a requirement for the programs' source code?
I'm ignoring the linking stuff. I don't understand it really.
The Hint is quite concise and I understand it.
@TRITICIMAGVS I think it matters. It affects what your definition of "well-linked string" is. Can a string with at least one character appearing an odd total number of times be deemed "well-linked" as long as it qualifies for the definition in the Hint?
wait what https://tio.run/##pVdpcxVHEvzOrygcXhs2lqbvg7VZYweHOWKFrz2wgT6FsJFkJC1GmN/OZs2beRLPssMRmgg9jfSmc6qzsrKqSz549u5dzYd0nX4@2tnt4sXO7s74Kf8oto/FL7@0C/ihKy/P/vKsRRe2j3aPd/bP@OLgWT44erHxxYWre/uHV8vLvLP7LNcfr37Od3dwR1de3Nh4dnndlb2jw/2jwxOMV5Wu1E3gU//8zYLToWx@@e6dnK9rpEYsJKOMVHo2JK2rJLU0FFRw5JPv5J3uRGJ1fS/EKooLKwQFDN98It/5w/tKXnlAyt6opVbIZ2XIKhWJ1lzhei5uLBgaGFJ6SZqDGRyMbN5SVlWRajWS1VJTTcEgjqdXeXnjj8@FOJgxDDBs1Ims0xbbkIm07pqcw/@ySpaUtpqUwp905/LND4X4QHx7eQK5PGNYYDTdAtWcDI1UB9lqKzXrCiVnPHXPG0o@LHzcvy8eCS/EzvaM4YARguxkSk00BljogKPeSqCisqWUm2ZSGtEr8Xdxcj1f@PDAKCMXCg6vq7568tUNMs0Oyi57ig0frbbIcRxh7…
miniflak quine runs in <1s in brainhack: https://tio.run/##rVhpcxRHEv2uX5F7GjZMUfdhAoFZB2iNDV7sNcbYFnWCMAgQl8DAX2df9nSPhFZ4HQEToY4edderPF6@zJqSH995@7bmJ7RJj57u7HZxf2d3Z9zLv4rbL8X@ftvAH53aO/7hcYs2bj/dfbnz8JgHj@/kx0/vH3mwcfrBwyeny17e2b2T66@nL/DdFu7o1P3Pj7y7bHfqwdMnD58@OcA4jHz04du3cv58RmrEQjLKSLKVTi64SnhgKKjgyCffyTujicT0uf6TEBOm3lghKGDo7tv8avKefPWKfJGSemuGmvKZVHEBGGvf8bkrrs8Ymu2Q0lOX2L17rSkOLykq5UnXnEk63chGLSc7fhJ/FreE@FSIU1s0YxhgmGYDyVQVJYvl1hpJ2SVLrkf4Iq2GpxW@nL0ElFtfSCF@EbcuCDFjWGCk6DRZXRM8GIlqCpmCb4GSSgVAw1L2zcGOaxcE/Hj5TDDKGsMBo3aVaCT4nkaHQ90ALRhHqQMy1Vophe6WmIp0261uZgwPjGYih1MOCvxqHx0x7S…
e.g. new takes 1 argument (type) -> new foo, which then becomes a function that takes as many arguments as the type's constructor does (well, because it is the constructor syntax)
Yes, I think more test cases would be helpful, especially negative test cases. We have a lot of positive test cases in the form of the valid submitted programs :)
I like how you helped your program meet the restricted-source requirements by putting things in a negative lookahead. It didn't occur to me to try that.
Put something that can never happen in a negative lookahead and it's as good as a no-op.
@Neil, I don't understand how your regex can work. You don't double back after choosing a character to check for odd-number-of-times. So you can skip over other occurrences of that character that won't count towards the odd test...
This is what I've whittled yours down to, removing the restricted-source aspects: ^(?!(.*)(.+)(.*$)(?<!^\2|^\1((((?!\8).)*\8){2})*((?!\8).)*(.).*\3))
That's the problem with circumstances like this :) The moment we start looking at each others' regexes, we both can optimize them to be identical to each other
Totally possible but given that most programs come with an explanation anyway it seems like ti would be much easier to just generate all of it from something more read- and writeable. :)
@CorporalTouchy But they aren't part of the function. Here's the thing, the anonymous function, if assigned to a variable, can be called without parens. The rules always have some sort of logic :P
So...how does one pick up any of these golfing languages? I have been trying to fiddle with 05ab13 and Jelly on tio but they are way to complicated for that.
Keep up with it, and go through the docs. Jelly is particularly hard since it's a weird paradigm to get used to (tacit). Stack based languages (MATL, 05AB1E, Seriously, etc.) are a bit easier to wrap your head around
@CorporalTouchy Remember that you are welcome to participate using a non-golfing language too. Informally, each language competes in its own category, so verbose languages have no disadvantage.
"Input is valid if at least one of the teams starts first" This confused me for a while; perhaps reword. Other than that, I like this challenge very much.
Your task, if you wish to accept it, is to write a program that outputs its own source code in the binary UTF-8 representation.
Rules
You must build a full program.
Your output has to be printed to STDOUT.
The source must be at least 1 byte long.
Your program must not take input (or have an u...
but... I'm pretty sure that a UTF-8 program and its "equivalent" in "native encoding" are in fact two different byte sequences, and therefore two different programs that just behave the same, not sure if there's a "UTF-8 representation" of a "native encoding" program as we generally mean it
for example, the 05AB1E submission's code block isn't the real byte stream, but a representation of it based on a "code page", but... code pages aren't really all that formal
@DJMcMayhem how the file is processed is irrelevant as long as it can be processed, and you can't really see the "official" processing, unless you either a) know the language the implementation is written in (and you can't know every language there is, therefore implementations are black boxes), or b) consult a documentation page that describes such a process but doesn't define the language, as the language is defined purely by its implementation
well, we've agreed to use Unicode representations in answers, but I don't think we can really assume that when it comes to being part of defining a challenge objectively
In order to score with a custom encoding, it has to be a real encoding which already exists (in which case, is not a black box), or you have to explicitly state how the mapping works.
@Adám I guess why I'm confused is that doesn't seem to me like an issue that's specific to this challenge/rule. If you have a submission with non-unicode characters, submitting that program is gonna be an issue on any challenge unless you're just posting hexdumps
@DJMcMayhem There is nothing preventing anyone from not assigning visuals to their language's use of raw bytes. Any Unicode representation of anything is necessarily based on visual (or occasionally, semantic) similarity.
@DJMcMayhem I quite often see hexdumps in answers.
@Adám Absolutely. For example, bubblegum (or cinnamon gum). But you can still just convert each byte to a number, and then encode that number in UTF-8. That has nothing to do with characters
@DJMcMayhem since we generally assume that the answerer isn't lying, the mapping can very well be part of the language's documentation, or even linked elsewhere, but that's just because we've agreed to (and, well, can't put the entire implementation in the answer anyway :P)
for example, a mapping might state that one native byte is encoded by two UTF-8 bytes, each one being in 0123456789ABCDEFabcdef, and that there may be spaces in the "UTF-8-encoded" program to separate them too
for example, a 3-byte program 0xFF 0x33 0x64 might have the UTF-8 encoding FF 33 64, which is 8 chars
and then there are cases like Jelly's codepage, where there are 3 bytes that can each be encoded in two different ways (two of them being the result of a code page change)
Did the Delete button for comments change? I seem to recall that it was a faded × but now it is a huge red "Delete" which moves slightly SE when hovered over, and takes the entire page S with it.