« first day (4241 days earlier)      last day (19 days later) » 

12:46 AM
Man code golf is extremely useful for making math exam study sheets. Instead of having to remember things like "how to tell if an adjacency matrix is symmetric" you can simply remember something like ¨=∩
uhh what
And instead of having to remember the gcd algorithm for finding modular multiplicative inverse, I only need to remember the deleted 05ab1e answer to the relevant code golf challenge
@att ¨=∩ is Vyxal for "is invariant under transposition?"
instead of having to remember one algorithm I just need to remember a different algorithm
a terse notation to express thoughts I guess
@att 3 bytes is way shorter than having to write the whole definition
This is for a memory aid we're allowed to bring in btw
I feel like that's a bad example though
AT=A isn't exactly much more verbose
12:52 AM
Maybe, but for me at least, writing it in golfing language equivalents is way more helpful
code golfer brain
if it works it works
personally I don't see where the advantage would be but then again the closest I got into golflangs was APL
would be kinda weird if I claimed to understand
Sandbox posts last active a week ago: write the "index by number" sequence, Zip two arrays
I suppose it's because golfing languages are more intuitive to me than mathematics, as golfing languages are what I've spent the last 2 years of my life obsessing over :p
1:49 AM
@user I was thinking respectful tributes :)
2 hours later…
4:00 AM
15 messages moved to Fig
2 hours later…
6:13 AM
@lyxal huh, why'd it get deleted?
6:43 AM
I'm making a language in TypeScript at the moment and @emanresuA seems adamant that I'd be better off to not bother with floats and only have BigInts for arbitrary-precision integers. Before I go and do this, what are other people's thoughts on this?
you should almost certainly also have floats but please do not use floats for integers
especially when ludicrously large integers can be legitimately useful for golf even outside of large inputs
6:55 AM
Thing is, JS floats and bigints go terribly together
JS is just terrible for anything involving numbers
which is everything
@Neil time restrictions
The challenge required all test cases under 60s
Should you be remembering an algorithm that's that slow?
@emanresuA Yeah, I'm on the fence
@emanresuA slow for really big inputs
O(n) kinda slow
7:11 AM
CMC: Draw a "flag" at half mast. Given inputs n, h and w, assume all are at least 3, draw n rows of |, then a box with size h by w using +, - and |, then another n rows of |. Box size can include or exclude the edges.
Charcoal, 12 bytes
TODO: Add boxes to vyxal's canvas
@Neil Python 3, 76 bytes: lambda n,h,w:(f'|{"":{w}}|\n'*h).join(['+'+w*'-'+'+\n']*2).join(['|\n'*n]*2) -- Try it online!
1 hour later…
8:55 AM
A: Sandbox for Proposed Challenges

mousetailRe-Name all identifiers to a single letter code-golf Imagine a very simple language. It has just 2 syntax features: () indicates a block scope, and any word consisting only of lower case ASCII letters indicates a identifier. There are no keywords. In this language, the value of identifiers is not...

1 hour later…
10:04 AM
CMC: Easiest way to measure the mass (not weight) of a helium balloon
Do you know the volume?
You can measure the volume if you like, but that counts against your "ease score"
A: Sandbox for Proposed Challenges

Bjopfind overlap between 2 grids You have 2 grids with numbers inside, and you want to find the overlapping parts. For example The firdst grid 1 2 3 4 1 2 3 4 1 2 3 4 The second grid 2 3 4 1 2 3 4 2 9 8 6 4 This part is the overlapping part: 2 3 4 2 3 4 And when you combine, you sould get this: 1...

10:41 AM
@pxeger turn you weighing scale upside-down and reset it to zero and put the helium balloon below it
oh wait will that work lol
That doesn't include the mass of the rubber in the balloon
And in fact that just measures the buoyancy force; I don't know enough about physics to say if that's easily related to mass
buoyancy is related to weight ...
@PyGamer0 It's just the weight of the air you are displacing right?
10:48 AM
Oh I should add this rule: you may not pop or deflate the balloon
@pxeger its the bouyant force, just use F=ma /s
Is the balloon filled with 100% pure helium?
I think that would make it too easy
Let's say it's mostly helium but also some unknown small proportion of air
@pxeger That can be measured from the packet
The balloon is already inflated, you can't pop it, and there aren't any more balloons in the packet
10:52 AM
Ok, then I'd do buoyancy yes. Weigh the balloon, subtract the density of air times the volume and you got the mass
@pxeger You have the packet though, from which you know what type of balloon it is
There's too much batch-to-batch variance to rely on information about any other balloon
Stop side-stepping my problem!
@mousetail How do you measure the volume?
You can't really use the obvious method of water displacement because water sinks and helium floats
And? You can still shove it in
Why can't you hold it underwater?
or locally invert gravity
10:54 AM
I guess weight it underwater too since the pressue would decrease the volume
I guess you could tie it to a heavy thing at the bottom of a tank of water, and then subtract the volume of the heavy thing and string
@mousetail That would also make it easier because the density of water is easier to find out accurately than air
My method: Get pxeger to do it.
My method: ignore the problem
My method: Guess 7 since it's always the correct answre
My other method: Get a volume integral wrong and come up with a negative mass. Then, open wormholes.
11:40 AM
There is some quantum theory bases for negative mass. If you get negative volume though you are fucked
11:59 AM
I'd like some feedback for this question codegolf.meta.stackexchange.com/a/25107/110681 I wrote in sandbox
12:17 PM
It is me, Ginger
@Ginger I disagree
today, I am going to finally write up documentation for makina!
12:39 PM
@Ginger one could say you're makina effort to document it!
12:51 PM
anyone here remember basic probability? For a discrete random variable why does E((X - E(X))^2) = E(X^2) - E(X)^2 ?
whats E(x)
Expected value
@pxeger you weigh it inside a really big helium balloon
That could work
Would it even need to be "really" big?
it just needs to fit the scales and balloon in
1:01 PM
Just the baloon is enough right? You can tie it to the scales by a string
@graffe Expand, then apply linearity. Then, use the fact that E(E(X)^2) = E(X)^2 and E(XE(X)) = E(X)^2. I think, it's been a while since I saw the derivation
can u assume spherical balloon in vacuum :P
@cairdcoinheringaahing ah...E(XE(X)) = E(X)^2 Let me try this
@Wezl' No!
@Wezl' Would be super easy in a vaccuum
1:02 PM
@graffe Yeah, as E(X) is a constant
@graffe E(X) is effectively a constant, so E(XE(X)) = E(Xk) = kE(X) = E(X)E(X)
ok got it. Thanks so much all
@Wezl' if it's full of concrete :)
1:55 PM
Q: Solve a jigsaw puzzle jigsaw puzzle consists of (usually rectangular-ish) pieces. On each side of a piece, there is either an edge or a connector (a term I made up). A connector is either a tab sticking out (outie) or a slot facing inwards (innie). Two pieces can be joined if the outie tab can fit into the innie slo...

2:07 PM
Q: Why does String creation using `newInstance()` method behave different when using `var` compared to using explicit type `String`?

hansztI am learning about reflection in Java. By accident, I discovered the following, for me unexpected behavior. Both test as written below succeed. class NewInstanceUsingReflection { @Test void testClassNewInstance() throws NoSuchMethodException, InvocationTargetException, Insta...

Somewhat interesting bug
1 hour later…
3:21 PM
@Neil Pip Classic -l, 32 bytes: YP'|RLaP['-s]XcWR^"+|"@:^1XbWR0y (flag size does not include the border)
I'm sure that can be golfed
Regenerate, 46 bytes (after replacing \n with literal newlines): ((\|\n){$~1})(\+-{$~3}\+\n)(\| {$~3}$2){$~2}$3$1
3:52 PM
CMQ/LDQ: a truth machine can be done in two tokens with something like a dowhile print, assuming implicit input. what are some ways to have a 1 token truth machine without having it just as a "builtin"? my ideas so far are Dowhile where theres implicit output whenever the pointer reaches the end of the program (which wouldnt be useless as itd facilitate other infinite print loops), and Printtilfalsy, which i guess is a little sillier but the same idea maybe?
basically im just wondering if there are any other ways to approach this :-)
I'm back
welcome back mathcat, where ya been at?
somewhere meeting relatives
I'm telling you, meeting relatives is the worst
(at least for me)
cant be worse than meeting absolutes
its worse
At best it went like:
Me: Hi
My brain: awkward awkward awkward awkward
Me: Die brain!
surprise, my brain didn't die
4:00 PM
unloyal brain. doesnt it know the captain goes down with the ship
@mathcat It's not just you. i'm sure most people hate their relatives
@thejonymyster I know right!
I see nobody stole my rep
Ha take that radvylf
I don't want your safe full of limbs
4:15 PM
@thejonymyster This answer has an interesting approach :O
@Neil Knight 2.0, 96 bytes: ;=i+1=nP;=hP;=l@;=wP;W=i-iT=l+l,'|';O=s^l'\n';O=a++'+'*'-'=k+~2w'+';W<+=i+iT1hO++'|'*' 'k'|';OaOs, where \n is replaced by the literal newline
@pxeger I suppose it would work if you kept the outer balloon inflated while weighing the inner balloon
Yeah that's what I was assuming
4:35 PM
challenge idea: two languages, in language A, perform some task (), in language B, preform the same task pristinely(maybe ?), score being some function relating to the ratio of sizes of these programs, goal being to maximize
so find a task that Lang A is really good at but Lang B is really bad at
issues i can think of: "longer is better" challenges are hard, easy to pick a golfing lang and a tarpit also
oh wait i know
you have to do one the other way as well, short in Lang B, long in Lang A
@DLosc Thank you.
to "prove" that both languages operate at roughly the same level or something :P
It's been so hot here for the past few weeks I've been barely able to think. (I don't have air conditioning.)
@thejonymyster What if they're the same language, except for one thing being added (or removed)?
like a flag?
or a version difference? i mean sure yeah thatd be different enough
i guess its still an issue of "what if i can write a way longer pristine program in this same language anyway" idk
@thejonymyster There's a particular problem that's 771 bytes in ECMAScript regex, but 128 bytes in ECMAScript + (?*)
4:44 PM
right thatd be fine, my other idea was that youd have to also write a program that was short in lang b but long in lang a
brainstorming still idk
@thejonymyster It's a neat idea, but what would prevent people from just picking lang A to be something that everything is really long in?
having to do it both ways
How about, something like, requiring that for some other function, the ratio is much closer to 1?
or that, yes
task 1: short in A, long in B
task 2: short in B, long in A
the ratio being close to 1 is interesting but much less restrictive
well, that would rule out lang B being the same as lang A but with one function added
4:55 PM
tragically u_u or fortunately? neutrally
@thejonymyster interesting
im worried it wouldnt even rule out just using Lang A twice though, since what if you can just write a pristine program thats longer than the regular program :?
it'd still allow letting lang A and lang B both be based on lang C, but with a different function removed in each
@thejonymyster well it'd have to be golfed in good faith.
which could be difficult to judge of course.
yeah long program restrictions is hard still
sorry im like language words bad right now LOL
language processing fail :'-)
@thejonymyster What do you mean by "pristine"?
5:11 PM
umm a pristine program is like, if any contiguous substring of the program is removed it must error, though i think thats not what i want
idea being that you cant just pad out your program for length
i think "irreducible" is what im looking for, but i know that has its own issues since its possible to make arbitrarily long irreducible programs in some languages kind of?
@user Don't be so sure. Anecdotally, I and several people I know are counterexamples. I certainly have some relatives I'm guarded around, but I don't hate them. And some of my relatives are on my top 5 favorite people in the world list.
Anyone know what some good resources are for an introduction to code golf? besides just a link to cgcc :P
(they have some coding knowledge like scratch and python, and they seem interested in other types of competitive programming including speed coding)
@Wezl' Honestly, just send them here :P
Yeah I mean, a large, active, and friendly community where you can also see other people's answers, and get an introduction to a variety of practical languages, esolangs, and golflangs in a golfing context isn't that bad of an introduction to code golf IMO
Or, if they're someone you're friends with, I'd suggest finding challenges and doing those together, then looking at the "best" posted answer in that language
5:22 PM
also mostly I want them to learn about it, because I'm not sure they're actually interested in participating rather than just appreciating that it exists
oh that sounds fun
@Wezl' I vaguely remember reading a blog post years ago that went through a step-by-step process of golfing 99 Bottles of Beer (in Python maybe? or Perl? or both?). No idea how to find it now, though. Google is mostly coming up with solutions on code golf sites.
also I showed them codingame as an example of something timed
6:21 PM
@DLosc note to self: don’t assume everyone is as unfriendly as you :p
lol I may be a bit biased too
Tbh i don’t hate most of my relatives, just the ones who are like “it’s your favorite uncle! I held you for two seconds when you were a newborn. What?! You don’t remember me?” and the ones who try to pry any information out of you they can
@mathcat The last relative I met was my cousin who had a very big ego
@user so true
Hate is a strong word there too
I wouldn’t punch them but i wouldn’t be too sad if someone else did
6:25 PM
The thing is, I don't hate my relatives, I just don't like meeting them.
Someone please tell me there's a difference
Most of mine live on the other side of the world so I don't see them much
There is
I bet they hate family events too
@Steffan same
@Steffan me too, but my parents make me call them all the time
My relatives aren't bad, but I don't like when they give me unsolicited advice for what to do when my life ends up being exactly like theirs and I face the same problems etc
6:27 PM
It’s so embarrassing being a grown adult and calling your grandma on your birthday because your mom told you to
@Wezl' lmao yeah
They came over here where I live once, but they don't like to so they never did again
@user Well yeah they call like every week lol
@Steffan hehe, and i thought mine lived far away...
“What’s that? You have a hard time running a mile? Drink an ounce of my homemade remedy everyday and you’ll be a muscleman in no time “
"little wezl when you start liking the opposite sex youll care more about [something]"
Okay, it's not quite the other side of the world, but across the ocean
6:29 PM
@Wezl' oof
User it’s no wonder you don’t have a girlfriend yet if you’re so thin (I’m not). It’s time to start thinking about that seriously now (this in high school)
I wish you could choose your relatives
My relatives are basically all non-vegetarians, so I had to endure each one of them saying "A chicken a day keeps the boogeyman away" and that sort of stuff.
Wait what
not exactly but yes
Chicken? Bogeyman?
heheheh veg gang
6:33 PM
id be vegan if it weren’t for ice cream and bacon
And apparently because the bogeyman gets vegetarians
one summer I made exceptions so I didn't have to talk about it to those same relatives
That sucks
@user that's just because vegetarians are immune to hazards made of flesh and blood, so the bogeyman is just proportionally more dangerous :P
at least in the case where the bogeyman is some ethereal ghost thing
or is made of vegetables :P
@Wezl' maybe it’s iron man :p
6:39 PM
That's a vegetarian boogeyman?
this is what ai is actually for :P
I guess he is what he eats
artificial imagination
#1 is the fastest. It chases you down at incredible speeds, pinning you down between its various legs. It eats you quickly if you are a fellow vegetarian.
#2 is a more careful killer. It hides in enclosed spaces near where humans sleep. They wake up in its presence, but cannot move.
#3 uses his victims as test subjects for horrific experiments. He doesn't really like how vegetarians taste, but they're better than microwave dinners.
#4 hides in dark, abandoned rooms. Its disfigured body is optimized for attics and old hospitals. It idly snacks on vegetarian spiders while it waits for prey. I
6:45 PM
vegetarian spiders in dark abandoned rooms eat mold ig ?

 Off-Topic TNB

Room for discussions off-topic to CGCC (on-topic discussions s...
I mean we're not interrupting anything but that makes sense for a possibility when some other (on-topic) conversation starts
Plus I doubt very many of us will be brave enough to continue talking. The vegetarian boogeyman have probably had time to approach us.
I don't see anyt-
I tried asking craiyon.com about the veg boogeyman and it was really spooky lol
Idk what mathcat used
6:55 PM
> It eats you quickly if you are a fellow vegetarian.
Is there a name for someone who eats meat and vegetables, but only meat of vegetarians?
Yeah, those are vegetarians. If you don't eat vegetarians, you're a vegan.
7:14 PM
@Steffan I used deepai
A second-order vegetarian?
@RadvylfPrograms But by that, everyone is a vegetarian, since animals are vegetarians by that
Oh. That's actually a pretty good point. Frick.
Okay the recursion limit for vegetarianism is 2.
kay just most now
@RadvylfPrograms I don't like this solution. We could just differentiate between different orders of vegetarians instead
7:21 PM
but is it also invalid if it eats a plant that eats an animal that eats an animal?
*That Vegan Teacher joins the chat*
Wait this is TNB
Why are we having this conversation here
T v T is fake smile, real crying emoticon :P
@Wezl' Plants that eat animals are considered vegetarian animals which do not eat vegetarians
This makes so little sense it's practically a branch of science now :P
7:23 PM
It's called ecology silly
@user this discussion is important to our social emotional health which impacts our ability as code golfers :P
@RadvylfPrograms mixed with a bit of ... what do you call the branch of science that the bogeyman's in :?
@user code golf challenge: given a list of people and their dietary choices (and the dietary choices of their dietary choices) determine what order vegetarian they are
Heh, might even be a duplicate
1 hour later…
8:56 PM
@mathcat Oh yeah, that's definitely two different things.
@Wezl' So relatable. They usually mean well, but my life != your life.
@user So that's what I'm doing wrong! =P
9:26 PM
@user i can barely stand interacting with my mother to begin with, her half-siblings are right out :P
9:38 PM
Tbh I don't really have all that many relatives that I actually know anything about. All of them on my mom's side are in California and we have zero contact (aside from them sending us a single package of store bought salami each year. no clue.). On my dad's side they all live in East Texas and are apparently pretty racist.
I have no clue what's up with the salami. And for some reason my parents still act like it's something special and rare, so they'll never let us eat any, and every year without fail more than half of it goes moldy
Even though I've literally found the same brand at Walmart
> pretty racist East Texans
I mean, I don't want to stereotype :P
@RadvylfPrograms i n t e r e s t i n g tradition
10:07 PM
in Fig, 1 min ago, by Steffan
yeah, I know, you write a piece of code, it works perfectly as far as you can tell, and every single person who tries it except you finds 100s of bugs in it
Happens a ton with golfing languages
Every single operator has its own potential to harbor a dozen edge cases
happens with most any code :P
Well yeah but, especially with golfing languages
Debugging each one of Ash's operators took twice as long as actually writing them, and I still ran into weird edge cases all. the. time.
@RadvylfPrograms Jelly isn't susceptible to this problem *hides literally half the quicks*
I've never used unit tests before, but once I start on my next golfing language, I'm going to learn
I'm also going to use Rust, which'll help
10:09 PM
¦, , ', ƙ can all die
@RadvylfPrograms how
Because that's like, Rust's whole thing
Being hard to write errorful code in :p
i thought it was memory safety
that was rusts specialty
That's part of it, but the safety goes way beyond memory safety
The way it's designed rules out whole classes of errors, and its warnings are great
i dont see how a design can rule out bugs
maybe except static typing
10:13 PM
Aside from static typing, you've got Options instead of null, Rust's enums in general, mut making you be careful about what you mutate, match being able to alert you to missing cases, and possibly most importantly, Result and being forced to unwrap or otherwise handle things that can error
You also look at your code a lot more in the hours it takes to get it to compile lol
10:24 PM
@RadvylfPrograms Vyxal isn't susceptible to this because we did all of that already
Also another reason golfing languages tend to harbor bugs is that often you're not only tolerating edge cases, but intentionally exploiting them as ways to save bytes, so you're adding extra functionality to what's already the most bug-prone part of most things
@RadvylfPrograms If I can't multiply characters by numbers to create types that shouldn't exist, what's the point of using that language?
@cairdcoinheringaahing Funny you should mention that, I was just thinking about how to handle character & number arithmetic in a golflang...
@DLosc addition and subtraction on code points don't seem like a bad idea, but that raises the question of how you could have multiplication and even division that's both sensible and useful
That seems really niche
10:32 PM
@cairdcoinheringaahing wait what are the weird edge cases on
Having characters at all in a golflang seems like a really bad idea honestly IMO
@UnrelatedString That it doesn't technically group the repeated atoms together
Strings as their own data type just make more sense for overloading purposes
Like +H⁺ != +HH$
i feel like strings should be treated identical to lists in as many circumstances as possible
and then you can have dedicated string overloads only where the alternative would be using numeric builtins on characters
10:35 PM
@UnrelatedString Yeah. I also like the idea of being able to multiply a character by 0 or 1 and get a falsey value or the same character, respectively.
@DLosc oh yeah that's super useful
@cairdcoinheringaahing i feel like that's just a problem with the description of "duplicates the previous link" kind of suggesting that it's some kind of alias
@UnrelatedString There are plenty of string operations more useful than array operations on strings though
It feels too absolute to say "only overload array operations when they are literally meaningless on a string"
@UnrelatedString Yeah, either behaviour would be fine
It's just weird when combined with link combinators
i can't think of many cases but i feel like the more general one we have is as useful as not
@cairdcoinheringaahing :P
10:38 PM
That (almost) works in my fork :P
@RadvylfPrograms almost any string operation can be a general array operation; string overloads are just a way to make it easier to use some of them
I've overloaded and (increment/decrement) to work with characters, but haven't for general addition
10:39 PM
So ”a‘ works, but 1+”a doesn't :P

« first day (4241 days earlier)      last day (19 days later) »