For quick finding: Phrases/Sets.

Two useful snippets I always need: firstly the combinations verb from the factorial dictionary page changed slightly, secondly a simple variations verb

   comb =: 4 :'; (i.@# ,.&.> ,&.>/\.@:(>:&.>))^:x i.@(,&0)&.> 0=i.<:x-y'
   2 comb 5
0 1
0 2
0 3
0 4
1 2
1 3
1 4
2 3
2 4
3 4
   var =: [{."1 i.@]A.~!@-~*[:i.!@]%!@-~
   2 var 4
0 1
0 2
0 3
1 0
1 2
1 3
2 0
2 1
2 3
3 0
3 1
3 2

Patchy pattern script golfed down to one J line

   ' ,'';'{~_2#.&.|:\([:-.3<:[:+/_1 0 1|."1"{[:+/_1 0 1|."{])^:40]0=?3$~50 80

Try it.


Equivalent shorter expression. -- RogerHui 2007-10-13 22:01:25

   ' ,'';'{~_2#.@|:\(3>([:+/_1 0 1|."{|:)^:2)^:40]0=?50 80$3


It annoys me that j601 has the profile changed in such a way, that under linux jconsole, the box drawing characters are set up to something that (I assume) work on utf8 terminals, but mess up my 8859-2 terminal. In case anyone else is frustrated by this too, here's the way I reverted it to the previous settings, that is, the ascii box drawing characters. In the file j601/system/extras/util/boot.ijs, find this statement: boxdraw_j_ 1 2 0 {~ ('Darwin';'Win') i. <UNAME and comment it out with NB..


CategoryHomepage

BJonas (last edited 2009-09-24 20:11:39 by BJonas)