« first day (4449 days earlier)      last day (410 days later) » 

 
1 hour later…
4:43 AM
The smallest version, at 194 bytes, is now the fastest (the 🐌 version is obsolete)! .NET regex for matching primes in decimal up to a specified maximum
 
0
A: Sandbox for Proposed Challenges

c--Longest sorted subsequence code-golf subsequence Inspired by Lossy Sorting (Implement Dropsort). Similar to Dropsort, you'll implement lossy sorting. This challenge however, requires you to find the longest sorted subsequence. Find a sorted sequence \$S\$ of maximal length, such that all the elem...

 
0
Q: Calculate the Result of Straight Line of Cells in Conway's Game of Life

Alex-Github-ProgrammerConway's Game of Life is a cellular automaton that is played on a 2D square grid. Each square (or "cell") on the grid can be either alive or dead, and they evolve according to the following rules: Any live cell with fewer than two live neighbours dies (referred to as underpopulation). Any live c...

 
 
3 hours later…
7:47 AM
At 192 bytes, it's now exactly 42% of the size of the POSIX ERE regex, rounded to the nearest byte. I don't think it can be golfed any further.
 
8:48 AM
exactly...rounded
although, the explanation is slightly incorrect because 124578 could all have been captured in that capture group
 
9:28 AM
@Neil Thanks, fixed.
@Neil yes, 191.56 rounded to the nearest byte is exactly 192.
 
0
A: "Hello, World!"

PlaceReporter99Hippopotomonstrosesquipidelian 6610 Bytes hippopotomonstrosesquipidelian pneumonoultramicroscopicsilicovolcanoconiosis pneumonoultramicroscopicsilicovolcanoconiosis pneumonoultramicroscopicsilicovolcanoconiosis hippopotomonstrosesquipidelian hippopotomonstrosesquipidelian hippopotomonstrosesquipi...

 
Also, "exact" in the sense that it's as close to 42% as any integer number of bytes can be as a ratio to 456.
 
10:18 AM
0
Q: Enumeration of free polyominoes

math scatA polyomino with \$n\$ cells is a shape consisting of \$n\$ equal squares connected edge to edge. No free polyomino is the rotation, translation or reflection (or a combination of these transformations, i.e. an isometry) of another (they're equal). The sequence of free polyominoes with \$n\$ cell...

 
 
2 hours later…
12:43 PM
0
Q: Cosine similarity of two vectors

emirpsThe cosine similarity of two vectors \$A\$ and \$B\$ is defined using their dot product and magnitude as: \$\frac{A\cdot B}{\|A\|\|B\|}\$ Or in other terms \$\frac{\sum_{i=1}^nA_iB_i}{\sqrt{\sum_{i=1}^nA_i^2}\sqrt{\sum_{i=1}^nB_i^2}}\$ Challenge Given two vectors (can be taken as lists) calculate...

 
1:17 PM
I had a pretty short TI-BASIC answer and then they added right-padding of unequal lengths
 
imagine not using a language that autofills 0s
 
Apparently TI-BASIC also doesn't let you use an assignment as the operand to a comparison
(you can use it in and and or, but not =, >, etc)
Oh, apparently you can assign to dim(ʟTHING).
 
1:41 PM
bruh that padding thing makes it so annoying for desmos as well
 
true, was trying to code it in desmos too
 
I finally got it working, but with padding is more than twice as long as without
> TI-BASIC (TI-84), 43 bytes
TI-BASIC (TI-84), no padding, 19 bytes
 
i swear the desmos answer is gonna be twice as long as well, im gonna have to do some weird join shenanigans
 
The ability to assign to dim is a lifesaver in TI-BASIC, but max(dim(ʟA),dim(ʟB→dim(ʟA is still so many bytes
 
was wondering if i have to handle both inputs being empty lists or not...
ah we dont, cool
 
1:51 PM
I have an archived prgmQDRTCMTD that I remember using in high school. You'd give it the coefficients and it'd tell you the most efficient way to solve it (is it factorable, should you complete the square, etc). I don't remember what the code looks like though
 
holy fuck i finally got it working, i think
now time to put in all the test cases and pray lol
 
@Bbrk24 It's 37 lines, which doesn't sound like a lot, but a) the TI-84 can only display 9 lines at a time, and b) some of the lines of code are so long they wrap and take up 3 lines on the screen
17 of them are a single token (mostly Then and End after If)
 
:\ answer with padding, 123 bytes, answer without padding, 42 bytes
 
2:07 PM
Does the first : in a TI-BASIC program count towards the byte count? I haven't counted it in my answers because it's impossible to get rid of it, so if it counts then the empty program is 1 byte, not 0
And if that counts, there's 8 more bytes of a header of some sort (an empty program with a 1-letter name takes up 10 bytes in memory)
 
there should be some meta consensus out there that deals with this right, maybe search on meta to see if theres anything about this
 
The meta post only mentions token count and not that
codegolf.meta.stackexchange.com/questions/1541/… Should I leave a comment on the answer here, or post a separate question?
 
wait a fucking minute my no padding answer is giving the same answers as my padding answer
will clipping to the shorter length result in the same calculations as padding 0's to the longer length?
the reason why im thinking this is that the extra zeroes might not be contributing anything to the final result...
 
If you do so for the dot product yes, but not if you do so for the magnitude
 
the zeroes dont contribute anything to the individual sums tho...
u r taking the sum of the list squared
but the zeroes dont change the sum!
oh wait
 
2:20 PM
Yeah but if you truncate the longer list before taking the magnitude
 
im being dumb nvm
that must mean im doing the padding wrong ugh
wait no im doing the padding correct im literally checking rn
maybe the magnitudes are so close that it didnt look like it changed but it actually did change??
 
@Bbrk24 I would like an answer to this so I know where to post my scoring question :P
@AidenChow Make the last element of the longer list the largest one, then it should be noticeable
 
oh wait i just realized that becuz im multiplying the list by itself, its not actually clipping to the true shortest list
 
I'm leaning towards "make a new meta question" and if it's closed so be it
 
cuz A * B would clip to the shortest list, but B * B would still clip to the shortest list but that would just be B
wait i think my no padding answer actually works
 
2:28 PM
Ah yeah, TI-BASIC doesn't let you implicitly truncate like that, it errors if you multiply lists with different lengths
 
can someone check my logic here, would total(A*B)/(total(A*A) * total(B*B))^{.5} if multiplication clips to the shorter length
 
Do you need the curly braces?
 
yes
 
but yeah that should work
 
(keep in mind this is ungolfed)
(for readability)
@Bbrk24 alr cool!
@mathscat turns out padding wasnt even needed lmfao
 
2:34 PM
wonderful
 
by some miracle the math all checks out
@Bbrk24 just if u were curious there is a sqrt operator in desmos, but becuz desmos is using latex under the hood, u have to do \sqrt{...} which comes out to the same length as (...)^{.5}
the curly braces are needed cuz latex lol
 
Can you omit the backslash? I know you can say cosx instead of \cos x for example
 
try pasting sqrt{100} vs \sqrt{100} into desmos and see if it works
 
Huh, I see
for some reason I find the result of \sqrt100 amusing
 
0
Q: Does the initial `:` in a TI-BASIC program count?

Bbrk24According to this meta post, TI-BASIC is scored in tokens rather than characters, to more accurately reflect the byte count in-memory. On my graphing calculator (TI-84 Plus C Silver Edition), the memory menu displays a slightly larger number than this would suggest. This number counts the length ...

 
2:49 PM
@Bbrk24 lolol if u dont put the curly braces the \sqrt would only take in the next char, that goes for most other latex operators as well
it does give pretty funny results tho
and really annoying bugs if not caught right off the bat
but ive done desmos golfing for quite a while now, i dont really run into these curly brace issues anymore, at least not as much as when i started
 
I have a desmos answer to codegolf.stackexchange.com/questions/246872/… saved but I don't think it's valid because it draws the actual slope field instead of ASCII art
My comment asking whether it would be allowed has two upvotes and no replies
it also strains desmos' rendering engine a bit
 
3:29 PM
@Bbrk24 lolol wait till u have a 10000 element list to render, desmos just freezes
usually u put those lists into a collapsed folder so that desmos doesnt try to render it
 
@AidenChow The thing that broke the renderer is shortening \operatorname{mod} and \operatorname{sort} to just \mod and \sort. Still computes just fine, but LaTeX dies
 
@Bbrk24 oh i thought u were literally doing [1,2,3,4,...] (not those numbers but u get the point) for a 441 length list lol
@Bbrk24 u can shorten those to just mod and sort
 
No, then it complains about undeclared variables m, o, s, …
I have a function d which is probably why that doesn’t work
 
im curious as to what u r pasting in as that shouldnt matter
 
Though I could abbreviate k=\sort(h) to k=h.sort
 
3:38 PM
do u have a piecewise within what u r pasting in?
 
yes
 
and u removed the \left and \right from the bracket right?
 
see x= and y= on the last two lines
@AidenChow no, then it errors
 
that is 99.99% where the issue is
oh
what are even pasting in??
 
I’m not at my computer now but if you remind me in like two hours I can show you
 
3:40 PM
becuz ive encountered that error before when removing \left and \right from the brackets
i actually have an entire tip post on how to avoid that issue while still removing \left and \right
 
I can remove it from parens and square brackets but not curly braces or absolute value bars
 
ye for absolute value just use abs() isntead
for curly braces i have a tip somewhere
 
Okay but x=\n… won’t work
 
@Bbrk24 do \nx=...
 
huh, so like a blank line between y= and x= in my screenshot above?
 
3:49 PM
@Bbrk24 no, u will literally copy-paste the entire x expression with the leading newline (dont put in the newline separate from the x expression)
it will render invisible but it will still work
 
I’m pasting in all five lines at once
 
@Bbrk24 yea dont do that, due to how desmos deals with single line pastes vs multi line pastes, u usually want to paste in one line at a time
(dont ask me what those differences are, i dont really understand it myself)
 
Like I said, I’m not at my computer right now so I can’t experiment with this. I’ll come back to this later
 
for example i think wackscope variables just dont work if u paste in multiple lines at a time
@Bbrk24 ye i discovered all of this mainly through experimentation, tho i did have some help from fireflame241, who is just next level at desmos
he literally knows like every single detail in desmos source code
and can probably explain all of this better than i ever can
 
0
A: Sandbox for Proposed Challenges

polfosol ఠ_ఠFind a Hyperjump! The idea is based on this interactive game. Given a set of eight decimal digits which not necessarily distinct, your task is to find a hyperjump with the specified length. But what is a hyperjump? I ain't got time to click on HOW TO PLAY Ok, you have a set of eight digits where ...

 
4:11 PM
how can i make chatjax work on mobile?
 
4:47 PM
How do you encode subtraction vs negation when representing TI-BASIC code in Unicode? It doesn’t matter for any answer I’ve written, I’m just curious
 
5:38 PM
@Bbrk24 I guess you could use , U+207B "superscript minus"?
 
@Deadcode Yep, that works
@AidenChow I have my code now
% I'm using percent signs for comments, as in LaTeX. All other lines are copied into Desmos verbatim.
% These functions are considered inputs to the program, so I haven't golfed them.
d\left(x,y\right)=\frac{x-y}{x-2y}
p=10
% This is the program itself. Only the last two lines (y and x) are rendered; f(x) is hidden.
h=\sum_{i=[1...(2p+1)^2]}^{[1...(2p+1)^2]}[-p...p][\mod(i-1,2p+1)+1]
% Without the backslash before "mod", Desmos reads it as m*o*d(...) rather than \operatorname{mod}(...).
k=\sort(h)
Replacing \left|...\right| with \abs(...) in the last line does work as intended
If you click on one of the lines that doesn't render properly and hit an arrow key, the whole thing breaks
I've been entering the "inputs" (d(x,y) and p) into Desmos directly, and pasting the five-line "program" (h, k, f(x), y, and x) in in one go
Oh okay, if I paste in all five lines at once then \{...\} works, but if I go one line at a time it doesn't
With these changes I've just learned, and without inputs or comments, my program would be
h=\sum_{i=[1...(2p+1)^2]}^{[1...(2p+1)^2]}[-p...p][\mod(i-1,2p+1)+1]
k=\sort(h)
f(x)=(x-h)d(h,k)
y=\{\sqrt{(x-h)^2+f(x)^2}<.4:k+f(x)\}
x=\{f(h)=f(h):0/0,\abs(y-k)<.4:h\}
I guess I could change the condition in y from \sqrt{(x-h)^2+f(x)^2}<.4 to (x-h)^2+f(x)^2<.16
I can even remove the y= from that line entirely
If you want to see it in Desmos, desmos.com/calculator/q2lekwc97w
 
6:01 PM
0
A: Sandbox for Proposed Challenges

HippopotomonstrosesquipedalianApproximate euler's number to the power of another number using Python Create code to approximate $e^x$ using Python. Your score is determined by the runtime in seconds added to the number of bytes in the programme. Lowest score wins! Remember, this is a fastest-code and code-golf challenge combi...

 
@Bbrk24 dont have time to fully look at it, might come back in a few hours tho
 
Fair, and no hurry since it's still not clear whether I'd even be allowed to post this
 
@Bbrk24 yea, those are considered as fragile expressions and i have them all the time while golfing
 
 
1 hour later…
7:15 PM
$ java --version
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Thank you Java very cool
 
its java -version btw
 
Thank you
$ java -version
java version "1.8.0_361"
Java(TM) SE Runtime Environment (build 1.8.0_361-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.361-b09, mixed mode)

$ javac -version
javac 18.0.1.1

$ echo "$JAVA_HOME"
C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot
Oh yeah, that might cause problems
 
have you aliased it in .bashrc or smth
 
No, but powershell gives me different results
PS C:\Users\bbrk2> java -version
openjdk version "17.0.6" 2023-01-17
OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10)
OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode, sharing)
PS C:\Users\bbrk2> javac -version
javac 17.0.6
PS C:\Users\bbrk2> echo $env:JAVA_HOME
C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot
Maybe this is why Gradle works better in PowerShell than bash
cmd agrees with PowerShell
Ah, found it: I was messing with $PATH in my bash_profile
 
7:38 PM
If I've found an golf that relies on an unverified mathematical conjecture, would it be wrong to post it as new answer instead of an edit to the existing answer? (Especially if the existing answer is already kind of long)
 
I think there are answers out there that do that
 
@Deadcode hrm would posting an answer relying on the collatz conjecture be valid? lol
 
@Sʨɠɠan It's perhaps even more likely than that conjecture to be true. The conjecture is that the Nth prime gap is always less than or equal to N.
Anybody know whether that's actually already proven to be true?
Like, a proven upper bound that's already greater than N?
As far as I can tell, there is no such proof. Only conjectures.
 
8:28 PM
0
A: Sandbox for Proposed Challenges

Creative NameZählen code-golf natural-language number Your task is to write a program that recieves a base 10 number from 0 to 100 and outputs the German name of that number. German number names The words for numbers between 0 and 12 are: 0 -> null 1 -> eins 2 -> zwei 3 -> drei 4 -> vier 5 -> fünf 6 -> sechs 7 -

 
8:39 PM
The answer that relies on this conjecture: Is it a super-prime?, in .NET regex
Oh, the conjecture is even more specific than that. Not only would gap(N)>N need to be true for there to be a counterexample, but N would need to be prime. And this would result in every subsequent prime after the Nth prime being labeled by the regex as super-prime, whether it is or not.
 
9:28 PM
0
Q: Let's go on a hyperjumping trip!

polfosol ఠ_ఠThe idea is based on this interactive game. Given a set of eight decimal digits which are not necessarily distinct, your task is to find a hyperjump trip with the specified length. But what is a hyperjump? I ain't got time to click on HOW TO PLAY Ok, you have a set of eight digits where none is 0...

 
9:50 PM
@Bbrk24 did u paste each line one at a time?
 
I did that at first, but it turns out \{…\} (without \left/\right) only works if I do it all at once
 
@Bbrk24 did u read the tip i put? u have to copy-paste the newline before the expression
 
Yeah, like I said it works fine if I do all five lines in one paste
 
6 hours ago, by Aiden Chow
@Bbrk24 no, u will literally copy-paste the entire x expression with the leading newline (dont put in the newline separate from the x expression)
heres a graph i have which i literally did what i just described: desmos.com/calculator/xybwrcuj4y
(with a few golfs)
 
My question is, why do \sort() and \abs() work, but not sort() and abs()?
or h.sort for that matter
 
9:56 PM
@Bbrk24 if u look at the note on the top of my link u can see that i changed the \sort() to .sort
but \abs has to stay cuz u removed the \left and \right in the piecewise
wait u dont need the top newline in the note, that was left on accident
 
When I changed \sort(h) to h.sort it gave me an error
 
here i golfed it a bit more: desmos.com/calculator/34sg4jismd
@Bbrk24 it doesnt give error???
it literally works, just look in the link
 
Thanks, I’ll look into it more later
@AidenChow the y= on the second-last line shouldn’t be necessary
 
@Bbrk24 well idk it was in ur code, i just golfed it
 
It was, but after I posted it I mentioned that the y= can be removed
 
Is there a shorter way to filter for undefined than f(h)=f(h):0/0?
 
@Bbrk24 i think thats probably the shortest way, lemme think
 

« first day (4449 days earlier)      last day (410 days later) »