I've been studying APL only a few weeks but I really like it. I tried to write simple functions to practice what I learn. This one tells me how much money I'm left with next 13 months if I withdraw W every month from initial capital of T.
R←T Money W
M←1 2 3 4 5 6 7 8 9 10 11 12 13
Months←'Nov' 'Dec' 'Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov'
P←-/T(M×W)
R←Months,P
This gives two correct numbers but I could not format them like
Nov....100,000
Dec.....97,000
Jan.....92,000
...
How can I do this? Thorn does not work because it only works with numbers.
Something like,
R←13 2 ⍴ Months,P
does not work either:
Nov Dec
Jan Feb
Mar Apr
May Jun
Jul Aug
Sep Oct
Nov 97000 94000 91000 88000 85000 82000 79000 76000 73000 70000 67000 64000 61000
Nov Dec
Jan Feb
Mar Apr
May Jun
Jul Aug
Sep Oct