last day (14 days later) » 

10:32
8
A: Golf all the 16 logic gates with 2 inputs and 1 output!

jimmy23013APL, 22 20 bytes 0000 false ≡+ 0001 p and q ∧ 0010 p and not q > 0011 p ⊣ 0100 not p and q < 0101 q ⊢ 0110 xor ≠ 0111 p or q ∨ 1000 not p and not q ⍱ 1001 eq = 1010 not q ...

+1 Nice use of atops! You can save two bytes by making 0000 and 1111 into trad-fns 0 and 1.
@Adám Doesn't that add much more overhead?
No, consensus on PPCG is not to count the header, so ⎕FX'f1' defines f to always return 1.
@Adám Which consensus? You can't call 1 directly to use it as a function...
There is a consensus to allow tfns, but not to count the first line. This corresponds to not counting the filename in languages that use files as program containers with program name = filename.
10:32
@Adám Link please...
I'm trying to find it, but it was in a comment. Any idea how to search those?
I don't know how to use that. It was a comment by ngn (24908) to an answer by me (43319).
It returned nothing.. maybe the comment is deleted?
10:53
Anyway I don't think it is... Function headers are always included, unless you can make that expression alone returning a function
But I just had an idea. I could just think they are complete programs. If I could write 2 complete programs and 14 functions, then I could remove those 2 bytes.
@LeakyNun Can I?
I don't speak APL at all.
Well, can I write 16 pieces of code, where some of them are functions, some are complete programs?
@jimmy23013 The 2 programs + 14 fns is what I had in mind.
Well, your wording was a bit confusing. It wasn't the PPCG consensus to not count the header, but there is a way in APL to write that without a header at all.
Thanks.
By the way, if you are working at Dyalog... I think ngn is too
11:10
@jimmy23013 Yes, but he's sitting downstairs... It's easier to search than walk down a flight of stairs, isn't it?
Well, I'm not working there so I can't know.
@jimmy23013 Even clearer that 0 and 1 are proper programs: tryapl.org/…
Didn't realize you could use any expressions there... but adding braces isn't harmful.
11:37
@jimmy23013 Ah, yes, Dyalog APL allows constants as the left part (only) of forks, so 2,⊢ is the "prepend 2" function, and 2,⍨⊢ is the "append 2" function.

last day (14 days later) »