« first day (2020 days earlier)      last day (2814 days later) » 

12:00 AM
0
A: Sandbox for Proposed Challenges

Eamon OliveAutomate the OEIS We see a lot of challenges here asking for a function to create a sequence from the OEIS. While these challenges are fun, as a programmer I see an opportunity for automation. Your challenge is to make a program that takes the index of a sequence (e.g. A172141) and some intege...

 
CMC: Observe; this details a sequence [(0, 0), (0, 1), (1, 0), (0, 2), (1, 1), (2, 0) ...] Given N, output the Nth coordinate in this sequence.
 
12:17 AM
tfw you're browsing image processing challenges and you spot this
user image
2
 
@Dennis Brilliant, but not perfect
@ConorO'Brien What language do you prefer?
 
@LeakyNun it's language agnostic
and I actually stated it wrong :/
 
@ConorO'Brien ?
 
should be [(0, 0), (1, 0), (0, 1)...
 
12:23 AM
@ConorO'Brien Jelly, 10 bytes: 0rṗ2SÞị@‘U
 
cool!
 
@ConorO'Brien Test suite
@ConorO'Brien Pyth, 9 bytes: _@sD^UhQ2
How come Pyth is shorter than Jelly
 
cause the original ftw
 
Jelly isn't based on Pyth
 
Original? Jelly isn't even remotely related to Pyth.
 
12:26 AM
ninja'd
 
he probably means original golfing lang :P
 
That would be GolfScript.
 
I know that. it's more sound tho
 
Pyth and Jelly are probably the two most dissimilar succesful golfing languages
 
Exactly
 
12:32 AM
0
A: I've been alphabet hunting for a while

DowngoatCheddar, 146 bytes (non-competing) (s,b=65@"90)->(|>27).any(->s has(b=b.slice(1)+b[0])||s has b.lower||(1|>3).any(j->s.lines.turn(j).vfuse has b||s.lines.turn(j).vfuse has b.lower)) Rather slow but it works ¯\_(ツ)_/¯ . added any function after challenge release date. The input does not need t...

 
@Downgoat Cheddar has diagonals??
 
@LeakyNun spec didn't say diagonals. lemme check
> Alphabets may not always read forwards. They can also read backwards, up, and down.
 
@Downgoat oh, what
brb golfing my Jelly answer
 
diagonal ∉ { forwards, backward, up, down }
 
12:34 AM
Apparently I'm out of my mind
 
@LeakyNun Ḷṗ2SÞ⁸ịU 8 bytes w/1-based indexing.
 
@Dennis I don't know if 1-based is allowed
@Downgoat It's even shorter now
 
o____o
 
@LeakyNun it is
my hobby: making challenges where Jelly is over 20 bytes :p
 
@LeakyNun I'm guessing each item in the array is a line?
 
12:38 AM
@ConorO'Brien Alright, nice
@Downgoat yep
@ConorO'Brien ... @Dennis shall return with less than 20 bytes
 
yeah, probably
 
@Downgoat I like that c? syntax. 10/10 very golfy
 
thx :D
 
12:55 AM
@Downgoat did you change the function syntax?
 
@Dennis Is TIO borked?: D:
Stop executing pid=11065: Should wait until other syscalls to be done
@ConorO'Brien no, why?
 
@Downgoat maybe because of the c?
 
I thought it was (args) -> body?
oh, wait, that's an empty-arg func. nvm
 
:D down to only 4.8x longer than Jelly
 
@Downgoat Seems to be working fine for me.
 
12:59 AM
hm :/ weird
huh, ok now it's working for me
 
I had that error earlier
 
maybe it was too many proecsses?
 
@ConorO'Brien With which interpreter?
 
cheddar
 
@Downgoat When was beta36 released?
 
1:07 AM
@LeakyNun uh lemme check
@LeakyNun yesterday‌​. I can get more accurate timestamp if needed
 
@Downgoat ok nothing thanks
 
The process limit is rather strict for sandboxed interpreters, since I have to prevent fork bombs for the "real" languages. I'll set it a bit higher to prevent this in the near future.
 
@Downgoat "non-copmeting"
 
@EᴀsᴛᴇʀʟʏIʀᴋ I fixed that :/
 
@Dennis oh, so that's why the forkbomb didn't work ;)
 
1:11 AM
ಠ_ಠ
 
@Downgoat Is || short-circuiting?
 
no :(
workingo n it tho
 
@Downgoat readline.js line 953
can you stop throwing external error?
 
what code are you running?
that is error with REPL not me
 
1:16 AM
@Downgoat I thought REPL is you
I was doing turn(0)
 
oh yeah, you're not uspposed to do that
 
You're not supposed to throw external errors
@Dennis How many syscalls are there?
What does pid mean?
 
Apparently, this is a bug in the sandbox. github.com/tsgates/mbox/issues/18
 
1:24 AM
@EᴀsᴛᴇʀʟʏIʀᴋ woah wat
 
@Downgoat floor? floor division?
 
My BF answer for codegolf.stackexchange.com/questions/89241/… has hit 361 bytes and I'm not even done yet >_>
 
@ConorO'Brien n->(m->[m[0]-n+m[1],n-m[1]])((a->[a,a*(a+1)/2])(((8*n+1)**.5-1)/2|0))
(Cheddar)
 
nice
but wow
 
@StevenH. how you would output in decimal is beyond me
 
1:32 AM
Outputting in decimal is something I haven't even touched yet; just figuring out which stall is difficult enough.
 
@LeakyNun floor n
 
@Downgoat ok thanks but |0 is still shorter
 
i should start on docs now >_> holidays are ending next week >_>
 
@Downgoat Did you see my comment?
 
no not yet
 
1:38 AM
These alphabet challenges
The worst part about them is that CG doesn't have a built in constant for the alphabet yet
 
@quartata Problem?
@quartata oh lol
 
@LeakyNun, once I have the stall I'll just continue looping x/10 on successive digits until it's less than 10 then add 48 to each digit and then print. That's the easy part.
 
@StevenH. Alright
 
@StevenH. With brainfuck, you can give the output in unary, unless the challenge says otherwise.
 
If I'm outputting in unary does the ASCII code of what I'm outputting matter? (is there a meta link for this?)
@Dennis Does it also work that way for BF derivatives (particularly Sesos?)
 
1:51 AM
Cureent consensus is that you can only use unary if your languahe cannot handle decomal natively.
@StevenH. With Sesos, just use set numout.
 
@LeakyNun I didn't even notice it, I think that answer should win since its the only one written with love <3
 
All right, thanks
 
@miles lol
 
does MATL use matlab on tryitonline or octave
 
Octave
I don't even want to know how much a license that allows me to use MATLAB on a web server would cost.
 
1:57 AM
Guys, what does "discount" mean in "Discount CGI Cloud City"?
I hear that structure quite often in CinemaSins
 
cheap and crappy
 
@EᴀsᴛᴇʀʟʏIʀᴋ I see, thanks
 
Meaning they couldn't pay for the real thing so they went for a knockoff version that's similar but not the same
 
thanks I was just wondering
 
@StevenH. oh, thanks
 
1:58 AM
Or even if they could pay for the real thing they chose not to
 
2:08 AM
@LeakyNun in CinemaSins, it's saying that it's a ripoff, or not the original/optimal example of
 
@ConorO'Brien I see, thanks
 
Games like Rock Paper Scissors are (mildly) interesting because they are non-transitive. If some subset of options were the best, everyone who had a whit of sense would pick from those. In RPS, though, no option is optimal, so it becomes a mind game. CMC: come up with an interesting way to extend this non-transitivity and uniformity to the set of all integers.
 
That's the longest chat mini challenge I ever seen.
 
>>> sin(S('1000.1+i*1000.1', rational = True)).evalf()
sin(10001*i/10 + 10001/10)
Um wat?
 
@LeakyNun ¯\_(ツ)_/¯ I wanted to provide a little background... :P
 
2:19 AM
lambda x:["rock","paper","scissors"][x%3]? Wait, you said interesting...
 
@StevenH. Where did I say anything about mod 3? Oh, yeah, that's a kinda trivial extension.
 
@El'endiaStarman I don't quite follow. You want to extend RPS to the integers? :/
 
@ConorO'Brien Pretty much, yeah.
 
@StevenH. That produces ties.
 
Fixed to make clearer
So does Rock and Rock, Dennis.
 
2:21 AM
I'm generally confused
:P
 
I know, but I assume 0 and 3 shouldn't tie here.
 
@ConorO'Brien Well, do you know about Rock Paper Scissors Lizard Spock?
 
Well, as to how you'd make them not tie therein lies the interesting-ness, right?
 
@El'endiaStarman vaguely.
 
@El'endiaStarman How do you measure if 0 wins and loses against "the same" number of options?
 
2:23 AM
 
@ConorO'Brien It's nothing more than RPS with 5 choices. For any given choice, half of the others beat it and it beats the other half.
And that's RPS 15 ^^.
What could RPS Infinity look like?
 
< and >?
 
-1 no Spock
 
sponge beats devil. seems legit.
 
But once again > and < don't quite meet the interesting criterion
 
2:24 AM
@StevenH. I'm not sure if they meet the wrap around criterion
 
@StevenH. That works as long as the only requirement is that both sets are infinite.
 
@LeakyNun The CMC didn't specify a wrap-around criterion. The unfortunate fact is that we don't find as interesting a game in > and <, since the best way to play is to determine a larger (or smaller, depending on winning criterion) represent-able number than you think your opponent has come up with.
 
@StevenH. what does RPS infinity even mean?
 
I'm more interested in RPS N*i :P
 
@LeakyNun That's basically the challenge. :P
 
2:31 AM
@El'endiaStarman I don't even know what we are supposed to come up with
What is a generalization of RPS?
 
RPS infinity would mean that in an infinite set N there's a mapping R between every pair in N^2 such that if R(x,y) is 1 (or win), R(y,x) is -1 (or loss) [cont.]...
 
@LeakyNun The image that Steven oneboxed above is RPS 15.
 
@El'endiaStarman Do you agree with the definition above?
@StevenH. So basically a well-ordering
 
@LeakyNun I was just thinking that that's actually a pretty good way to summarize the problem.
 
2:33 AM
@El'endiaStarman So basically a well-ordering
 
It should be non-transitive, though. A well-ordering is transitive.
 
@El'endiaStarman So if R(x,y) is 1 and R(y,z) is 1, R(x,z) may be 1 or -1
 
@LeakyNun Yes.
 
@StevenH. Oops, your ordering is transitive
 
Not sure if anyone is interested, but this Python Q just came through and OP is seeking a code review, with the caveat of their code being a one-liner if at all possible...
-1
Q: need to have 3 expression in one line

dirty_feriI have the code below (I INSIST TO KEEP IT IN THE ONE LINE FORMAT IF POSSIBLE): master_indices = dict(((r[0]), i) for i, r in enumerate(csv.reader(master))) I need to add the statement that if the line contains '/' than enumarate and make dic I have tried: master_indices = dict(((r[0]), i) f...

 
2:35 AM
> I INSIST TO KEEP IT IN THE ONE LINE FORMAT IF POSSIBLE
I INSIST
 
Right...
 
DON'T IGNORE MY WILL
 
maybe if he asks here, he'd get a better response :P
 
@Phrancis This reads more like an SO question to me.
 
Not sure why, that seems like a silly requirement
@El'endiaStarman Does the code look like it's actually not working the way they want it to?
 
2:36 AM
Where R(x,y) == 0 (tie) iff x == y, ∑R(x,y) = 0 ∀y∈N, and R is not transitive. I think that covers everything. Also, yes, unfortunately > and < are transitive.
 
@Phrancis Err, yes? The "I need to add the statement..." bit tipped me off, as do his attempts.
 
@El'endiaStarman OK we'll just close it then, wasn't sure since my Python is very unimpressive
 
An example would be lambda x,y:cmp(x%3,y%3) or cmp(x,y)
or, in English: compare them mod 3, if equal, compare them instead
wait, I could build larger cycles indefinitely
so 0<1<2<0, 3<4<5<3, 6<7<8<6
 
Isn't that transitive? Suppose that x = 6, y = 9, and z = 12...
 
@El'endiaStarman 0<1<2<0 so it isn't completely transitive
 
2:39 AM
Hmm, you're right.
 
@El'endiaStarman Or are you saying that if f(x,y) = 1 and f(y,z) = 1 then f(x,z) must equal -1?
And then I could make 0<3<6<0, ...
 
@LeakyNun It'd be interesting to see if that's possible.
 
and then build cycles indefinitely
 
We could try to make it indefinitely non-transitive by adding a hashing function stronger than %?
 
I'm about to compare their base 3 representations from right to left
 
2:43 AM
or maybe f=lambda x,y,z:cmp(x%z,y%z) or f(x,y,z**2) with initial call f(x,y,3)? Not sure how sound of a solution that is
 
A vague idea I have is that it shouldn't be possible to go into an escalating race. For instance, if we say that x beats y if x > y, then you have a race to infinity, essentially. There is no such race in RPS 3 - you have to try and guess what your opponent will pick. So it should, in a sense, always be possible to beat a larger number with a smaller number. In that regard, cmp(x%3, y%3) or cmp(x,y) works.
 
And by right I mean the least significant digit
 
I feel like modding by n isn't the best solution, though, since it effectively turns it into an RPS n game.
 
In other words, lambda x,y:0 if x==y else cmp(x%3,y%3) or f(x//3,y//3)
 
2:44 AM
That's why I had a variable n rather than a static n @El'endiaStarman
 
@ConorO'Brien For reasons I can't explain I automatically associated the name to rectum
 
@LeakyNun ಠ_ಠ
 
@El'endiaStarman I thought what you want is an RPS n game?
@El'endiaStarman @StevenH. How's my solution?
 
@LeakyNun Perhaps that's the only kind of solution, but maybe there's another, more interesting one.
 
That seems like it could work, but if we can come up with something else
 
2:46 AM
Oh, I don't know if you all are interested, but I've been playing around with a database of network-wide SE stats (not SEDE)
 
@ConorO'Brien -10/10 can you at least provide one example program
 
@LeakyNun fiiiiine
 
@Phrancis Did you build the database yourself?
@LeakyNun I agree, seems like it could work.
 
@El'endiaStarman No, it was built by someone else on CR, using the SE API. They gave me access to it
 
@Phrancis Ahhh, cool.
 
2:47 AM
Do you know of any good bijections over the integers? We could apply one of those before the first recursion of f to make it a little more interesting
 
@StevenH. Define a good bijection
 
@El'endiaStarman If you know some SQL and are interested, you can have (read) access too
 
but I just came up with an interesting one
group them into groups of size 1, 2, 3, 4, 5, ...
and then rotate them one to the left
i.e. (1), (2,3), (4,5,6), (7,8,9,10), ...
 
@LeakyNun I actually do
 
and then (1), (3,2), (6,4,5), (10,7,8,9,)...
1,3,2,6,4,5,10,7,8,9,...
@ConorO'Brien where?
 
2:49 AM
@LeakyNun here
I love how where is just w + here
 
@ConorO'Brien ugh, in the docs?
 
3 mins ago, by Conor O'Brien
@LeakyNun fiiiiine
 
Good bijection, as I had imagined it, would have been defined as meeting the criterion that any two adjacent numbers in the set are no longer adjacent after the bijection is applied. Your suggestion could work, though.
 
@StevenH. (2,4,1,3), ... would fit your criterion
 
My code is here @El'endiaStarman in case you are curious how I came up with these numbers
WARNING: Not Golfed^
 
2:52 AM
Sure. I see nothing wrong with that... should I?
 
basically, lambda x:x//4+[2,4,1,3][x%4] (roughly)
I know it doesn't work due to 0-indexing
but you get the idea
 
@LeakyNun lambda x:4*(x//4)+[1,3,0,2][x%4] would suffice.
 
@El'endiaStarman just making the idea here
 
That could work. Are there any homogeneous bijections? Homogeneous meaning that, if the bijection is called B, for any natural number n there is a number m such that B(m)-B(m+1)>n
 
@StevenH. example?
 
2:56 AM
I don't know if there is one, that's why I'm asking
 
CMC: (real numbers) come up with the most interesting bijection between a finite interval to an infinite interval; you may specify the finite interval and the infinite interval; the infinite interval can be one-sided or double-sided
 
@LeakyNun It would also work to just reverse the groups. 1, 3, 2, 6, 5, 4, 10, 9, 8, 7, ... It seems like it's still subject to the race-for-infinity problem.
 
@LeakyNun that's... impossible?
 
@ConorO'Brien Not if they're continuous.
 
@ConorO'Brien tan(x)
@El'endiaStarman what is that problem?
 
2:57 AM
@El'endiaStarman explain?
 
@ConorO'Brien tan(x)
 
@LeakyNun The best way to win is to try and guess a larger number than your opponent.
 
@LeakyNun thanks for the 4 letters and 2 symbols, helps a lot.
 
@ConorO'Brien There are just as many real numbers between 0 and 1 as there are real numbers between 0 and infinity.
 
@ConorO'Brien tan(x) maps from (-pi/2,pi/2) to (-infinity,infinity)
 
2:58 AM
That's the magic of uncountable infinities...
 
@El'endiaStarman d'oh I've been working with integer intervals recently. I assumed integer interval >_<
 
@El'endiaStarman so back to my comparison of base-3 representation from right to left?
@ConorO'Brien "real" is literally the first word in my challenge
 
@LeakyNun it wasn't before.
also, parens
 
@ConorO'Brien fair point
 
With your bijection lambda x:4*(x//4)+[1,3,0,2][x%4], any two adjacent numbers are guaranteed to have a difference of at most 3 (1,3,0,2,5,7,4,6...)
 
2:59 AM
@LeakyNun You edited that in on the second edit. :P
 
ninja'd
 
@StevenH. but you wanted no continuous
so it cannot be homogenous
by your definition
 
If we're sampling over the integers and not real numbers, you should be able to have noncontinuity and homegeousness (spelling? Wording?)
 
@StevenH. eh, you said you must have integers m such that f(m)-f(m+1)=1?
 
f(m)-f(m+1) > 1. Big difference, there.
 
3:03 AM
oh...
 
ind@@\
  ;p<<
p%~1<;
maps [0, 1] to [0, infinity)
 
And in English?
 
>_>
actually, codomain is [0, infinity) \ (0, 1)
roughly, f(x) x = 0 ? x : 1 / x
 
@ConorO'Brien Alright
@ConorO'Brien In other words: {0} U [1,infty)
 
3:13 AM
@ConorO'Brien Challenge: make [0,1] to another continuous infinite range
 
continuous? hmm
1/x?
 
@ConorO'Brien undefined for x=0
 
I define it to be infinity
#programmer
 
infinity doesn't exist
 
Wouldn't it have been slightly simpler to just map (0,1) to (1, infinity) using 1/x and not tackle the x == 0 ? case?
 
3:14 AM
min(floor(x), 1) * (1 / x)
 
By not including it in the domain
 
@StevenH. I was talking about [0,1]. Of course it would be easy to use (0,1)
 
@StevenH. this sub-challenge is [0, 1] mapped to an infinite continuous domain
 
@ConorO'Brien In other words: x or 1
 
let's try that
 
3:15 AM
@ConorO'Brien I was saying that your mapping maps every number save 0 to 1
which is not bijective
 
this one does?
 
@ConorO'Brien ??
 
min(floor(x), 1) * (1 / x)
I changed it
 
What about x -> 1/(1-x)?
 
@ConorO'Brien so it's basically every number save 1 to 0
@El'endiaStarman undefined for x=1
 
3:17 AM
hm, you're right
 
@LeakyNun x -> limit as y->x of 1/(1-y)
 
@El'endiaStarman undefined for x=1
 
@LeakyNun No, it's infinity.
 
@El'endiaStarman infinity is not a number
Good luck mapping from infinity back to 1
 
log(x+1)/x
 
3:19 AM
Γ(1/(1-(x-floor(x))))?
 
works for [-1, 0]
 
@LeakyNun For our purposes it is. It's impossible to answer your challenge otherwise, since some number in [0,1] must map to infinity.
 
@El'endiaStarman Oh, what a fool am I.
let's go back to my main challenge
24 mins ago, by Leaky Nun
CMC: (real numbers) come up with the most interesting bijection between a finite interval to an infinite interval; you may specify the finite interval and the infinite interval; the infinite interval can be one-sided or double-sided
 
Γ(1/(1-(x-floor(x))))
[0,1]
 
3:21 AM
@StevenH. domain and codomain?
 
Codomain is [1, infinity)
 
@StevenH. I thought 0-floor(0) = 1-floor(1)
 
That's true. Do we really need to have a double-closed finite interval?
 
@StevenH. eh... since El'endia said above that it's impossible, it isn't necessary
 
In that case, either (0,1] or [0,1) can act as the domain.
 
3:26 AM
x! over [-5, -4]
 
:31588189 You're better than Downgoat and his darned hooves.
 
@ConorO'Brien interesting
 
Conor, x! is not defined for x<0. The extension into negative numbers is Γ, which also is not defined for negative integers.
@El'endiaStarman, I don't get the reference, sorry.
 
@StevenH. Downgoat often blames his terrible typing on his hooves.
 
The extension of the factorial to real numbers would be Pi, not Gamma.
 
3:29 AM
To read about gamma distribution, see Gamma distribution In mathematics, the gamma function (represented by the capital Greek letter Γ) is an extension of the factorial function, with its argument shifted down by 1, to real and complex numbers. That is, if n is a positive integer: Γ ( n ) = ( n − 1 ) ! {\displaystyle \Gamma (n)=(n-1)!} . The gamma function is defined for all complex numbers except the non-positive integers. For complex numbers with a positive real part, it...
Real and complex, sorry
 
@StevenH. I think he meant (-5,-4)
@StevenH. not bijective
@ConorO'Brien not bijective
 
Hoo, I'm tired now. Gonna head to bed. G'night all!
 
Whereas Γ over (0,1) is bijective
Night, @El'endiaStarman
 
@StevenH. that is true
 
@LeakyNun Tangent for (-pi/2,pi/2) to real numbers, x->x/(1-|x|) for (-1,1) to real numbers.
 
3:36 AM
@Dennis nice
 
Alternatively, B(x,x) where B is the Euler Integral of the first kind over (0,1] to [1, infinity)
 
@LeakyNun it isn't?
 
@ConorO'Brien nope
 
why not?
I thought there was an inverse gamma function and therefore an inverse factorial function?
 
@StevenH. In other words, gamma(x^2)/gamma(2x)
@ConorO'Brien just look at the graph
 
3:40 AM
oh
derp
[-5, -4.635] is revised domain
maps to [0.245, Infinity] (basically)
 
-10/10 very precise
 
Why not do [-4.6353, -4)?
 
[-8, -7.5] is less precise
sorry, that may be wrong
bah, why not [-2, 0]
or even [-1, 0]
 
@ConorO'Brien online interpreter for rectum?
 
oh, wait, for reticular?
@LeakyNun for reticular? ಠ_ಠ
 
3:49 AM
@ConorO'Brien i'm gonna call it rectum from now on
 
@LeakyNun you're worse than VTC >_<
 
@ConorO'Brien what did VTC do
 
what did VTC do
 
a while back I had a language called simplex. he called it limp sex.
 
3:49 AM
omfg that's funny af
 
this always seems to happen to me
 
@ConorO'Brien Online interpreter?
 
@Dennis could you try adding reticular to TIO? The only instance of eval is evaluating a char in "\#{char}"
and it's in ruby! you don't have to mess with node!
 
is there any ruby-based language on TIO?
 
uhhhhh
probably?
 
3:52 AM
I'm just asking
 
ik
but idk
 

« first day (2020 days earlier)      last day (2814 days later) »