Ric and Martin,
Thanks very much. I have put together some ideas that
combine insights from both of your fine code.
I have not yet thought about automatically culling undesirable
gear combinations and am leaning toward the manual
method with highlighting.
indices =: {@;&(i...@#)
ratios =: <"0@(/:~...@[ %/ \:~...@]) NB. sorted and boxed
combined =: ,&>/@,:&, NB. indices and ratios
sortRatios =: /:{:"1
gears =: indices sortrat...@combined ratios
tableau =: (1&{ ,. -...@{. |."0 1 >:@{:@{. {.!._"0 {:) @:|:@: gears
Note '24 speed example'
rhub=: 32 26 21 18 16 14 12 11
ccog=: 28 38 48
ccog tableau rhub
)
Note '18 speed example'
rhub =. 25 23 21 19 17 16 15 14 13
ccog =. 39 53
ccog tableau rhub
)
--
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm