« first day (2361 days earlier)      last day (2777 days later) » 

12:00
if you don't use them, you are not really using pyth: you are just using golfed python
which is mostly pyth right? :P
@totallyhuman that's blasphemy!
Also seriously the byte string thing, it's a matter of outgolfing c# or death
What are the rules about submissions that produce an error / warning?
12:15
@LeakyNun If you have two primes, m and n, Isn't the first k higher than 0, such that m^k mod n is 1, in fact n. So, isn't n=k???
Oh wait, 2^3 = 8, 8 mod 3 = 2, dumb!
2^3 mod 7 = 1
I have an idea then
I can use .f, duh!
No, I can't
fastfib(0,1,0).
fastfib(1,0,1).
fastfib(2,1,1).
fastfib(A,B,C):-
  A > 2,
  (divmod(A,2,X,1),fastfib(X,E,F),FF is F*F,B is 2*E*F+FF,C is E*E+FF+B;
   divmod(A,2,X,0),fastfib(X,E,F),FF is F*F,B is E*E+FF, C is 2*E*F+FF).
fib(A,C):- fastfib(A,B,C).
@TheLethalCoder Right now, I am writing the lexer for the new version of Carrot and I am faced with a dilemma: how will I differentiate the operator / from the regex /regex/flags since they both start with the same character (and I have planned so that operators can take more than one argument)? One of my thoughts is to use spacing to differentiate operators from arguments, the other is to use a different delimiter for regex, like @.
0.124 s for 1e5
12:30
@LeakyNun I think I've solved it
Some more test cases?
Show me your code
I'll judge it with my eyes
Wait, wait, I found a small mistake
Show me what you got
How do I add a 0 in front of an array?
@totallyhuman create it yourself
@Mr.Xcoder +0
12:31
Like [1,2,3] -> [0,1,2,3]`
@LeakyNun Really?
+0[1 2 3)
@Mr.Xcoder yes
Oh danke
I was making a joke but I guess nobody got the reference ><
@TheLethalCoder For the - operator, I just check if there is a . or a digit following the minus. If there is a . or digit, then it is a Float token, otherwise it is the minus operator. So this means that I can have a space after the - to differentiate it from floats. But I can't do that for / vs regex
@LeakyNun It feels long: KQJE=Jm%^KdJ+0SJ<Jt-lJx_J1 -26 bytes)
12:33
KQ again?
Then JE would evaluate to the first input...
it takes the second input if Q is found anywhere in the code, even implicit
...
Hooray, I used m. Should not be too happy though :(
24 bytes feeeels waaaaay toooo loooonng
@LeakyNun Suggestions?
I think I can use e, but I dunno how
use .u
Another char I do not know the meaning of... Will read on it and implement
12:37
I spotted t-lJx_J1 in your code
I hope you know what it means
I know, last index of...
e...
But I do not know how to put it such that I don't need the crappy t-lJx_J1
x1...J?
Not sure what you mean by that
@LeakyNun ?
I mean x1J
x  <int> <int>            Bitwise XOR. A ^ B in Python.
x  <lst> <any>            First occurrence. Return the index of the first element of A equal to B, or -1 if none exists.
x  <str> <str>            First occurrence. Return the index of the first substring of A equal to B, or -1 if none exists.
x  <non-lst> <lst>        All occurrences. Returns a list of the indexes of elements of B that equal A.
x  <str> <non-lst>        First occurence. Return the index of the first substring of A equal to str(B), or -1 if none exists.
the fourth one
ex1J... clever
I didn't know that exists
I really should learn the characters
12:42
yesterday, by Mr. Xcoder
Another question about Pyth (inspired by the CJam question): last index of a number in a number array. Consider the following array: K[2 3 4 2 3 4). I have written t-lKx_K2 to get the last index of 2 in the list. Is there no built-in/shorter way to do this?
yesterday, by Leaky Nun
@Mr.Xcoder ex2K (doesn't work for strings)
@LeakyNun I forgot about that
I don't even remember asking it... I have a bad memory
Currently, it is 20 bytes long: JE=Jm%^QdJ+0SJ<Jex1J
19 bytes: JEKm%^QdJ+0SJ<Kex1K
0
Q: Three triangular numbers

racer290Description There have been quite a few other challenges concerning these numbers before, and I hope this one is not among them. The n th triangular number equals the sum of all natural numbers up to n, simple stuff. There are a wikipedia page and an entry at OEIS, for those who wish to inform ...

@NewMainPosts that's fast.
@TheLethalCoder I only saw this message now. Thinking about this now, I am thinking about a command that will "explode" the array on the sheet horizontally (or vertically). Then the program can later move across the sheet to change the individual elements of the arrays directly
Is <l:NY> translated to lambda N,Y:?
@Mr.Xcoder yes
@Cowsquack I'm not sure, different delimiters solves the problem for now, but if you later want to use that character for a different command you get stuck again. I would wrap it in quotes and use the string as an regex argument like: /"pattern"flags seeing as you aren't using quotes for anything else at the moment. with the / command.
@Cowsquack I'm not entirely happy with that idea but that's what seems best to me so far...
@Cowsquack Okay so more of a way to move across the stack instead of accessing parts of it separately?
@EriktheOutgolfer only have 5 answers ಠ_ಠ
@TheLethalCoder so how would you distinguish between a string argument and a regex argument?
@Mr.Xcoder well it isn't much compared to the recent 15-answer chain by leaky
12:50
@EriktheOutgolfer ಠ_ಠ
Number of answers should be an absolute thing, the theory of relativity (to LeakyNun In this case) should not apply :P
Do any Jelly people know why Try it online! isn't working for me? I want differences between ASCII codes
@LeakyNun I don't understand how .u works...
@TheLethalCoder well I was thinking about putting the tape to use, given the fact that Carrot can only operate on a single stack at any moment, so I came up with the exploding array idea
@nmjcman101 each "character" is secretly a list of character
use "abcdf" as input instead (allowed by the OP)
And I also don't understand what C is supposed to be in this:
> Cumulative reduce. Reduce B from left to right, with function A(_, _) and C as starting value, and return all intermediate values, starting with C. A takes current value, next element of B as inputs.
@nmjcman101 Try this
12:55
@TheLethalCoder is this message replying to my "exploding" stack-array message?
.u <l:NY> <seq/num> <any> Cumulative reduce. Reduce B from left to right, with function A(_, _) and C as starting value, and return all intermediate values, starting with C. A takes current value, next element of B as inputs.
.u <l:NY> <any> <none>    Cumulative fixed-point. Apply A(_, _) until a result that has occurred before is found. Starting value B. Return all intermediate results, starting with B. A takes current value, iteration number as inputs.
C means the third input
@LeakyNun That makes sense, but I'm now not sure why, with input ['a','b','c'] vs 'abc' O seems to give the same result?
You understood A and B but not C
@nmjcman101 singletons are printed as the element
use the pythonic repr to see the difference
@Cowsquack No it was a follow up to my previous message.
@LeakyNun I don't understand Reduce B from left to right either
12:56
ŒṘ
@LeakyNun Thank you!
@Mr.Xcoder reduce an array with a function
reduce [1,2,3,4] with + means ((1+2)+3)+4
from right to left would be 1+(2+(3+4))
@Cowsquack At the moment the / isn't used with a string argument so I was thinking reporpse the string argument to take a regex.
And how would that help here?
that wouldn't
12:57
21 mins ago, by Leaky Nun
use .u
@Mr.Xcoder use the second one
@TheLethalCoder Extending from your idea, regex arguments could use ' as the delimiter. This will Carrot to be able to distinguish string from regex arguments.
Couldn't you just say that from the beginning?
@Mr.Xcoder yes
@LeakyNun Oh that's a vague-semi-near-built-in
12:59
@TheLethalCoder well, once all of Carrot's operators are implemented, every operator will be able to take in every type and combination and number of arguments...
@Cowsquack That's a good idea to and means you can easily use a regex with any other command if needed. So it'd be like: /'/pattern/flags'?
And what is <none>?
@LeakyNun ^?
no argument
use ) to specify none
or implicit at the end of a file
13:05
I have this for now: JE.u%^QNJ1 (doesn't yet work)
Won't ever work ^
what does .u do?
right
> Cumulative fixed-point. Apply A(_, _) until a result that has occurred before is found. Starting value B. Return all intermediate results, starting with B. A takes current value, iteration number as inputs.
Stare at this ^ (message for me)
Why does that lambda have two arguments @LeakyNun ?
I mean, how to use them
Ohhh
@TheLethalCoder that's nice
simple and easy to understand
13:09
question: in a language where characters by themselves are practically meaningless, should I have a custom character encoding for ease-of-use?
@Cowsquack In fact I can't think of another way of using a regex at the moment so just '/pattern/flags' could be fine on its own. Unless you can think of another way to use it?
@LeakyNun HOOORAY, 11 bytes: JEt.u%^QYJJ
Can you confirm that it is valid?
@TheLethalCoder well there is the possibility of dropping the first slash for golfiness, so like 'pattern/flags', but I am not sure
It gives the perfect results for the test cases I've tried so far
Hey in the pyth character reference, what is <col>?
13:12
Feedback
@totallyhuman The thing to iterate on
@totallyhuman a list
Sequence, I think
@Mr.Xcoder why do you need the t?
col for column
@Mr.Xcoder I know what it does. I'm asking you why you need it
13:13
@LeakyNun Because it adds the original number in front of the list if I don't
hmm
what does col stand for then
@Mr.Xcoder why would it?
@LeakyNun That I don't know :P
Types:
num = int, float
cmp = complex
seq = str, list, tuple
lst = list, tuple
idx = str, list, dict
col = str, list, set, dict
any = any expression (a for short)
blk = a code block (any series of statements)
... = any number of arguments of any type.
n:_ = n _ arguments.
var = variable. Not evaluated.
func = function. Not evaluated.
func n = function with arity n.
pfn = Preceding function of arity n. *F, for instance.
l:_ = Lambda with lambda variable(s) _
pos = positive int.
nneg = nonnegative int.
I don't really understand why it adds it.
13:14
> col = str, list, set, dict
@Cowsquack Me neither, was just a thought though. It depends if you end up wanting to do something like +'/pattern/flags' for finding all matches, -'/pattern/flags'"replacement" for replacing matches and some other ideas...
@Mr.Xcoder stare at the documentation again until you understand
@LeakyNun Which one?
hint: don't use Y
still doesn't stand for anything but ok
13:14
@Mr.Xcoder .u
> Cumulative fixed-point. Apply A(_, _) until a result that has occurred before is found. Starting value B. Return all intermediate results, starting with B. A takes current value, iteration number as inputs.
For staring ^
@LeakyNun Starting value B. That's why
seems like the only way of understanding these golflangs
staring at the docs
@Mr.Xcoder yes
@TheLethalCoder well, replacement was one of the reasons I decided that commands should have multiple arguments, so as you stated, a regex containing a pattern and a string containing the replacement.
Wait, I am fixing it
13:15
@totallyhuman I scrolled through the Pyth doc and the Jelly doc.
and other golflangs of course
so for now I will go with '/pattern/flags' as per your suggestion for regex arguments
How can I fix that? Adding 0 as the starting value does not seem to work
@Mr.Xcoder hint: a^b = (a^(b-1)) a
@LeakyNun * Headache *, I don't get the point
@Mr.Xcoder what is N in the doc?
13:19
@Cowsquack I'm liking the ' idea now anyway for regexes.
@LeakyNun The... first input (in my case)
@Mr.Xcoder no, stare at it again
what is Y then?
Empty list?
@LeakyNun I have no idea what Y is in this context
@LeakyNun Please shed some light on my dumbness again
...
Your silence kills me.
@Mr.Xcoder That's valid Python code
13:28
@Mr.Xcoder I went to take a shower
> A takes current value, iteration number as inputs.
N is the current value and Y is the iteration number
@LeakyNun Such a terrible disappointment am I?... :P
@EriktheOutgolfer that is also valid Python code
Well if you ignore the >
@LeakyNun .uN6 yields [6] and .uY6 yields [6,0,1,2,3,4,5]
So what's wrong with the code I have shown earlier?
Needs more jquery
@Mr.Xcoder for example, the collatz conjecture would be .u?%N2h*3N/N2Q
try to understand this program
13:35
Cumulative fixed point on Q, if N is odd return the incremented product of 3 and N by 1 else return the number of occurences of 2 in N.
ok who starred code snippet now...? definitely this room's description should be like this:
> General discussion and star abuse for codegolf.stackexchange.com | Guidelines: ppcg.github.io/chatiquette
@EriktheOutgolfer I did, sorry. I cannot undo it now.
a ro can help you with that...
@Mr.Xcoder /N2 means N//2
@LeakyNun I can't understand that because I have no idea what the Collatz conjecture is.
13:37
for integer N
@LeakyNun Oh, right
The Collatz conjecture is a conjecture in mathematics named after Lothar Collatz. It can be summarized as follows. Take any positive integer n. If n is even, divide it by 2 to get n / 2. If n is odd, multiply it by 3 and add 1 to obtain 3n + 1. Repeat the process indefinitely. The conjecture is that no matter what number you start with, you will always eventually reach 1. The conjecture is also known as the 3n + 1 conjecture, the Ulam conjecture (after Stanisław Ulam), Kakutani's problem (after Shizuo Kakutani), the Thwaites conjecture (after Sir Bryan Thwaites), Hasse's algorithm (after Helmut...
> The Collatz conjecture is a conjecture in mathematics named after Lothar Collatz. It can be summarized as follows. Take any positive integer n. If n is even, divide it by 2 to get n / 2. If n is odd, multiply it by 3 and add 1 to obtain 3n + 1. Repeat the process indefinitely. The conjecture is that no matter what number you start with, you will always eventually reach 1.
Oh, Got it
Then how does ?%N2 work?
?  <any> <any> <any>      Ternary. A ? B : C in C-like languages. B if A else C in Python.
I know what ? does.
Oh, only 1 is odd
@LeakyNun Sooo, how shall I fix it: JEt.u%^QYJJ
13:41
so what is N?
I mean, it works, but
@LeakyNun Current value
what does "current value" mean?
what exactly does .u do?
Why do we do this again?
@LeakyNun Loop through [B,0,1,2,...B-1] and map it somehow.
because I don't think you get it
right, you don't get it
Right, explain it to me.
13:44
> Cumulative fixed-point. Apply A(_, _) until a result that has occurred before is found. Starting value B. Return all intermediate results, starting with B. A takes current value, iteration number as inputs.
1. start with B
2. apply A(B,0)
Stop.
Apply A(B, 0 ). That's what I was missing
Continue.
3. let the last value [which is A(B,0)] be N. apply A(N,1)
4. ... apply A(N,2)
5. ...
6. until we see a value that appeared before
7. output every value before 6
Wait. apply A(N,1). What is N here?
The current value.
(talking to myself)
> Asked whether the laws of mathematics behind encryption would trump any new legislation, Mr Turnbull said: "The laws of Australia prevail in Australia, I can assure you of that.

> "The laws of mathematics are very commendable but the only law that applies in Australia is the law of Australia."
13:49
@LeakyNun Step 3 is crucial, and I totally missed it.
what a world where Australia can override the laws of mathematics
>.<
@Poke laws of physics? nah mate, laws of thermodynamics? not in my country pal
we don't take kindly to THAT type of law
@LeakyNun Once I have seen that, I start thinking that the only relevant part about using .u is until a result that has occurred before is found.
@Mr.Xcoder right.
13:51
@Poke Coincidentally, there's math fiction related to the idea of overriding the laws of mathematics, and it's written by Greg Egan, who is also from Australia...
Will be back in ~2 mins... Little issue
Does the mobile GitHub website strip newlines?
I'm back
The sandbox has way too many non-deleted posts. I'd like everyone to look at your sandbox posts and delete / post / edit them to help clean up the sandbox.
13:56
It seems to be removing newlines from docstrings
@programmer5000 debatable
@trichoplax haha
oh yeah I have a couple unreleased sandbox posts
@LeakyNun Show me your way of solving it with .u and I'll just try to understand it
I am tired of writing code now...
@Mr.Xcoder JE.u%*QNJ1
@LeakyNun Got me by 1 byte, but yours is a bit much more logical
I like the idea of the third one
@programmer5000 I have lots, all of which I am likely to work on in future, although they won't be edited until I get round to them (I'm working through roughly in votes order). So old inactive posts aren't necessarily ready to be deleted, posted, or edited. Maybe we could just pick one at random and bring it to the attention of TNB, and gradually get them all discussed over time?
@dzaima What's the pattern in the last one?
@Mr.Xcoder finding the pattern is half the challenge
@dzaima Oh, didn't really read it
14:02
but I'll tell you that I made it in ~15 bytes in SOGL by accident
@dzaima It might not be obvious to everyone that there are three adjacent links there
true
@trichoplax It is quite obvious
@trichoplax good idea. I just want people to look at their old posts and do something with them.
@dzaima Note that you have a trailing space in the snippet (third challenge). That must not be printed, right?
14:05
@Mr.Xcoder correct
what trailing space
it's a pain trying to observe anything without it wrapping
could you perhaps add newlines for readability?
@totallyhuman Done.
@Christopher why was there a f tag on the sandbox?
@Mr.Xcoder lol i was talking to dzaima
14:10
maybe in another codeblock when I'd post it, but can't in the sandbox because of the 30k character limit
@dzaima I've put it on OEIS to see if there is a pattern there :P
@Mr.Xcoder pretty sure I did that when I made the challenge :p
@dzaima Worth trying
@dzaima I'm hoping to get that lifted to match the new 65536 limit on main.
@trichoplax I'm one of the upvoters :p
14:17
Oh well, worth a try :)
Here have one :P
0
Q: Help! I forgot my password!

LordFarquaadHelp! I just logged into Stack Exchange, but I forgot what my password is! I need a way to work it out before I log off. Luckily, I'm an excellent hacker. Not only was I able to find my password's hash, but I also found Stack Exchange's hashing algorithm! It takes the ASCII value of each digit ...

@totallyhuman Thanks :)
@NewMainPosts thought that was spam for a mo
@programmer5000 accident
14:32
oh
14:53
Oh hey my calculator does $e^\pi-\pi$ correctly
conjugates
Yes conjugates :P
Bored in algebra so plugging in stuff to test floating point math on calculator
@totallyhuman I do Physics when I'm bored
My next challenge (will post in ~3 mins) is called Check If my String is Prime
14:59
Calculator nailed it
@Mr.Xcoder wat
@totallyhuman Hint: ASCII
if i can golf it on my phone i'll be happy
You can, it's quite easy
Mm especially with tio
One of the most responsive sites
I was writing up something when I realise I did this:
if(/}/.test(this.firstChar())) {
15:05
What's wrong with it?
Posted//
I could have not used regex and done this.firstChar() === '}' >_>
darn, I wanna post another challenge but I've already received 160 rep today so far
eh, screw the rep-cap
@Mayube I've hit repcap 2 days ago :/
Rep cap is a really annoying "feature"
15:10
I love the rep cap
@WheatWizard I hate it
It prevents users from accumulating massive amounts of rep from single posts
Does anyone here know enough Jelly to help me make this into a test suite?
@WheatWizard How is that a good thing? I totally disagree.
@WheatWizard no it doesn't, it just prevents users from accumulating large amounts of rep in a short period of time
15:12
@Mr.Xcoder Because rep should be earned from consistent quality contributions to the community not I FGITW a simple question that HNQ'd
0
Q: Check If my String is Prime

Mr. XcoderWe define a prime character as a character that has a prime ASCII value. We define a prime string as a String that only contains prime characters. Given a String that only contains printable ASCII, determine whether that String is prime. Input / Output You can take input either as a String or...

0
Q: Randomly select a character, plinko-style

MayubeLet's see how good your language of choice is at selective randomness. Given 4 characters, A, B, C, and D, or a string of 4 characters ABCD as input, output one of the characters with the following probabilities: A should have a 1/8 (12.5%) chance to be chosen B should have a 3/8 (37.5%) chanc...

@WheatWizard I still disagree, as long as you FGITW with a well-golfed code
nvm figured the Jelly myself
@WheatWizard and yet a single user earned 2000 rep for making hello world in brainfuck
Thats because people chose to give up rep as a bounty
Case and point, this answer is Ok, put it certainly doesn't deserve 580 rep. Most of the votes are there because of the HNQ, not because the answer is excellent. I have only received a fraction of the rep that I would have because of the rep cap, much closer to what I deserve from the post.
15:17
@WheatWizard You deserved that full 580 rep. Your answer was brilliant.
@Mayube Can we assume the built-in random function in our language of choice is random?
if the built-in random function in yer language ain't random you have bigger issues
6
@CensoredUsername Does x86 have random?
it actually does
there's a hw entropy source
see rdrand and rdseed
@TheLethalCoder Status update: the lexer is now, more or less, finished. I've added arrays {123 "string" '/pattern/flags'} in addition to regex arguments.
15:33
Bonus points if anyone can find a solution to this challenge in LMBM shorter than 58 bytes ;)
oops, linked the wrong challenge, fixed
@LeakyNun does my clarification cover your question?
@musicman523 idk
whatever
1
Q: Find the Second Zero

musicman523Challenge Given an integer in 32-bit two's complement format, return the index of the second least-significant zero digit in the binary representation, where an index of 0 represents the least significant bit, and an index of 31 represents the most significant bit. If there is no second zero, y...

@EriktheOutgolfer I think the problem with your answer is that jelly's integers are of infinite length by default, not 32-bit
Ok, I found a 55 byte LMBM solution, but not sure it can get any shorter without a few new features
15:47
@musicman523 but I get unsigned
@Mayube Might be hard with no docs
Jelly doesn't have native twos complement though
yeah I still need to write those up
but on the other side I get it in two's complement already right?
for example, input 23 would first be converted into [1, 0, 1, 1, 1]
then I reverse, so now it's [1, 1, 1, 0, 1]
then I logical not so that I convert zeros to ones and vice versa, so now it's [0, 0, 0, 1, 0]
I then append another 1: [0, 0, 0, 1, 0, 1]
this ensures that I find a leading zero too
@EriktheOutgolfer what are you trying to do to 23?
15:51
@Cowsquack find the second zero challenge
then I get truthy 1-based indices like this: [4, 6]
and then I get the second item: 6
@musicman523 maybe something wrong here?
oh wait I need to assume 32-bit limit I guess
@Cowsquack Nice :) Good work
@musicman523 I think I fixed it, care to check?
@LeakyNun New Pyth Answer
Hope you can't outgolf me this time!

« first day (2361 days earlier)      last day (2777 days later) »