« first day (2662 days earlier)      last day (2476 days later) » 

02:55
0
Q: binary search tree stores

Sagar TrivediSuppose that a binary search tree stores, at each node, u, the height, u.height, of the subtree rooted at u, and the size, u.size of the subtree rooted at u. 1.Show how, if we perform a left rotation at u, then these two quantities can be updated, in constant time, for all nodes affected by the ...

03:11
-1
Q: Minimum Deletions puzzle challenge

Annie ScottThe greatest common divisor (GCD) of a sequence is the greatest positive integer which divides each element of this sequence. You are given a sequence A of positive integers with size N . You are allowed to delete up to N−1 elements from this sequence. (I.e., you may delete any number of element...

03:29
0
A: Sandbox for Proposed Challenges

tshMeta: Is different error confused or ambiguous? Any better way to score? There is something wrong with your input Write a program / function, which take an positive integer as input, and fail in different ways for different inputs. Input An positive integer. You may specify integers your...

@Dennis Yes you're correct, but that's because the challenge is trivial (if the GCD is already 1 then output 0, else output -1), not that it's wrong. That seems to be a big hint already.
Chameleon challenges are still wrong. Just another kind of wrong.
 
1 hour later…
04:41
0
A: Sandbox for Proposed Challenges

l4m2Source in n bytes Write a program A and an integer K that, when given a number n>=K, your program generates a program(in same language) of length n that generates the source program A and don't if some characters are removed. Smallest K for each language win. quine

 
1 hour later…
05:49
> ONLY 10KB (GZIP)
> only
someone please tell the Chartist JS library what ‘only’ means
 
2 hours later…
08:12
@Dennis Dodos is pretty neat. I can't figure out how to make something that maps [5, x] to [x, x, x, x, x]
the closest I can get is this: tio.run/##S8lPyS/@/…
but something like kk it doesn't work because the list gets longer, of course...
08:25
@Lynn dodos is also confusing. the most obvious way seems to be keeping a count element at the start, but the problem is making them all 5
that's what I do, yeah; it maps (a, b, c, d, …) to (|a−1|, b, b, c, d, …)
but since it always returns something “bigger” I can't seem to write a loop with it!
@Lynn ah, "Argument vectors are compared first by their lengths"?
well I think you can do it the other way? so basically generating a list like it's cons pairs? idk
0
A: Sandbox for Proposed Challenges

maxbFridge magnet substitution When writing a message with fridge magnets, you'll often find yourself substituting a 1 for an I. In this challenge, your goal is to find out if a message can be written using the letters of another message. The allowed substitutions are: A = 4 B = 8 E = M = W = 3 G =...

08:34
range is easy but anything other than that isn't :/ (well, it's probably more that i'm not thinking straight rn)
ok @Lynn what do f and g even to >_>
ohh! this is clever actually
@Lynn protip: Dennis' answers are smart, look through them :P
my f maps (a, b, c…) to (b+c+… , a+b+c+…)
and g is the classic subtraction example, mapping (x, y) → (0, y−x)
so that g f maps (a, b, c…) to (0, a)
and then dot g f is head
hmm. if you can figure out a way to dip first (keeping others the same) then it can just be dip first + head dab (then main can be it dup) or something like that maybe?
note: battery is dying so message may not make sense because i'm drying to type things before laptop hibernates
ok, I did it tio.run/…
throw in a dot and I've written multiplication! :>
well, repeat n n times is also a challenge
which i thought you were doing >_>
@Lynn :D i can actually kinda understand it
what am i doing with my life
oh, I might as well submit it there
09:05
it feels a lot like programming in lambda calculus!! so much fun
09:25
This challenge () seems really impossible to do in Dodos.
09:38
-2
Q: how to write a program for run always in linux server

user2790938how to write a program for run always in linux server?(for example Web crawler server) I have two problems for do it. 1.what is best method for run always my program? i use : while(true) { server = new SERVER(); } is this way is true or false? 2.how my server always listen to user input witho...

09:57
@Anush Are you going to allow O(n×n!) solutions?
10:43
@user202729 why
CMC: Given N, return the number of trailing zeros in N!.
⌊÷∘5
I remember this challenge from before, it is essentially the number of multiples of 5's in the range 1..N
@Cowsquack + multiples of 5^2 etc right
10:49
@Cowsquack Nope. Fails on 101.
@Adám does it fail on 25
@ASCII-only Yes. 15! has 6 trailing zeros.
@Adám 15‽
@ASCII-only Nope. 15! indeed has only 3. 25s are the culprits.
10:52
so yeah. it's the total number of prime factors of 5 (idk how to word this better). i wonder how to make it golfy though nvm. once again Jelly saves the day (?)
@Lynn Correct.
oh duh, !ọ⁵ is the slow naive method Try it online!
but that literally computes N! and then counts how many times it's divisible by 10. the other method is the smart one!
@Lynn what else would you mean by naive method though :P
10:57
@Lynn Fails on 1E9.
I wanted to clarify that is "count how many times x is divisible by y" instead of "cast to string and count digits" or something
sure, every Python answer ever that uses range will fail on 1E9
@Lynn well Python 3 answers shouldn't, I think
the thing is, Dennis is using list(range()) here
I forgot that this chatroom is mostly people trying to out-pedant each other
I guess Jelly could be made to like… be lazier, hm
11:04
@Cowsquack APL (Dyalog Unicode), 14 bytes {+/⌊⍵÷5*⍳⌊5⍟⍵} works for reasonably (4E34) large numbers.
ngn
ngn
@Adám might as well hardcode the ⌊5⍟⍵ part as 23 (= ⌈5⍟2*53)
@ngn Ah, true, although then it ceases to theoretically work on any arbitrary number. Also: 23 49.
ngn
ngn
right, good catch
@ASCII-only Yeah, it is a "bug" that Dyalog APL assumes + is commutative. Inserting a fixes it.
ngn
ngn
11:14
is there a name for that function in maths? floor(N/p) + floor(N/p^2) + ...
@ngn It appears there isn't
@ngn Let's call it ngnₚ(N)
the references here are probably your best bet for attempting to find a function name
ngn
ngn
@ASCII-only yeah, I'm familiar with the oeis (I'm not sure it's relevant in this case), I tried wolfram alpha too
@Adám tbh, I hate it when mathematicians name things after people :)
@ngn Right, which is why I named the function no good name.
11:22
@ngn like what happened with Euler :P
In mathematics and physics, there are a large number of topics named in honor of Swiss mathematician Leonhard Euler (1707-1783), who made many important discoveries and innovations. Many of these items named after Euler include their own unique function, equation, formula, identity, number (single or sequence), or other mathematical entity. Many of these entities have been given simple and ambiguous names such as Euler's function, Euler's equation, and Euler's formula. Euler's work touched upon so many fields that he is often the earliest written reference on a given matter. In an effort to avoid...
ngn
ngn
@ASCII-only excellent example :)
it's probably longer than the list of things named after Trump (which is also on Wikipedia) :P
11:34
@ASCII-only oh whoops missed that
@ASCII-only Just try to do it....
@user202729 pls explain
11:50
That's just what I think, not rigorous proof. I think that if there are multiple defintion of a function the latter one will override the former, if there are any other function definitions than main then the program's doubled version would have every function equal to the normal version, and if the program doesn't end with a newline and it's somehow concatenated then the first main defintion is empty, etc.
(not rigorous proof, but...)
@user202729 main can be omitted though?
so theoretically it's possible to take advantage of that to join main body + one of the function definitions together
But it can also be explicitly defined, the latter definition can override the former.
No it can't.
@user202729 ?
Assuem the orignal program is
	main_body
f
	f_body
11:52
then its doubled version would be
	main_body
f
	f_body
	main_body
f
	f_body
and the second defnition of f overrides the former, make it equivalent to the original progrma.
hmm. that's true
but what if you leave out the trailing newline
Either way the latter defintion of f will override the former.
I also thought about
n
	something
mai
but then in the original program the main body is empty, so it' can't output any number with empty input.
why can't main have a body in the original program
if it's like this then main would not have a definition in the doubled program either
@ASCII-only It can, but not if we use concatenation (no newline) to redefine main.
No, in the doubled program it looks like
n
	something
main
	something
mai
@user202729 ah
@user202729 what about n, main, then mai? might that possibly work?
11:58
Regardless, the problem is there must exist a function in the doubled prg that is != from the org program, while the main fn in both program must not be empty.
12:16
@Adám bash, 34 bytes, seq $1|factor|grep -o ' 5\b'|wc -l
12:29
0
Q: TyPe LiKe ThIs AnD iRrItAtE yOuR fRiEnDs

zeveeYour goal is to alternate uppercase and lowercase letters, while ignoring non-alphaneumeric characters. Input => Output abc => aBc OR AbC a c => A c OR a C abc123abc => AbC123aBc OR aBc123AbC Shortest answer wins.

12:46
0
Q: Determine Season

Kevin CruijssenIntroduction: In the northern hemisphere (i.e. Europe, North America, etc.), the seasons are divided like this: - Spring: March, April, May - Summer: June, July, August - Autumn: September, October, November - Winter: December, January, February In the southern hemisphere however (i.e. Australi...

 
2 hours later…
14:18
0
Q: Orthodiagonal steps

Dead PossumIt's a common problem to navigate in 2d matrix. We've seen it many times and will see again. So lets help future us and develope shortest solutions to generate all eight possible steps in 2d matrix. Challenge Your code must output next 8 pairs of -1,0,1 in any order: (0,1) (0,-1) (1,0) (-1,...

0
A: Sandbox for Proposed Challenges

Bojidar MarinovCalculator tape There is an infinite amount of calculators in a row (supporting the four basic operations, +, -, *, and /), all initially displaying "0". They have a peculiar property that any calculator which has a result lower than either the one to its left or right stop accepting any button ...

14:34
0
A: Sandbox for Proposed Challenges

Galen IvanovCreate a solver for the Topspin puzzle The Topspin puzzle consists of 20 round pieces in one long looped track. The pieces can slide along the loop. There is a turntable on one of the sides of the the loop which can rotate the four adjacent pieces laying within it, so that they reverse their ord...

15:19
Dangit, I'm really close to posting my first ever Jelly answer, I just can't seem to find a way to filter out the [0,0] ...
15:37
@AdmBorkBork Do you want help?
@Dennis Sure. It's not shorter than Erik's but I've got every combination and just can't get rid of the 0,0. Here is where I'm at.
I also stumbled across this for the same byte count.
@AdmBorkBork I can do it in additional 3 bytes.
@AdmBorkBork Did you dyadic the atom? Maybe if you code page the helper link you can right argument the nilad.
15
(my knowledge of Jelly)
hehehe
@AdmBorkBork ẸƇ
15:41
Wow... wait what is Ƈ?
New quick?
Comb. New alias of Ðf.
The most common 2-byte quicks and atoms got aliases, thanks to a frequency analysis by Lynn.
Oh, I see.
That makes sense. I was down the right track, was just missing the right way to use Ðf
Thanks a lot!
So Ƈ: comb, : map, : dot, but what does k, Ƭ and stand for?
k is just a gap in the letters
@AdmBorkBork not going to help you go below 6, but eh
15:55
although h goes before k
so it’s not just that
not anymore
ngn
ngn
16:08
@Adám @ASCII-only fyi: it's called "the p-adic valuation of n!"
@EriktheOutgolfer I don't understand how that works. I think I get the backtick, but I don't understand the single quote.
@user202729 cut, 'til, and primZahl. The last one is a bit of a stretch.
@Dennis it's clever though, I like it
@AdmBorkBork it's not just an apostrophe, but a right single quote, i.e. decrement
@AdmBorkBork and are shorthand for +1 and _1.
16:13
Ah
ehehe, I thought of Zahl, or at least Z = the integers too, when I suggested ÆP → Ẓ
0
A: Sandbox for Proposed Challenges

AJFaradayRTanque Tournament! I'd love to do a PCG challenge based on RTanque by awilliams. https://github.com/awilliams/RTanque (only Ruby, sorry) It's a game which is played by writing code to control a tank, sharing a game space with some other tanks. The aim of the game is to be the last tank stand...

16:34
0
A: Sandbox for Proposed Challenges

racer290Treasure Map Drawing Bot You're organizing a treasure hunt for your friends. To conduct things more easily, you want to draw a map of all locations where you hid the precious objects. Input A string consisting of the locations of the objects separated by newlines. Each location is represented ...

16:52
@user202729 hmm.. good question :)
any last minute comments on codegolf.meta.stackexchange.com/a/16391/9207 ?
17:09
@Anush I'm really skeptical that optimizing the output and the code-length will actually make it a sufficiently different challenge
> Answers to the linked question will not be competitive for this question as they make no effort to optimize the value of a permutation.
How much difference does that make? Have you tried writing several answers, one optimizing for code-length, one optimizing the output, and one trying to balance both? I suspect that code-length will be the only one that really matters
@DJMcMayhem if you take the existing answers they have terrible scores
@DJMcMayhem take n = 14
Compared to what though? Have you tried solving your own challenge? What's a better score for 14?
@DJMcMayhem but I am happy to score on one criterion and then do tie breaks on the other
@DJMcMayhem yes I have :)
can I score on the value of the permutations without giving a time limit?
why would you need a time limit
I want to avoid giving a fastest-code question
@EriktheOutgolfer The problem is that someone could write code that takes 10 years and claim the score for if it finished
then everyone has optimal scores
which seems to defeat the point
If they're lying. But it should be pretty obvious to tell from the code
that, and what's the point in lying anyway
@NewMainPosts hahaha, this is hilarious
I wonder if this guy is trolling or very misguided
misguided. Look at his network profile: He has no activity on coding SE sites
ngn
ngn
@Pavel we should assume misguided until proven trolling, I'm tempted to upvote just because -6 seems too harsh
18:18
0
Q: Hand made log problems

user80521Question Find the logarithm of a given number. I/O A number as input along with base n Its logarithm to base n Restrictions No use of built in methods for creating logarithm like Math.log , Math.ceil etc. This is code-golf so shortest code in bytes wins

18:49
The CEO of my company just sent the marketting department an email. Someone asked if it should be forwarded to the rest of the company, CEO says sure, 7 people forward the email to the entire company in the span of 5 minutes.
0
Q: M_ss_ng Lette_s

pfgGiven a list of all the words in english and a string with s_me missi_g lett__s, find one way to fill in the letters. Do note that some words on the list contain special characters (! & ' , - . /) and numbers Input: This list and a string with missing letters. The input sentence can contain or...

@Pavel Good ol' MktDpt. The Communications Dpt. of my university just the other day sent an e-mail to every student in the system that was supposed to be an internal e-mail
 
2 hours later…
21:06
My English teacher just handed every student a small bag labeles "AP Lang Exam Survival Kit", containing several pencils, smarties, a pack of 5gum, an eraser, a granola bar, and (for apparantly no reason) a glow stick.
21:25
@Pavel No sharpener?
@Οurous Nope
You can't bring one with you though, so no point
@Pavel Are they worried you might stab the invigilator?
@Οurous /shrug
 
2 hours later…
23:23
Do we have a challenge that prints this text?
AAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZ
BABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZ
CACBCCCDCECFCGCHCICJCKCLCMCNCOCPCQCRCSCTCUCVCWCXCYCZ
DADBDCDDDEDFDGDHDIDJDKDLDMDNDODPDQDRDSDTDUDVDWDXDYDZ
EAEBECEDEEEFEGEHEIEJEKELEMENEOEPEQERESETEUEVEWEXEYEZ
FAFBFCFDFEFFFGFHFIFJFKFLFMFNFOFPFQFRFSFTFUFVFWFXFYFZ
GAGBGCGDGEGFGGGHGIGJGKGLGMGNGOGPGQGRGSGTGUGVGWGXGYGZ
HAHBHCHDHEHFHGHHHIHJHKHLHMHNHOHPHQHRHSHTHUHVHWHXHYHZ
IAIBICIDIEIFIGIHIIIJIKILIMINIOIPIQIRISITIUIVIWIXIYIZ
JAJBJCJDJEJFJGJHJIJJJKJLJMJNJOJPJQJRJSJTJUJVJWJXJYJZ
@ConorO'Brien May we return a list of strings?
uh sure
not a cmc but yeah go for it
wew clisp
@Pavel ???
I've just never seen you use clisp before
It's not actually very common :P
oops :/ i left the charcoal flags in the clisp link
How about Cauliflower? :P
23:41
@Pavel :| does it even have chr yet
idk
well actually I think so. hang on
@Pavel :| no wonder it didn't work, I forgot Cauliflower had sigils lol
23:56
@Pavel ^^
yEP, SAW
Sorry caps
somehow it's golfier than clisp wait that's because of unreadable builtin aliases
@ConorO'Brien +1 very golfy

« first day (2662 days earlier)      last day (2476 days later) »