« first day (3157 days earlier)      last day (1671 days later) » 

5:40 AM
challenge me on lichess.org, my handle is ChEsSn0oBz
or just add me
 
6:20 AM
Sure, it might be hard to find a time to play though cause of the zone difference
 
 
6 hours later…
12:08 PM
0
Q: Golf (6-card) Golf!

qdreadGolf Golf! This is my first challenge, so please be gentle! The challenge is to write a program that will output the correct score for a layout in the card game "Golf." The card game Golf has many variations. The house rules I use follow the standard rules for Six-Card Golf given by Pagat, with...

 
 
5 hours later…
5:12 PM
What are some examples of set functions such that, for any three sets X,Y,Z of numbers we have:
f(X union Y) > f(Y) implies f(X union Y union Z) >= f(Y union Z)
f(X union Y) < f(Y) implies f(X union Y union Z) <= f(Y union Z)
The two easiest examples are cardinality and sum.
Also minimum and maximum.
 
ngn
5:40 PM
@PhiNotPi "cardinality" is not a function
 
What do you mean len(x) is not a function??
 
ngn
there are multiple equivalent definitions of "function", let's take one: a "function" is a set of pairs whose first element is in the domain of the function and whose second element is in the range
so, a function itself is a set
 
cardinality still sounds like a function to me
 
ngn
but if we have to build a function (i.e. a set) that maps all sets to something, then it becomes larger than the set of all sets
 
5:44 PM
@EriktheOutgolfer I think that, strictly speaking, cardinality is not a mathematical function. However, I think restricting Phi's question to mathematical functions only makes it less interesting.
 
ngn
from russell's paradox we know that a set of all sets cannot exist. so, cardinality cannot be a function. qed.
 
Meanwhile, over in programmer land, we have functions for cardinality, random numbers, opening files, etc. A function there is basically "a black box that takes some input and produces some output".
 
@ngn that seems to say that no function taking any set as an input can exist, nothing specifically about len(x)
 
ngn
@El'endiaStarman set theory function ≠ computer science function
@dzaima yes
 
@ngn Yep, I'm agreeing with you. I just think Phi had compsci functions in mind.
 
5:48 PM
@ngn Yeah I think you're taking it to be more mathematical than what I'm envisioning. By "set" I really mean a list of some numbers. And by "numbers" I mean probably positive integers only.
 
an unordered list of numbers at that :P
 
Come to think of it, do min(x) and max(x) also not qualify as mathematical functions?
 
@ngn i know nothing about set theory but that seems like an awful definition of functions due to what you've just explained
 
ngn
@PhiNotPi ah, ok :) everyone please ignore my little detour into transfinite set theory then
 
@El'endiaStarman technically no, but there's "supremum and infimum"
 
ngn
5:54 PM
@dzaima it's the commonly used one, afaik
@PhiNotPi the easiest example is f = constant :)
 
tbf, I'm pretty sure we can define a function n : {x <= S : x} -> N
(S is some superset, <= means subset)
and then the formula would be n (S) = {0: S = {}, n (S \ (x s.t. x in S)) + 1: S =/= {}}
dangit markdown
 
6:12 PM
I think I actually technically also want the additional condition that
f(X union Y) = f(Y) implies f(X union Y union Z) = f(Y union Z)
Anyways, the reason I was thinking about this, is that for "functions" with this property, there's going to be a straightforward O(n) algorithm for an associated maximization problem.
For example, "sum" has this property, which gives the O(n) maximum subarray sum algorithm.
 
alright, then we're definitely in CS territory and not maths territory :P
 
ngn
@EriktheOutgolfer "s.t." = "such that"?
 
yes, maths doesn't really have a better notation for that :(
(well, it does, but it's not representable with pure ASCII :P)
also, that (...) should've been wrapped in {}
 
ngn
sometimes ":" is used as "such that"
 
yeah that can be very confusing
 
ngn
6:19 PM
is "\" set difference? i.e. "without"
 
yes, although - is often used, but the latter isn't really encouraged (cue how they use it in our high school system, yuck)
 
ngn
so, S \ (x s.t. x in S) is like S without S's own elements?
an empty set
 
nope, it represents S with one of its elements removed, especially if bracketed correctly :P yeah, I'm using unusual notation there
that's why I avoided {x in S : x}
 
ngn
i see
 
and yeah, if I hadn't mistakenly put (), using : instead of s.t. would've been confusing like hell
 
 
1 hour later…
7:49 PM
I have a new way to fairly measure code-golf submissions from different languages
1. The challenge must provide test cases, the more varied the merrier.
2. The score of each answer is Mutate(Program) * ProgramLengthInBytes.
Mutate(Program) is defined as following:
MutationCoverage = 0
Repeat 100,000 times with non-deterministic seed:
   MutatedProgram = Program
   Random index P = random integer between 0 and the length of the program minus one
   Flip a coin, if tails:
      B = random number from 0 to 255
      In MutatedProgram, Insert a byte B after random index P
   Else:
      In MutatedProgram, Delete the byte at random index P
   Run the mutated program against the test suite
   If the mutated program fails the test suite OR the mutated program has a compile error or a runtime error in any test:
This gives languages and submissions that are naturally less dense per byte an advantage. It rewards conciseness.
 
I dunno, I don't think that rewards more-verbose languages. If a program is fully golfed, then there are no characters that can be safely deleted and the only times that inserting a random byte doesn't hurt is if it makes a variable name one character longer.
 
@noɥʇʎԀʎzɐɹƆ I'd be interested to see langs (which don't just ignore specific bytes in the code) for which Mutate isn't always >0.99
and it shouldn't be too hard to make a lang that always gets a score of 0
 
Haskell: main=print[1..]
delete p, and you get a compile error, delete r, same thing, delete i, same thing ...
@El'endiaStarman I don't see what you're saying.
 
@noɥʇʎԀʎzɐɹƆ so Mutate("main=print[1..]") == 1, which is >0.99
my point is, Mutate(prog) is pretty much always gonna be 1 leading to the worst score, except when it's specifically abused, when it's gonna be 0, being unbeatable
 
8:06 PM
I see what you're saying, I think I defined Mutate incorrectly
hmmm, what if it was "If the mutated program has a compile error or runtime error:" instead?
 
@noɥʇʎԀʎzɐɹƆ abusable by making language have no errors
 
many golfing languages lack runtime errors
 
"If it runs without errors:" ?
no errors at all => 100%
 
Let me clarify: many golfing languages lack any erroring mechanism whatsoever.
 
errors if mutated => <100%, so more benefit to languages like Haskell and Python which have stirct syntax
@JohnDvorak yes, this is supposed to discourage the use of golfing languages simply because they're physically smaller
 
8:12 PM
in GolfScript, any undefined identifier is simply a noop
in most languages, adding whitespace is often a noop
 
@noɥʇʎԀʎzɐɹƆ ok, abusable by making all programs be required to have an even amount of bytes, making all insertions/removals error
 
case example: base64 brainfuck
or base64 anything
 
+1 byte is a small cost to pay for a score of 0 at the end
 
or heck, even a .com file has a fixed size of 256 bytes, not less, not more
Back in the olden DOS days, if you wanted to have a bootable program longer than 256 bytes, you had to read it from the floppy drive yourself. And I do believe that reading from the floppy drive was kind of a pain.
 
tl;dr measuring language conciseness is very hard if not just impossible
 
8:22 PM
RadiationScore(x):
Counter = 1
For each byte:
   num = 0
   modify this byte, over 0..255 that lead to an error:
      add 1 to num.
   (num is at least one, because one of the modifications is the same byte)
   Counter *= num
Return Counter
*Do not lead to an error
Programming language like Jelly with very few errors get low radiation scores
Strict langs like Python get high radiation scores
 
Bubblegum gets a perfect score thanks to its CRC32 footer
You can trivially harden any language by adding a checksum
 
We want to reward higher radiation scores, so that means making higher radiation scores translate into lower code-golf score:

(2**(ProgramByteCount*8))/RadiationScore * ProgramByteCount
 
yeech
 
@JohnDvorak Hmm, instead of modifying a single byte, modify 8 random bits
or instead of 8, a random number from [1..programlengthinbits], chosen with a decaying distribution
 
So... any checksum algorithm that catches any 8-bit error?
Shouldn't be hard to design one
lay out bits in a cube grid, add a parity bit for each 1d slice. Not terribly efficient, but detects any error up to 8 bits
pretty sure there are far better algorithms out there with 8 bit detection guarantees already.
If my intuition is correct, Hamming(15,11) should do just fine - and larger Hamming codes are more efficient anyways.
In other words: lay out bits in a hypercube, bit 0 is omitted, all power-of-two bits are checksums for their respective half-cubes
Should be able to get away with omitting most of the parities even then
The rest of the bits trivially encode a program in (rolls dice) Brainfuck.
 
8:40 PM
@noɥʇʎԀʎzɐɹƆ at that point it wouldn't be much different from just running n random programs and counting how many error
at which point you're facing directly upon the halting problem
 
Ah, yes. The Halting problem. Befunge-likes tend to end up in infinite loops if you start randomizing their sourcecode.
 
@noɥʇʎԀʎzɐɹƆ those powers there mean that the score is pretty much determined just by how many static errors there are in the language
e.g. Javas and APLs RadiationScore would differ by, at the very least, 2^len(x), making APL answers >10 bytes never able to beat Java because of the exponential score increase
 
9:15 PM
@noɥʇʎԀʎzɐɹƆ with the correction above that message, no errors means high radiation scores..
 
9:37 PM
@UnrelatedString APL operators (J adverbs/conjunctions) can take three or four inputs without joining any into a list: a(b F)c and a(b F c)d
 
10:10 PM
Ah, interesting
So it's sort of... currying, almost?
 
@UnrelatedString You could say so. What actually happens is that what's inside the parenthesis creates a derived function which is then applied to the outer arguments.
 
E.g. 'abc'⎕R'def' is a derived function which replaces "abc" with "def". This derived function can then be applied to one argument (the input doc) and returns the new doc, or to two arguments, the input doc and the output destination file.
I'd think Jelly could do something similar, deriving a new link by feeding atoms to a quick, and this derived link then takes additional arguments and finally produces a result.
 
 
1 hour later…
11:31 PM
Hey @totallyhuman! Haven't seen you here in a while!
 
hi
been popping in and out because of school
 
Ah yeah, lots of users have started doing that recently :P
e.g. Xcoder
 

« first day (3157 days earlier)      last day (1671 days later) »