« first day (2334 days earlier)      last day (2512 days later) » 

12:00 PM
NOT really :)
 
@Qwerp-Derp depends on what you mean by "simplify"
 
@LeakyNun Less operators
 
you have only 3 operators
don't be too greedy
 
@DestructibleLemon I would maybe say that C is my favorite language, in general, or at least one of the languages I like the most (for certain definitions of "favorite").
 
user165474
a AND NOT (b AND c) =
a AND (NOT b OR NOT c) =
(a AND NOT b) OR (a AND NOT c)
 
12:06 PM
@Qwerp-Derp a > b AND c
 
user165474
Essentially a AND NOT (b AND c) means that a is true and one of b or c is false
 
What's your favourite language?
 
user165474
Python
 
user165474
(well that's mine)
 
@Qwerp-Derp that's a tricky one actually, last year I would've said C#, but now... hmm
 
12:07 PM
@Adám Edited
I personally like Clojure a lot :P
 
user165474
> your's
 
meh, Clojure is just JVM Lisp
 
CMC: a AND NOT (b AND c)
 
user165474
Python: lambda a,b,c:a and not(b and c)
 
user165474
Java: (a,b,c)->a&!(b&c)
 
12:08 PM
0
Q: Surrounded and reversed

ZgarbThe task In this challenge, your task is to determine whether some string occurs as a substring of a given string both surrounded by another string and reversed. Your input is a non-empty string S of lowercase ASCII letters. If there exist non-empty strings A and B such that the concatenation A...

 
user165474
wowie Java is shorter :o
 
I don't think Java can implicitly Bitwise a boolean
 
APL: a>b∧c
 
user165474
@Mayube in java, booleans don't act like ints, unlike in Python; nor vice versa, like in C
 
right, so can java bitwise a boolean without casting it to something else?
 
user165474
12:11 PM
no
 
so your & should be &&
 
user165474
@Mayube no
 
& is bitwise AND, && is boolean AND
 
user165474
& works on booleans too; it's the non-short-circuiting operator. && short-circuits which is sometimes better (like a != null && a.toString().equals('test');)
 
@Mayube Whoa there h8r, Lisps are awesome :P
 
user165474
12:15 PM
@Qwerp-Derp I still remember when we were practically tied in rep ;) :P
 
@Qwerp-Derp I didn't say they aren't, I just thing Clojure is basically Lisp + the worst part of Java
 
I'm not very active on PCG now, I'm occupied with other things
@Mayube What's the worst part of Java?
 
JVM
 
But Clojure has good interop with Java...
 
user165474
CMC: a implies b
 
user165474
12:17 PM
@Qwerp-Derp Ah. Okay. Understandable :P
 
@HyperNeutrino APL:
 
user165474
>.< nice
 
user165474
Python: lambda a,b:not a or b
 
user165474
Java: (a,b)->!a|b
 
@HyperNeutrino lambda a,b:a<=b
 
user165474
12:18 PM
oh
 
I thought you saw the solution.
 
user165474
oh wait APL doesn't have an implies builtin
 
Now do it in jelly.
 
user165474
darnit that was dumb lol
 
oh and I'll close your CMC as a duplicate of my logic gate challenge
 
user165474
12:19 PM
:( :P
 
user165474
ok brb doing jelly
 
@HyperNeutrino I was just about to post CMC: (a AND NOT b)OR(a AND b)OR((NOT a)AND(NOT b))
 
51
Q: Golf all the 16 logic gates with 2 inputs and 1 output!

Leaky NunFor example, the gate A and B is a logic gate with 2 inputs and 1 output. There are exactly 16 of them, because: each logic gate takes two inputs, which can be truthy or falsey, giving us 4 possible inputs of the 4 possible inputs, each can have an output of truthy and falsey therefore, there ...

 
user165474
Oh yeah that one!
 
@Adám what... that's just... b implies a
 
12:19 PM
@LeakyNun Exactly, but HN ninja'ed me.
@HyperNeutrino It does, but it has been extended to all reals.
 
user165474
oh yeah and then there's this
 
user165474
@Adám ah :P
 
@LeakyNun did you see some of the interesting answers to the ab+c challenge?
 
@LeakyNun The leaderboard appears broken.
 
@Lembik I still didn't see the A={2^n} one
 
12:22 PM
@Lembik Also logical AND and OR have been extended to all numbers (including complex)
 
@Adám this is the vaguest error ever
 
user165474
@LeakyNun ¬|
 
@LeakyNun I am not sure I understand. I don't think that does very well does it when you include C
 
user165474
returns <right> implies <left>
 
@HyperNeutrino what language
 
12:23 PM
@Adám As a concrete example, I want to take the product of an array of n complex numbers
@Adám I can't find any sane way to implement this so that it is fast
 
@Adám use the ppcg userscript leaderboard
 
user165474
@LeakyNun Jelly
 
user165474
@LeakyNun Use https API
 
user165474
Not surprisingly, ¬| works in both Jelly and Anyfix.
 
@HyperNeutrino Dennis did B implies A in 1 byte
 
12:26 PM
in python what is the right syntax for {a*b+c for a in A, b in B, c in C} ?
 
@Lembik ×/
 
user165474
@LeakyNun oh well must try to get that
 
@Adám sorry I don't understasnd
 
@Lembik reduce by multiplication
 
user165474
@Lembik [a * b + c for a in A for b in B for c in C]
 
12:27 PM
@LeakyNun Right.. the problem is that gcc and clang don't vectorize it well. So it doesn't take advantage of sse/avx
@HyperNeutrino ah yes! Thanks
 
user165474
@LeakyNun Fixed your leaderboard
 
user165474
@Lembik no problem :)
 
@HyperNeutrino xie xie
 
@LeakyNun so I would have to write using intel intrinsics (or gcc/clang versions )
 
user165474
@LeakyNun :P bu ke (?) qi
 
12:28 PM
@HyperNeutrino sure
 
@Lembik Some of our most recent speedups are by using vector instructions. Yeah, the C compiler doesn't "get it", so our coders had to do it manually.
 
@Lembik what is this for?
 
user165474
also I've heard "bu yong xie" be used
 
@LeakyNun I want to compute the permanent of a matrix quickly
@Adám I don't even really understand how to do it manually as it then seems you need different code for sse and avx for example
ICC works well.. I just don't have it
 
@Lembik J: +/.*
 
12:30 PM
@Lembik in what language?
 
maybe I could learn how to use inline assembly and steal the assembly from ICC online :)
@LeakyNun C but only because I can't think of a better language
@Adám I don't understand it when you just post characters!
I need words :)
 
user165474
@Lembik welcome to code golf
4
 
@HyperNeutrino but we are not talking about golfing :)
 
user165474
owow you have a higher network score than me
 
who does?
 
user165474
12:32 PM
@Lembik you
 
ah... I wouldn't take that seriously :)
 
@Lembik We have all kinds of special cases… Next up is using a different representation for decimal floats depending on system architecture.
 
but I bet I have given more away than you!
 
@Lembik J is a language. +/.* is the command.
 
@LeakyNun does the J compiler vectorize complex arithmetic well?
 
user165474
12:32 PM
Ah :P You have more rep though because I only have a decent amount of rep on 2 sites; the rest are all assoc+1
 
@LeakyNun I thought that was APL
 
@HyperNeutrino but how much have you given away :)
 
@Lembik I think so
2 mins ago, by Adám
@Lembik J: +/.*
In general, J doesn't mean APL.
2
 
@LeakyNun I doubt it.. but unless it is on godbolt I will never know
 
user165474
@Lembik not much, only 350 in 4 bounties
 
12:33 PM
ಠ_ಠ missed the "J:"
 
unless you can show me the assembly you get from taking the product of an array of complex doubles?
 
@KritixiLithos In SAX (SharpAPL) it would be +.× (monadic)
 
@HyperNeutrino hmm.. how do I count the total I have given away?
 
I have given away 500 rep in one bounty
 
@Lembik (Interpreter.) Not sure. Dyalog has two former J devs but none of them are in the office today. It is open source though, so…
 
12:35 PM
can you see how much I have given away?
@Adám the basic problem is that the gcc devs seem to think that people who do complex math shouldn't code in C
which is just stupid
 
user165474
@Lembik from your top 6 sites, none
 
@HyperNeutrino from ppcg?
 
CMC : make J mean APL
 
user165474
@Lembik a bunch of sites
 
user165474
@Adám #define J APL
 
user165474
12:37 PM
alias J=APL
 
@HyperNeutrino no sorry I meant how much on ppcg
 
user165474
@Lembik also none
 
user165474
...
 
@Adám looks like a dead man to me
 
12:37 PM
@Lembik Both Dyalog APL and J are written in C, so somewhere in there, there's complex math written in C.
 
user165474
wait did I check the wrong profile or something
 
right .. with terrible simd code :)
 
user165474
dafuq?
 
@HyperNeutrino you only looked at active ones I think
 
user165474
ಠ_ಠ indeed
 
12:38 PM
@LeakyNun Wouldn't that be ×.× ?
 
do I win? :)
 
user165474
wow you've given away more rep than you have lol
 
user165474
well I mean there's no "winning" or anything
 
@Adám tomato tomato
 
@HyperNeutrino yep.. I see no value in rep
except to give it away
which I enjoy doing
I really want to ask a complex math/simd challenge now :)
 
user165474
12:39 PM
@Lembik and to access mod tools to kill spam but that's not a real problem on PPCG especially with our current diamond-mod team
 
true
 
user165474
Also, even if you added all of your bountied reputation back to your account, you'd still have less rep than all of us :P
 
:)
(that's me)
loser!
 
user165474
oh that's why
 
user165474
you don't answer much
 
user165474
12:40 PM
you have a 64:1 challenge:answer ratio
 
user165474
so upvotes don't mean as much for you :P
 
user165474
(mean -> earn)
 
user165474
and your only answer has no votes
 
user165474
*had
 
yes!
I am more questions than answers ;)
 
user165474
12:42 PM
WAY more
 
yep.. and the answer isn't a real answer
it was an answer to my own question
I should delete it :)
 
user165474
¯\_(ツ)_/¯ that's not disallowed
 
I also, controversially, only really like the PP part of PPCG :)
 
CMC: make a lookup index; given "missisippi" return:
m 0
i 1 4 6 9
s 2 3 5
p 7 8
 
12:44 PM
ಠ_ಠ that's a builtin in APL
 
@KritixiLithos Almost.
 
thanks for the upvote!
 
user165474
no problem :P
 
user165474
s/si/ssi/ @Adám
 
@Adám Dyalog APL, 6 bytes, (⊣,⊢)⌸
 
12:45 PM
@HyperNeutrino Well, given that string return that output.
@KritixiLithos Please golf that!
 
user165474
@Adám ಠ_ಠ
 
{⍺⍵}⌸?
 
@KritixiLithos Nope, that's not right.
@KritixiLithos For all functions f and all arguments A and B it is true that A(⊣f⊢)B is equivalent to A f B
 
doh, so it must be ,⌸
I don't know why it went over me
 
@Adám 1-indexing?
oh, @HyperNeutrino I'll leave the Jelly to you
 
12:54 PM
@LeakyNun Either.
 
user165474
@LeakyNun ok, will try it out
 
user165474
why do I remember there being a builtin for it?
 
@HyperNeutrino There probably is, since J has /.
 
@Adám sorted by first occurence?
 
@LeakyNun Sure, but really any order would be fine.
 
1:01 PM
this might be a nice challenge on main
 
@KritixiLithos I thought that it was trivial in more langs than APLs.
 
@Adám Sorted by letter, Pyth, 15 bytes: jjL;+V{SQ.g@QkU
@Adám sorted by first occurrence, Pyth, 15 bytes: jmj;+dfqd@QTUQ{
 
Nice.
 
that doesn't look as trivial ∧∧
 
@KritixiLithos How would you do it in APL if you wanted sored by letter?
 
1:03 PM
but then again, I might underestimate the power of golfing langs
@Adám that would be interesting
 
@KritixiLithos I can see two approaches.
 
0
A: Sandbox for Proposed Challenges

GryphonAm I a Sphenic Number? A Sphenic Number is a number that is the product of three distinct primes. This is sequence A007304 in the OEIS. Your Task: Write a program or function to determine whether an inputted integer is a Sphenic number. Input: An integer between 0 and 9^12, which may or...

 
Why did my C# answer that just hardcodes a string get 4 votes when the Java answer that does the exact same thing get none?
 
Will we have Google Assistant in Pyth
 
Google Assistant, coming to Braingolf 2k18
 
1:15 PM
@Adám Pyth, 13 bytes: jmj;+dxCdCMQ{
 
@LeakyNun I'll post to main.
 
@HyperNeutrino have you come up with the Jelly solution?
 
Graduation script fail:
 
0
A: Sandbox for Proposed Challenges

GryphonAm I an Automorphic Number? An Automorphic number is a number that's square ends with the same digits as itself. This is sequence A003226 in the OEIS. Your Task: Write a program or function to determine whether an input is an Automorphic number. Input: An integer between 0 and 10^12 (in...

 
I'm not sure how describe this, but given a string up odd length, e.g. "mississippi", return:
     missis
    mississ
   mississi
  mississip
 mississipp
mississippi
ississippi
ssissippi
sissippi
issippi
ssippi
 
1:31 PM
0
Q: Make a lookup index

AdámGiven a string, return a table where the first column has the unique letters of the string in order of occurrence and subsequent columns list the indices of that letter in the string, using zero or one-based indexing. Horizontal whitespace does not matter, as long as the left-most column is verti...

1
Q: How do I exit VIM?

MayubeVIM is a great text editor for unix systems, but it's notorious for being difficult to exit. Write a full program that will output :q to exit VIM. It should then read a single line of input, as it will then either be given a bash prompt, in which case the exit was successful, or an error, in whi...

 
@Adám very long
 
@LeakyNun whoa, that's is long.
 
I think a more straightforward implementation would be shorter
because I basically constructed the diagonals
I'll golf it later; not available now
 
user165474
@LeakyNun Not yet; I'll work on it in a few days when I'm done exams.
 
how about a challenge to open an emacs document, type "Help!" in the document and then quit emacs
 
1:40 PM
just see my 7-byte Jelly answer btw
 
CMC: Output nth composite number.
where n is given as input.
 
@EriktheOutgolfer I think we can compete on the string challenge just above
I mean, the string CMC
 
I have no idea how to get python to enter ctrl-x ctrl-c
 
@LeakyNun oh...must be the feeling that strikes you when you have just done real life and lightning-fast Jelly...I accept the challenge
btw why am I leaving the speaker to 100% just to hear a ping like a loud lightning right next to my ear...
 
@EriktheOutgolfer To stay awake?
 
1:46 PM
@totallyhuman bonus points if you can do the exit Vim challenge in Braingolf
 
no when Leaky pinged me I had the speakers sooo loud...and that happens every. damn. time.
 
@Mayube heh
 
@Mayube How about in Vim?
 
shouldn't be too bad
 
I got close, but I couldn't figure out how to conditionally append the !
cos no nested conditionals :/
might help you out a lil :P
 
1:47 PM
hold on lemme completely out-golf the other python answer ><>
 
@Adám not sure if it's possible actually, given it requires reading input
 
0
A: Sandbox for Proposed Challenges

GryphonAm I a Harshad Number? code-golf decision-challenge number A Harshad number is a number that is divisible by the sum if its digits. This is obviously dependent on what base the integer is written in. Base 10 Harshad numbers are sequence A005349 in the OEIS. Your Task: Write a program or fu...

 
Ideal?
 
@Mayube May we output a newline upon terminating? — Adám 6 mins ago
pls answer my answer depends on this
 
Mine too
 
1:52 PM
@totallyhuman answer: yes
 
@EriktheOutgolfer rip ear
 
hey it's not that loud
 
so this is valid?
(you can check by changing the ':' to '@')
 
@totallyhuman yes
 
1:57 PM
@EriktheOutgolfer progress?
 
something is paranoid
 
maybe tomorrow I'll do a popularity contest where the goal is to cause Vim to close. Anything your program outputs is passed to Vim, anything Vim outputs is passed to your program.
@tuskiomi maybe PPCGCGCGCGCGCGCGCG is more fitting
 
:)
 
@totallyhuman nice one with the 'N' in input(), we are tied now :)
 
Let's change name to CGPP ;-)
 
2:00 PM
@Adám Sorted key: ,⌸⊂∘⍋⌷⊢
 
@KritixiLithos No that is "key sorted", we wanted "sorted key".
 
then what is the output for "mississippi"?
 
@KritixiLithos However, I really like your sorting function. I have not seen it before, and it works neatly for higher rank.
@KritixiLithos That's a bad example, as the letters occur in abc order. That's why I used other examples on Main.
@KritixiLithos 'abracadabra' should give:
a 1  4 6 8 11
b 2  9
c 5
d 7
r 3 10
 
oh I see, I didn't realise my output was sorted
 
@KritixiLithos input
 
2:08 PM
0
Q: ASCII Reverse Quine

carusocomputingOkay, so everyone is familiar with the ASCII-table, correct? I'd hope so. I've been going to that site for my asciitable reference for as long as I can remember needing one. We'll be doing some fun source-code manipulating using the ASCII keyspace. The Task Your task is to write a program tha...

 
@Adám I don't know how to approach this
 
i have a program like this: input(); dosomething(); input();
i dont want the things that the user wrote during dosomething() to interrupt while getting the next input()
but i dont know if the user wrote anything.
how can i clear stdin, even if it's empty?
should i ask on SO?
 
@NewMainPosts what is with carusocomputing and their funky winning criterion
 
what is the language, Python?
 
C
 
2:11 PM
May I ask why?
I guess what I mean is, why not allow whatever the user typed during doSomething() to be the next input?
 
@LeakyNun ok this is getting hard...over 29 already :(
 
@musicman523 it'a actually a game, and dosomething is actually usleep+puts. i'm trying to time how cfast the user reacts, but every input method collects the things the user wrote on usleep
 
@betseg This is a synchronization problem that I don't think can be solved. Even if you can clear stdin, by the time you print "Go!" and start timing, the user could have typed more
 
then i guess i'll write "plz dont cheat and type while the program sleeps thx"
 
I think the right way to do this is with some sort of keyboard listener, where every key press is logged with a timestamp and you simply ignore key presses that occur before the start of the round
 
Unfortunately that makes it quite complicated to code up, especially in C
 
@LeakyNun finally
 
@EriktheOutgolfer finally over 30?
 
@LeakyNun yep but also finally done...
 
congratulations
 
2:19 PM
have you tried that yet?
 
so my solution is 10 bytes below you lol
 
yeah I got a bit tired when I was so rushing to ninja you on Adám's challenge
 
@KritixiLithos Two ways: Either prepend the sorted unique vector to the input, drop the first occurrence of each, and adjust indices by the number of unique chars, OR sort Key's output by its first column.
 
-7
Q: Count from 0-100

pudilityChallenge Output all numbers from 0-100. Without using any of your languages built in loops. Loops that are not allowed This list contains, but is not limited to For loops While loops Do While loops Goto Statment In Range Rules This is code-golf the shortest solution in bytes wins Standa...

 
@NewMainPosts so the lowest vote record?
 
2:22 PM
Lol who downvoted my answer on that
I thought it was funny
 
tfw you're about to answer a question in go then you realize go is a nightmare
 
> how to exit Vim in Go
actually wouldn't be too difficult, just not very golfy
 
@totallyhuman a professor who I really respect likes Go a lot so I looked into it but it's just so ugly
 
Go is great if you're already good at Python and want to work for Google
 
i usually use function arguments or command line arguments for input
because stdin is a nightmare
 
2:23 PM
braingolf usually does that too
 
@NewMainPosts BUTTER
eat it this time.
 
import(."fmt";."bufio";."os";."math/rand")
 
@LeakyNun umm what's your solution?
 
53 mins ago, by Leaky Nun
 
fmt for stdout, bufio for i/o, os for stdin (just the object) and math/rand for random numbers
 
2:27 PM
ooh i wanna see a solution to the Vim challenge in V
 
@LeakyNun hmm...I can't seem to comprehend it lol
but you can save a byte
 
@totallyhuman oh and i need to seed the prng with the time
which needs another import
 
CMC: Given a number n, sum its digits, then sum the resulting number's digits, etc. e.g. 5689 -> 28 -> 10 -> 1, so an input of 5689 should yield 1.
 
hey @totallyhuman in python2 can you pass an argument to input() to have it print that before the input?
 
Isn't that just digital root
 
2:39 PM
for example input('>') for a REPL, or input('What is your name?')
 
@Mayube You could try it online and find out
 
@Phoenix APL: (+/⍎¨∘⍕)⍣≡
 
@Phoenix hmm, nevermind then, looks like it also prints the resulting input
 
@Mayube Maybe because I added in a print statement.
 
ninja'd
 
2:42 PM
@Phoenix oooh yeah there we go
@totallyhuman would your Vim thing be any shorter if you did 'N'in input(':q')?
 
@Phoenix I tihnk this is a dupe
 
@Mayube ooh
 
IK finding the sum of the digits exists, but IDK about doing it recursively.
 
I'd have to add a newline but it might work
 
@Phoenix yeah a recursive sum
 
2:43 PM
3
Q: You are the Host of the Olympics!

Mr. XcoderYou host the Olympic Games, and need to build a fantastic pool for the sake of the occasion, but the supervisors often change their mind regarding the dimensions, and need a quick way to rebuild it with the requested size! Given two integers, L and x, your task is to build a swimming pool of l...

 
@ATaco What's wrong with a-ta.co?
 
@Mayube nice another byte off
 
a-ta.co refused to connect.
Search Google for co
 
@Phoenix Braingolf, 21 bytes: V1[Rdl1e_v0>:&+v1+|]R
 
co is not the part of the url that generally contains useful information.
 
2:46 PM
@Phoenix Python: lambda x:~-x%9+1
6
 
0
A: Sandbox for Proposed Challenges

pudilityCounting from 0 - 100 I posted this question, but it was not taken very well, so I wanted to put it through the sandbox and get some feedback/help before re-posting. Challenge Output all numbers from 0-100. Without using any of your languages built in loops. Loops that are not allowed This l...

 
@BusinessCat +1, that is very neat
 
@totallyhuman also you know the spec never said the :q had to be followed by a newline
 
o.o
O.O
 
all it says is output :q, read input, output based on the input
 
2:50 PM
@LegionMammal978 ono IP change again I suppose
 
@EriktheOutgolfer so do you comprehend it now?
 
erm not exactly yet...you make the spaces and interleave with the string or something?
 
@EriktheOutgolfer no, look at the third-to-last monad I used
 
@BusinessCat *golf clap*, 10/10 formula
 
@LeakyNun that diagonalizes right?
 
2:53 PM
I've been looking at it for a while, and I still can't figure out why it works though.
 
@totallyhuman now I feel bad cos he outgolfed you :C
 
@EriktheOutgolfer builds from diagonals
and if you look at the diagonals
you'll notice that they are all runs of the same character
 
Hey it was a good run, we both did well!
 
@LeakyNun that's what I meant...i.e. apply diagonals
 
alright
 
2:59 PM
aie but i still continue to get upvotes >.>
 
@Mayube the spec for your question says each possibility has a non-zero probability of being chosen. Is it okay if the probability depends on the platform (i.e. ':q!' would never be chosen if running in Jython, and ':x' would never be chosen in Cython)
 
@musicman523 in that case the code would be invalid on either of those platforms
 

« first day (2334 days earlier)      last day (2512 days later) »