Re: [Jprogramming] Generating a sequence

2012-08-24 Thread R.E. Boss
's e i'=. 5 8 0.25 i (],(+{:))^:((e-i)>:{:@])^:_ s 5 5.25 5.5 5.75 6 6.25 6.5 6.75 7 7.25 7.5 7.75 8 i=.0.27 i (],(+{:))^:((e-i)>:{:@])^:_ s 5 5.27 5.54 5.81 6.08 6.35 6.62 6.89 7.16 7.43 7.7 7.97 I'm no 'tacitus', so that part I leave to the reader. R.E. Boss > -Oorspron

Re: [Jprogramming] Generating a sequence

2012-08-24 Thread Linda Alvord
Also, 's e i'=:5 8 0.27 i (],(+{:))^:((e-i)>:{:@])^:_ s 5 5.27 5.54 5.81 6.08 6.35 6.62 6.89 7.16 7.43 7.7 7.97 s+ i* i.1+ <.(e-s)%i 5 5.27 5.54 5.81 6.08 6.35 6.62 6.89 7.16 7.43 7.7 7.97 Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:p

[Jprogramming] clear the console in j601

2012-08-24 Thread Philip A. Viton
Can anyone show me how to write a verb that will clear the console (the ijx window) in the J601 system under MS Windows? (Essentially, do a Ctrl+A to select everything, then Ctrl+X to cut it, though if there's a cleaner way I'd like to hear about it). By playing around with some of the concept

Re: [Jprogramming] Generating a sequence

2012-08-24 Thread Raul Miller
On Fri, Aug 24, 2012 at 9:41 AM, Linda Alvord wrote: > Also, > > 's e i'=:5 8 0.27 > >i (],(+{:))^:((e-i)>:{:@])^:_ s > 5 5.27 5.54 5.81 6.08 6.35 6.62 6.89 7.16 7.43 7.7 7.97 > >s+ i* i.1+ <.(e-s)%i > 5 5.27 5.54 5.81 6.08 6.35 6.62 6.89 7.16 7.43 7.7 7.97 Or: 's e i'=. 5 8 0.25 i

Re: [Jprogramming] Generating a sequence

2012-08-24 Thread Jose Mario Quintana
to=. [ + i.@:>:@:<.@-~ 5 to 8 5 6 7 8 5 to 5 5 5 10 to 15 20 5 6 7 8 9 10 11 12 13 14 15 10 11 12 13 14 15 16 17 18 19 20 inc=. (%&) ((<'&.'`)(`:6)) 5 to (0.25 inc) 8 5 5.25 5.5 5.75 6 6.25 6.5 6.75 7 7.25 7.5 7.75 8 5 to (0.27 inc) 8 5 5.27 5.54 5.81 6.08 6.35 6.62

Re: [Jprogramming] Generating a sequence

2012-08-24 Thread Raul Miller
On Fri, Aug 24, 2012 at 11:17 AM, Jose Mario Quintana wrote: >to=. [ + i.@:>:@:<.@-~ > >5 to 8 > 5 6 7 8 ... >inc=. (%&) ((<'&.'`)(`:6)) > >5 to (0.25 inc) 8 > 5 5.25 5.5 5.75 6 6.25 6.5 6.75 7 7.25 7.5 7.75 8 I like your argument patterns. But I am uncomfortable with your defini

[Jprogramming] Print Custom Alphabet

2012-08-24 Thread Roger Hui
http://codegolf.stackexchange.com/questions/7036/print-custom-alphabet The gauntlet is thrown! -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Print Custom Alphabet

2012-08-24 Thread Raul Miller
On Fri, Aug 24, 2012 at 2:00 PM, Roger Hui wrote: > http://codegolf.stackexchange.com/questions/7036/print-custom-alphabet > > The gauntlet is thrown! The best I can see, right now, is: ,.^:('.'e.t)s{ ::($:&}.)~n+1+s i.{.t=.1!:1##s=:a.{~,65 97+/26|i.51[n=:i.25 And this is 74 characters long -

Re: [Jprogramming] Print Custom Alphabet

2012-08-24 Thread Roger Hui
I think it is customary to assume that the input is just an argument. The q solution so assumes. On Fri, Aug 24, 2012 at 11:38 AM, Raul Miller wrote: > On Fri, Aug 24, 2012 at 2:00 PM, Roger Hui > wrote: > > http://codegolf.stackexchange.com/questions/7036/print-custom-alphabet > > > > The g

Re: [Jprogramming] Print Custom Alphabet

2012-08-24 Thread Raul Miller
I'm not sure how to express that here. Consider, for example: ,.^:('.'e.t)s{ ::($:&}.)~n+1+{.t i.~s=:a.{~,65 97+/26|i.51[n=:i.25[t=. Here, I need would need quotes around the argument. And, it's still 70 characters. -- Raul On Fri, Aug 24, 2012 at 3:01 PM, Roger Hui wrote: > I think it is

Re: [Jprogramming] clear the console in j601

2012-08-24 Thread chris burke
(smwrite_jijs_[smselout_jijs_)'' On Fri, Aug 24, 2012 at 9:05 PM, Philip A. Viton wrote: > > > Can anyone show me how to write a verb that will > clear the console (the ijx window) in the J601 > system under MS Windows? (Essentially, do a Ctrl+A > to select everything, then Ctrl+X to cut it, th

Re: [Jprogramming] Generating a sequence

2012-08-24 Thread Jose Mario Quintana
There are a couple of problems with to =: [ (+ i.) 1 + -~ 5 10 to 15 20 |length error: to | 5 10 to 15 20 |[-0] 5 to (0.27 inc) 8 |domain error: to | 5 to(0.27 inc)8 |[-0] inc=: 1 :'&.(%&m)' Is the explicit equivalent (to some extent) to inc=. (%&)(<'&.'`)(`:6) I

Re: [Jprogramming] Generating a sequence

2012-08-24 Thread Raul Miller
Oh, hmm.. But if I use to =: [ + 1 i.@+ -~ it seems to work: 5 10 to 15 20 5 6 7 8 9 10 11 12 13 14 15 10 11 12 13 14 15 16 17 18 19 20 or maybe not: 5 10 to 12 20 5 6 7 8 9 10 11 12 5 5 5 10 11 12 13 14 15 16 17 18 19 20 I probably want fill elements there? If so, I s

Re: [Jprogramming] Generating a sequence

2012-08-24 Thread Jose Mario Quintana
One thing I do not like about explicit definitions is unexpected side effects: m=. +/ .* inc=: 1 :'&.(%&m)' 3 inc NB. OK &.(%&3) + inc NB. WHOA! &.(%&(+/ .*)) inc=. (%&) (<'&.'`) (`:6) 3 inc &.(%&3) + inc &.(%&+) Somebody said recently that J has no reserved words, of c

Re: [Jprogramming] Print Custom Alphabet

2012-08-24 Thread bob therriault
67 characters with same issue that Raul mentions that argument would need to be quoted. (,.@]^:('.'e.[)(a.{~a{~(>:i.25)+(a=.,65 97+/26|i.51)i.a.i.{.)) ::(0$])'f' spaced below for legibility (,.@]^:('.'e.[) (a.{~a{~(>:i.25)+(a=.,65 97+/26|i.51)i.a.i.{.)) :: (0$]) deci

Re: [Jprogramming] Print Custom Alphabet

2012-08-24 Thread David Ward Lambert
NB. choices for input are ARGV_j_ or 1!:1[1 NB. These two sentences are one line apiece ,.^:('.'e.t)s{ ::($:&}.)~n+1+{.t i.~s=:a.{~,65 97+/26| i.51[n=:i.25[t=.1!:1[1 NB. rdm ,.^:('.'e.L)(a.{~(_ 65 _ 97{~64 90 96 122&I.)+(26|i._26 25){~32<:@| ]) ::(0&$)a.i.{.L=.1!:1[1 NB. dwl The concept: index i