« first day    last day (215 days later) » 
18:00 - 20:0020:00 - 00:00

18:12
Hi all
Who's first to make a CMC?
@HyperNeutrino what does partial function mean here
So like map(function, list) does what you'd expect, and map(function) returns a function f such that f(list) == map(function, list).
@HyperNeutrino oh that's really cool 0.o
CMC: Sum all the odd elements from 1 to a given positive integer higher than 1 (both inclusive). No text-solutions, spoilers + byte count please.
5 -> 9
@Mr. Xcoder 30 bytes
18:15
o I had 32 :(
@HyperNeutrino uh is .. broken?
@StepHen no...? why do you think so?
wait me stupid
@StepHen No, you probably want +1 because it is half-inclusive
18:16
@HyperNeutrino Outgolfed you in your own lang twice. Spoiler to yours?
nvm 22 bytes
I mean, you just had >0 right?
@HyperNeutrino gimme a little and I'll catch up :P
18:16
I'm not using any special Proton features
@HyperNeutrino How does filter work? What's the syntax?
@HyperNeutrino Yeah I got that too
filter(condition, list)
But you don't need that...
@BusinessCat nice
Assuming I understand the challenge...
18:18
@HyperNeutrino what does (+) do again?
@HyperNeutrino No list comprehension, right?
I thought it made + a function
Sum odd numbers between 1 and input inclusive?
@Mr.Xcoder nope
@BusinessCat Yes
18:18
@StepHen (+) returns a function that does +
Yeah then 22
@HyperNeutrino Try it online! what am I doing wrong
Lemme solve it too
@StepHen That's doing (+)(1), (+)(2), (+)(3) :P
18:19
Try reduce
@LeakyNun math to the rescue
@LeakyNun weird math stuff?
@LeakyNun Nope, you probably forgot inclusive
@HyperNeutrino not weird if you know the math
I mean, I had 12 too
18:19
@Mr.Xcoder just test it
@LeakyNun Yeah, it's wrong
oh wait I just remember what summing odd numbers does... :D
5 yields 4, not 9
@LeakyNun How did I not realize this
and I feel dumb for not realizing :P
I think we've arrived at the optimal solution
@LeakyNun -~ isn't too much different from +1
18:21
@Mr.Xcoder yours doesn't work for 6
@StepHen I came up with it independently
@LeakyNun ik
@LeakyNun Nor does yours
They both give 16
@HyperNeutrino : switch ^ and **
@StepHen no
18:22
boo
@Mr.Xcoder why on earth would // take precedence over ~ @HyperNeutrino
Wait, we aren't done
@LeakyNun Who knows?
Hyper done broke it
Let me run the parser on something
o woops
18:24
$ echo -~a//b > test.proton
$ parse test.proton
AST:<Token type=unifix_operator content=-> (prefix/expression)
|       <Token type=unifix_operator content=~> (prefix/expression)
|       |       <Token type=binary_operator content=//> (expression)
|       |       |       <Token type=identifier:expression content=a> (expression)
|       |       |       <Token type=identifier:expression content=b> (expression)
Welp
@HyperNeutrino : l=>l*(l+1)//2-l and -: 'int' and 'NoneType'... Why?
TIO to exact usage?
Might wanna fix that
wait, the maths doesn't work @LeakyNun
I think
@HyperNeutrino Tio
18:25
since it has to work for both evens and odds
@StepHen sum of odd numbers is perfect squares
@StepHen It doesn't
@StepHen (l+1)//2 would work
if Hyper didn't bork -~l//2
oh right intdiv
me stupid
CMC: Divisors of a given positive integer.
12 -> [1,2,3,4,6,12]
18:27
rip I need to fix a part of my parser
@Mr. Xcoder 27 bytes
@Mr.Xcoder you know you can reply to yourself, right?
@StepHen I do
@StepHen like this
I think I golfed it
@LeakyNun filter?
I was just solving with that
@Mr.Xcoder yes
I think that's it
@Mr.Xcoder yep, identical
18:30
25 bytes copied from you two though
CMC: Check if a number is prime. cc @HyperNeutrino Does proton have any kind of any / all syntax?
sigh well I fixed it but with a really hacky thing
@StepHen Mhhm, logical not?
@Mr.Xcoder just any and all functions
18:31
@HyperNeutrino why is operator precedence so hard, it's easy in my cQuents interpreter :P
@StepHen Because I made my own parser and it's really bad :P
@HyperNeutrino but I did too
and mine works flawlessly
can I see yours
@Mr.Xcoder yep
@HyperNeutrino yeah but it's ASTs so I dunno if you'll copy it or no
see I never learned anything like this so I am doing everything from scratch without knowing how to properly do anything
@StepHen mine uses ASTs too
18:33
@HyperNeutrino starting here and down
it's not very dynamic though
Pfff.. This is a valid Proton program: ([x for x:9..l if ])
I'm going to make those 6 functions 1 function when I rewrite
ASCII-only was disappointed in me using a regex-like parser but he didn't seem opposed to PEG parser which is the same thing :P
@Mr.Xcoder yeah cuz the if isn't matched so the list contains two children, only the first of which is ever interpreted
@StepHen thanks
18:34
@LeakyNun 26?!
@Mr.Xcoder wat
nothing
wait what CMC is this now
@HyperNeutrino prime
@HyperNeutrino prime
18:35
ok thanks
@HyperNeutrino it parses stuff like ** first and stuff like ~ last
@HyperNeutrino scratch that it does it in a weird order
operator functions and argument binding ftw \o/
18:37
@HyperNeutrino 1 is prime
bitwise bin ops -> +-` -> */ -> ^ -> unary ops
@Mr.Xcoder ... no it's not
@StepHen In his program
@Mr.Xcoder oh xD
Wait, that applies to mine too
18:38
rip
well leaky's checks for it so :P
wait, it this gen primes or is prime
@StepHen is prime
the footer gen primes
That makes mine 27 bytes then :(
I need to learn how to golf in my language :(
4
18:40
@HyperNeutrino Does all require all([]) or just all() as in Python?
@Mr.Xcoder generators work
Yyyaay, 26 then
@HyperNeutrino yep, Leaky Nun outgolfs everyone in every language, even if they are their creator
@LeakyNun yup :(
:P
18:42
@LeakyNun Even Dennis in Jelly or isaac in Pyth? :P
Every language has its own mindset. My mindset when using Proton is too heavily focusing on function composition stuff whereas usually doing it the more trivial and Pythonic way is shorter (since Proton is very similar to Python after all :P)
@Mr.Xcoder :P
(IIRC I learned this stuff about programming mindsets from you @LeakyNun in JHT :P)
Next CMC
CMC: Sum all of the even numbers from 1 to n exclusive, without using the symbol =
This prevents you from making an anonymous function :D
18:43
that should be easy
@HyperNeutrino does it have to work for odd numbers?
@HyperNeutrino :c
how do you even define a function
18:45
Wait... You cannot assign the int(input()) to anything without =
I mean, you just use existing functions and chaining
@HyperNeutrino how do you chain?
@Mr.Xcoder you don't need it
realized
I think
ANd probably bad
@BusinessCat nice
but it doesn't work for even numbers
18:47
It's supposed to be exclusive
@BusinessCat But it has to work for evens.
@HyperNeutrino I really need to write cQuents 1
@Mr.Xcoder :P
18:48
@HyperNeutrino What is your current byte count?
@HyperNeutrino it includes 1
@StepHen no it checks for oddness ಠ_ಠ
Wait, even you said? I though they were odds
oh lol
18:49
@Mr.Xcoder yes :P
3 mins ago, by Leaky Nun
@HyperNeutrino how do you chain?
@HyperNeutrino please
Try the || operator: x || y => (y % x) == 0
@LeakyNun func + func
@HyperNeutrino is it new?
f1 + f2 is the same as x => f2(f1(x))
@LeakyNun no it's been around for a while
18:50
@HyperNeutrino wow
@HyperNeutrino why would func + func imply x=>
@HyperNeutrino Do you use a full program?
@StepHen no that doesn't
@StepHen because func + func returns a function
@Mr.Xcoder no
18:50
x=>f2(f1(x)) itself is another function
How do you define a function?
ooh
@Mr.Xcoder a first-order citizen /s
reads syntax
@HyperNeutrino how do you call a dyad with the same arguments
> dyad
Not Jelly
@HyperNeutrino Any hints, even slight ones?
Anyone?
18:56
@HyperNeutrino is this supposed to work? Try it online!
@HyperNeutrino do you have anonymous functions (not arrow) like JS has? JS has name = function(args){}
instead of function name(args){}
Did we kill the room or something?
CMC: Output nth prime
print("nth prime")
19:03
Loophole
@BusinessCat _=>"nth prime"
bye o/
I need a version of Java where ; is replaced with o/
System.out.println("Hello, World!") o/
What if our natural language also ended each statement with a semicolon;
@BusinessCat what if programming languages ended statements with periods...
19:05
Prolog does
hi sorry left for a bit
we could just adopt European decimal point: 1,0
@BusinessCat That is not a statement that is a question
Are we still doing the same CMC?
@HyperNeutrino we aren't doing any anymore
19:07
I'm not because I have work to get done ;_;
Has anyone gotten the 25 byte solution for the sum even numbers CMC?
@HyperNeutrino although I have one unanswered:
6 mins ago, by Step Hen
CMC: Output nth prime
I'd rather write Proton than English though
@HyperNeutrino no one knows your Proton-specific syntax yet :P
and no
19:08
@StepHen Reminds me, I should add an nfind function
2&(..)+filter(2&(||))+sum
@HyperNeutrino so where does the input come into play...
0
A: Reduce string to a snippet of the alphabet

Mr. XcoderProton, 59 bytes Port of the Python 2 submission. s=>reduce((x,y)=>x+y*((ord(y)-ord(x[-1]))%32==1),s.strip()) Try it online!

function call
Anyone, golfing suggestions ^^
?
@HyperNeutrino tfw .. is also a function
19:09
no it's an operator
@HyperNeutrino This language is pretty much becoming Perl at this point
@LeakyNun it's not, () makes it one
@BusinessCat lol
@HyperNeutrino Is Proton supposed to be a combination of Python and Java, with the most golfy features from each?
And JavaScript and Cheddar
19:11
@Mr.Xcoder more like Python and JavaScript
Cheddar? Downgoat would be proud
If anyone has golfing suggestions, drop a comment
Starring Proton, developed by Mr. Benzene Ring himself
CMC: square a number with function chaining
@HyperNeutrino please halp Try it online!
@LeakyNun valid?
19:24
@Mr.Xcoder of course not :P
Not sure what func chaining is
@StepHen it takes two arguments ಠ_ಠ
@Mr.Xcoder f1 + f2
16 mins ago, by HyperNeutrino
2&(..)+filter(2&(||))+sum
@StepHen ಠ_ಠ
19:24
:)
@HyperNeutrino still breaks
@LeakyNun I read without >_>
Duh
@StepHen First of all putting & in front of it is guaranteed to fail because binary operator functions require two arguments and & prevents it from having more than one argument
@LeakyNun Byte count?
@LeakyNun 6 bytes valid?
19:26
valid
@Mr.Xcoder 6 bytes
yay
Here's 16 bytes: (x=>x,x=>x)+*(*)
@HyperNeutrino I think I understand this syntax now
@HyperNeutrino How does this syntax work? Pls explain
It seems it turns an operator into a function
And you can use & to specify the argument of one side
19:28
@HyperNeutrino Pls explain
Then, (*) is a function that multiplies and *function automatically splats the arguments
(x=>x,x=>x) is a tuple with every element being a function, so it becomes a function, kind of like distributing functions over arguments
Finally, + chains them together
@HyperNeutrino Got it... Like (+)&3 adds 3 to the parameter, right?
19:30
@HyperNeutrino ok, I'm confused
how does 2&(..) work
but also (**)&2
2&(**) also works
@BusinessCat but it does something different
and &2(**) is invalid
2&(..) is equivalent to x => 2..x
whereas (..)&2 is equivalent to x => x..2
@Mr.Xcoder +1
19:34
CMC: Check if an integer is triangular
cc @LeakyNun @StepHen @HyperNeutrino
@Mr.Xcoder oh god why
Don't know, just in case you wanted to leave for inactivity
sorry
@Mr.Xcoder no that wasn't what i meant
@LeakyNun oh, I want it to be challenging
Using the cool math thing :P
19:37
@HyperNeutrino again, why doesn't this work: Try it online!
HINT TO EVERYONE: A number n is triangular iff 8n+1 = x^2, x in N.
@StepHen Why is your print statement in the input field? :)
@HyperNeutrino good question
ಠ_ಠ :P
I did the exact same thing >_<
19:41
sigh
@HyperNeutrino 32 bytes :'-(
About double
um why are you doing n==int(n) rather than n%1==0 or 1||n
:O Forgot the trick
@HyperNeutrino how do you do default args in =>
@HyperNeutrino Is this it?
19:44
@StepHen well you have to use a nullable like a?? => ... and then check if the argument name exists
@Mr.Xcoder yup :)
@HyperNeutrino uh... show me? :P
Why doesn't n=>-~8*n**2 work... Gotta fix the operator precedence
@HyperNeutrino why isn't this valid... Try it online!
CMC: Print a diagonal line of length N.
19:46
because I didn't implement that
Like, N=5:
\
 \
  \
   \
    \
No, list of lines not allowed
@HyperNeutrino ok what am I doing wrong here? Try it online!
I don't know either
and no, nothing's in the input
@StepHen in?
19:49
I just noticed that the -c flag in proton doesn't work.
@Mr.Xcoder in python it's be for i in range(0,n)
so why doesn't for i in 0..n work
Well, not that it would solve the challenge anyway
But my question still stands
Isn't it for i:0..n in PROTON?
@Mr.Xcoder maybe
@Mr.Xcoder nope still borked: Try it online!
19:50
Still
same error
so I think in is still legal
o '\\' itself is borked
BORK ALERT 🚨 BORK ALERT 🚨 BORK ALERT
@HyperNeutrino Why?
Borked ^
"\\" is borked
@HyperNeutrino still borked after I change to "/"
@All You can use any char instead of `\`
19:53
I killed string literals by accident
@HyperNeutrino oh fun
@Mr.Xcoder this still doesn't work though: Try it online! cc @HyperNeutrino
I think backslash escapes were borked
19:55
@BusinessCat \n isn't
@StepHen for i:0..n{print(" "*i+"X")}
@StepHen Since when did Proton use colons?
This is how it is supposed to work and look
19:56
oh ok me stupid thanks
@StepHen @Mr.Xcoder That's a snippet though.
You cannot hardcode stuff
@Mr.Xcoder I know I was testing it
@HyperNeutrino thank you for allowing stuff in lambdas :P
Proton will be my go-to for lambdas that actually need to do something
19:59
np :D
18:00 - 20:0020:00 - 00:00

« first day    last day (215 days later) »