@Jonah Thank you for this. Just earlier this evening, I wrote an email suggesting the addition to APL of what is essentially L:. But I wasn't aware that L: existed until you just made me aware now. Anyway, it shouldn't be necessary for scalar functions.
Anonymous
@ThomasWard If you want, I can change my avatar to laser-eyed penguin :P (but you have to make it)
@Adám yw. on the subject of APL / J crossovers, is there a translation of your answer here to J? The only way I can think to do it in J is: 1&|.@{. , }. which isn't quite as nice as saying "apply the verb to this index"
@Jonah Yes, it was added with version 16.0 this summer. In general, no APLs other than Dyalog and NARS have added any new primitives to APL in the last 25 years.
@Jonah Iverson's paper doesn't even resemble APL! I would definitely go for Dyalog, and if you want a book, then Mastering Dyalog APL is the best. Dyalog has added a few things since the book came out, but they are mostly from J, so you should have an easy time picking those up.
@Jonah Not if you're trying to learn APL; it will just confuse you by using entirely different symbols and notations. It does have historic interest, if you're interested in how APL/J became what they are.
@HyperNeutrino Because 1 number only have 1 representation, unlike normal base (e.g., base 10) when a number (e.g., 5) have multiple representation (5, 05, 005, 0005, etc.)
@ATaco Well, you can post a Mathematica solution, but it is not very interesting (expect downvote). Golfing language can't be defined objectively anyway.
I guess you just need current = time(); while (time() < current + N) {}?
Anonymous
2:46 AM
@user202729 a) That probably should qualify under "sleep and similar". b) If CPU resources are being hogged by other processes, time may not have enough precision between calls to get within 1 second.
@Mego No sleep function is implemented so that it takes that much resource. Also if CPU resources are hogged the program may not have enough resource to exit either. (<- Didn't try in practice, may be wrong)
Hmm, unusable esolang idea: instead of different instructions, the language tries to execute the same set of instructions in a loop, and the commands control where in the loop breaks happen to get the desired output.
Anonymous
@ATaco I find that computers become very inconsistent when cats are allowed near their power cables
Probably. So you can write a program like int input; std::cin >> input; for (long long i = 0x12345678LL /* magic number for this computer only */ * input; i --> 0;);
My 11 year old son, wants to start programming. He has a 3 months holiday span. I have no idea how to start him or what program to start him with.
He loves gaming and was asking me if possible how to program games.
So here I am, asking advice from the experts in Programming on this platform.
Tha...
Recently, the question rate on PPCG has dropped significantly. I haven't looked through the numbers all the way back, but we once had 9.9 questions per day.
The number of questions per day is of course not the best measure since we want good question, not bad ones, and 90 % of everything is cra...
Community randomly bumps old unanswered posts (at least on SO), to attract attention. Would it be possible to randomly bump upvoted, but abandoned posts in the Sandbox? This is related to this old meta post by @MartinEnder.
I realize that we (most likely) can't have a bot do this, since it wouldn't pass "are you a human" test. But, can this be done in some other way?
I'm willing to write a comment on one (or a few) random old upvoted post(s) a few times a week, saying "Up for grabs" is added if OP doesn't reply within a week. Then edit it one week after, so that it gains attention and let someone finish the challenge if they want to.
@muddyfish Pyke feature-request: Group the list L into runs of equal adjacent elements. [1,1,1,4,5,6,6,7,7,3] -> [[1,1,1],[4],[5],[6,6],[7,7],[3]] (maybe it already exists but I couldn't find it.
Concatenative counting
source-layout code-challenge number
Your challenge is to write N snippets of code such that, when you concatenate the first K together, they produce the number K. The higher N, the better. Here's the catch: you may not use any character more than once across your snippets...
⍺ ⊆ ⍵ begins a new partition in ⍵ whenever the corresponding positive int in ⍺ is greater than its left-hand neighbour. Zeros in ⍺ omit their corresponding items in ⍵.
⍺ ⊂ ⍵ begins a new partition in ⍵ whenever the corresponding Bool in ⍺ is 1. Zeros in ⍺ join their corresponding item in ⍵ to the current partition, or drops them if there is none (i.e. the leftmost partition has not begun yet.)
Four Colors in Hex
(Meta: this is pretty rough just so I get my idea down and don't forget it)
Given a hexagonal tiling, change the characters' colors (via ANSI codes, image manipulation, etc.) so that the Four Color Theorem holds for your coloring. The twist is the middle of the hexagons (the ...
Suppose an infinite tiling of hexagons composed of |/\ characters.
/ \ / \ / \ / \
| | | | |
\ / \ / \ / \ / etc.
| | | |
\ / \ / \ /
Given input n > 0, output a triangular portion of that tiling as depicted in the below examples, anchored with a _ in the middle of a hexa...
Symmetric Ladybugs
code-golfascii-art
Introduction:
When we think about Ladybugs, we usually think of a red or dark orange bug with black spots. Although this isn't necessary true, since there are also black with red/orange spotted ladybugs, or ladybugs without spots at all, we mainly picture ...
@Adám stupid question, but should we assume that inputs will always be able to be split evenly? What if we get a list with 7 elements, that won't split evenly.
it's inline so it doesn't clutter chatroom too much. excessive is more so when someone posts like 3+ messages only containing emoticons which takes up vertical space
I've never had my messages trashed for having 5 emoticons in one line (as long as I still make sense) or for posting a single ":P" on one line (which I've done at least like 500 times :P)
Today I was checking whether two implementations of the same algorithm were giving the same results. One was in Python, the other in x86 assembly. They didn't agree. After a while I found a bug in the one in Python...
Given an email address, the result of a transformation applied to that email address, and a second email address, return the output of the same transformation applied to the second email address.
The email addresses will all have the following structure:
A string of positive length containing a...
Below is my c-code
int main()
{
int a =20,i;
for (i = 5; i >= 1; i --)
{
int a= a; //why not throwing the error here. //
Printf("hello");
Printf("A: %d\n", a);// why am I not able to access the a variable from the main function why filling with garbage value
} }
Why is my code compilin...
The answer was down voted because I lost my keys. Please, stay with me, let me explain this odd chain of events.
Earlier today I couldn't get to the store on time because I could not find my keys. That caused me to miss the opportunity to run over a golf ball, which would have bounced between a...
@J.Salle Well, unnatural only in the sense that it's unusual. I've seen people with disabilities play one-handed with palming the right analog stick and a "claw" style grip on the face buttons and bumpers