« first day (4692 days earlier)      last day (88 days later) » 

12:56 AM
15
Q: Even or odd: three player

F. Hauri  - Give Up GitHubIt's a three players game, play with one hand. At same time, each player show his hand with 0 to 5 fingers extended. If all player show same kind of (even or odd) number, there is no winner. But else, the player showing different kind the two other win. P l a y e r s A B C Win...

 
0
Q: Golf an HQ9+ transpiler

SomebodyThere was a prior question about golfing an HQ9+ compiler that translates HQ9+ code into the language it is written in, but that was closed as a duplicate of the interpreter challenge because converting an interpreter to a compiler is seen as trivial. This question is based on the closed one, but...

 
Sandbox posts last active a week ago: Classify a Coxeter group
 
1:57 AM
CMC All permutations of 1..9 in 3x3 whose determinate is 0
 
there are 2736 of them, some of which are nontrivial like 1 2 3; 6 5 8; 9 4 7
 
2:13 AM
By trivial do you mean it applies for all [n..n+8]?
range(1000,1009).. => 1800 of them
 
Remind me to add a Permutations function to… any of my langauges
 
2:52 AM
> The laptop that was giving me constant GPU crashes earlier in the semester is now physically falling apart
I need to get a new laptop
 
In this economy?
 
if nothing else, I should be able to get a replacement or repair under warranty
 
Will take longer than 10 seconds though
Longer than 60 seconds too
 
3:25 AM
Is it standard that [].slice.call({length:1/0,9007199254740990:2},-1) returns 2?
 
3:38 AM
Maybe a Hash Collision..?
 
9007199254740990 = Number.MAX_SAFE_INTEGER - 1
 
that object violates the constraint of Array.length property (must be an integer less than 2^32), so I'd assume it is an undefined behavior
 
For Chrome, infinity is treated as 9007199254740990 for length
 
interesting
s/990/991
 
^
 
3:45 AM
[].push.call({length:1/0})
9007199254740991
This is common behavior
 
4:01 AM
Array.filter fall into infinite loop

/tmp$time timeout 100 node -e '[].filter.call({length:4e9},_=>1)'

real 0m39.296s
user 0m39.724s
sys 0m0.230s
/tmp$time timeout 100 node -e '[].filter.call({length:5e9},_=>1)'

real 1m40.137s
user 1m48.329s
sys 0m1.662s
 
ChatJax did not appreciate that
 
 
4 hours later…
7:47 AM
0
A: Sandbox for Proposed Challenges

PhilipposNight hike We want to go on a night hike with the youth group, but of course not everyone has their torch, even though we told them we planned to split up. What options are there for group formation if n teens have m torches with them, but each group needs at least one torch? Example: Three teens...

 
8:29 AM
... although there's now a new YouTube bug whereby the inbox notification doesn't work for me...
 
9:02 AM
@Neil My best contribution to this site
 
 
1 hour later…
 
3 hours later…
12:53 PM
0
Q: 80% of respondents agreed…

msh210Sometimes I see a claim like "80% of respondents agreed" and I think "what was your sample size? 5?" because, of course, with a sample size of 5 it's possible to get 80% to agree on something. If the claim is "47% of respondents agreed" then I know it must be a larger sample size.[1] challenge Gi...

 
 
2 hours later…
2:41 PM
@l4m2 Sadly this isn't possible using the replacer feature of JSON.stringify
 
3:01 PM
@cairdcoinheringaahing Seems very hard
Like, very very hard
 
Eh it doesn't seem super hard
You just need to find collisions between two lines (trivial), between lines and circles (not too hard), and between two circles (also not hard). You'd just have to find some way to represent numbers symbolically.
But since the operations with those numbers are so limited the symbolic representation shouldn't be too complicated I don't think
 
The math.se topic mentions that "This includes some points that are between a distance of 10−12 and 10−13"
so to get a solution which provably works for any N, you’ll have to deal with floating point bs
 
Floating point wouldn't work yeah
The representation of the numbers would be the hard part
 
Doing what you suggest is gonna take a large bulk of the answer which I don’t think many people will do
imo it’s one of those challenge types (I think we had a name for it but I can’t find it here) where the challenge describes a certain task, but actually the main difficulty of the challenge is on data representation and not much on the challenge itself
 
Chameleon challenge?
 
3:15 PM
yeah that one
You think it’s about counting intersections, but really it’s about dealing with very precise real number arithmetic
I think it would be fine as a code challenge instead of code golf, though in that case the problem is that answers will all be stuck at the same N
 
 
1 hour later…
4:18 PM
 
5:14 PM
i have now been on this site for 2 years
 
🎉
 
i didn't realize i was active in 2022
 
we both joined around the same time, I guess
since I also got my yearling last month
 
@RydwolfPrograms All intersection points are constructible numbers, which can be represented exactly using only roots and the four basic operations
 
5:23 PM
Yeah, but testing the equality would be annoying
 
It's definitely a difficult challenge, but I don't think it's really a chameleon challenge behind floating point arithmetic
 
Since you'd have to get them in a simplified/canonical representation
 
@Ginger i just remember when i first found TNB you were there replying to messages from like weeks before
 
@noodleman This made me check when I joined, and now I feel old :P
 
@noodleman don't remind me 💀
 
5:34 PM
lol
 
5:50 PM
i think i posted my first answer 2 years ago but only became active around last year
 
6:26 PM
0
Q: Create an O(n^2) sorting algorithm

FlummoxChallenge Create a sorting algorithm in as few bytes as possible. It can be, at worst, O(n^2). No loopholes (such as Stalin Sort). Input An array of numbers. Output You can print an array of numbers in order, or you can print them (ordered) one by one. Rules Program must run in O(n^2) time or be...

 
 
1 hour later…
7:44 PM
@noodleman noice
hey looks like I joined cgcc a bit over 3 years and 5 months ago
 
0
A: Sandbox for Proposed Challenges

FlummoxChallenge Create a sorting algorithm in as few bytes as possible. It can be, at worst, \$ O(n^2) \$. This can be insertion sort, mergesort, quicksort, or any other sorting algorithm with \$O(n^2)\$ time complexity. Input An array of numbers, such as [1,2,3] or [41,17,8]. Output You can print an a...

 
 
3 hours later…
10:24 PM
@Someone congrats on exactly 1k rep on CGCC
 
10:42 PM
@Ginger thank you!
 
 
1 hour later…
11:55 PM
@SandboxPosts Which is more fun, builtin sort disallowed or builtin sort time O(n!)?
 

« first day (4692 days earlier)      last day (88 days later) »