fast Burrows-Wheeler transform and inverese in #jlang
https://github.com/vmchale/burrows-wheeler/blob/504845dfdb9edd6fe782566de71c0caa991e579d/bw.ijs
fast Burrows-Wheeler transform and inverese in #jlang
https://github.com/vmchale/burrows-wheeler/blob/504845dfdb9edd6fe782566de71c0caa991e579d/bw.ijs
A wild #ANN implementation in #jlang that I found on GitHub:
https://github.com/dimgeo/neural
Pretty cool stuff.
A mathematics problem
How many 3-digit numbers are there where the sum of the cube of each digit of
the number is equal to the number itself?
Thinking about this (from a book of recreational maths problems) gave
me the excuse to brush up on some #jlang programming.
NB. Determine all the 3-digit numbers whose digits' cubes sum to the number
a =: 100+ i. 900 NB. All 3-digit numbers
fmt2=: 8!:2 NB. External function that turns numbers to strings
d =: fmt2 each a NB. Turn a to a collection of boxed strings
e =: ;"1 <each;d NB. Separate out each integer of each number
f =: (;"1) ". each e NB. Get rid of the boxes and convert back to numbers
g =: (+/"1) 3(^"0)~ f NB. Sum the cubes of the digits
(I. g=a){a NB. List numbers for which the sum of the cubes of the
NB. digits equals the number
I know that someone who is better at J than me could do this more
elegantly. If you are one of those people, I'd love to see your
answer.
If you are just curious, the answers are
153 370 371 407
lol, solved #vividstasis puzzle using #Jlang