Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

Question list filters

Filter by
Sorted by
Tagged with
Filter by Employee ID
Score of 1
1 answer
86 views

I'm making a CGOL game in J, here's the code to get the next state given the current one: next =: 3 :0 res =. ,/ ({."1 pos) r"(0 0) ({:"1 pos) (size,size) $ res ) Which currently ...
Score of 0
1 answer
85 views

The data is as follows: price=:20 ages=:12 18 15 9 35 41 25 37 62 23 68 34 a) People below the 18 years get a 20% discount b) People above 18 years but below 40 years get a 15% discount c) People ...
Score of 3
1 answer
188 views

At the risk of asking a question with an obvious solution: if I have a function in J that takes two arguments and returns two arguments and I want to accumulate the answer's second argument and to use ...
Score of 2
2 answers
188 views

The tetration is an operation defined as an iterated exponentiation (e.g 2^^4 = 2^(2^(2^2)) = 65536) I'm learning the J programming language and want to experiment with the ^: (power of verb) function ...
Score of 3
2 answers
189 views

Given a table with two columns: 1 2 3 4 2 1 1 2 I'm trying to understand how to produce a list of only the numbers which appear in both columns. E.g. 1, 1, 1, 2, 2, 2 in this example. I can see Nub ...
user avatar
Score of 2
0 answers
103 views

Here is a leaderboard prototype for ranking on the left column and could be user indices on the right. The matrix stays sorted. It might get a lot of traffic. Typical size 100,000 and up. (4 2 $0 342 ...
Score of 3
3 answers
220 views

I am a beginner learning J based on this book (2015 version). I was able to run all examples until this one from the calculus chapter: ^&3 d. 1 3&*@(^&2) I get this error locally: |...
Score of 2
1 answer
104 views

I have the following tacit fork (intended to be used monadically): F&.I G H&.I i.e. the left and right verbs F and H of the fork get I applied with &. (under) before feeding the outputs to ...
Score of 3
2 answers
133 views

Perhaps there's no facility to do this in the J language, but when I write: succession =: monad define greg =. 1 2 3 tom =. {{ greg }} tom y ) and then call succession 'season 1', I get the ...
Score of 3
1 answer
91 views

How would you go about reshaping a length-N 1D array into an (N/2) x 2 array? In numpy, for example, you can use -1 in place of N/2 when reshaping: >>> x = np.array([1,2,3,4]) >>> x....
Score of 1
1 answer
178 views

What's going on that makes this code work? It seems that using m in an anonymous verb (if that's what it's called) turns the verb into a postfix operator. 1 {{ 1 + m }} 2 If I replace the m with y ...
Score of 3
3 answers
185 views

I expected -/ 1 2 3 4 _8 NB. ((1-2)-3)-4 but I got -/ 1 2 3 4 _2 NB. 1-(2-(3-4)) I there a reason for this? How do I get the associativity that I was expecting? If there are relevant sections in the ...
Score of 3
2 answers
113 views

I am a relatively new programmer in J-Lang and recently discovered its efficacy in Code Golfing, where it excels in scoring. I am currently working on a coding problem that involves printing all prime ...
Score of 2
1 answer
271 views

Pattern matching can be implemented using a point free style, and there are many articles on the internet about it. I'm wondering if the more generalized case also holds, i.e. is it possible to ...
Score of 5
1 answer
187 views

Given the following list of boxed lists of differing lengths… ┌──────────────┬───────────┬─────┬───┐ │0 2 3 4 7 9 11│9 7 4 3 2 1│1 2 3│3 1│ └──────────────┴───────────┴─────┴───┘ How can I create a ...

15 30 50 per page
1
2 3 4 5
30