Mike, Raul thanks for feedback.

I saw the Rosetta code but felt it too slow to investigate the patterns for 
larger n, as I wanted to explore n>2,000.
The other general cases are readily adapted by changing the cases and values 
too.

   ts '''_*'' {~ view addrow^:1000 <1'
0.046833 7.75168e6
   ts '(30 Rule =&0@i:)1000'
0.892658 3.52824e7

Even for n=5000 you get a result and best viewed in Viewmat (but viewing detail 
is well and truly lost beyond eg 500).

   ts 'viewmat view addrow^:5000 <1'
3.07417 2.78932e9            NB. 2 seconds of this is spent in viewmat

   ts ‘z=:addrow^:5000 <1'
1.12924 3.81635e7             NB. Algorithm time

I presented this as it may be useful for someone then looking into the random 
nature of the central column (Wolfram’s Rule 30 questions) found here using the 
diagonal function from 

   ts 'd=:diagonal >z'
0.01667 6.71188e7

…/Rob

> On 5 Oct 2019, at 3:15 am, 'Mike Day' via Programming 
> <[email protected]> wrote:
> 
> We seem to have been discussing this in July 2004, to judge from the
> dates of a couple of old scripts in my collection,  cellauto.ijs and
> cellautom.schott.ijs,  which suggests Brian was a correspondent. Cliff
> Reiter and Henry Rich are mentioned in the former script....
> 
> The top of cellauto.ijs is commented as follows:
> 
> NB. For doing simplest kind of cellular automata in
> 
> NB. Stephen Wolfram's "New Kind of Science" (2002)
> 
> NB. By Kirby Urner, July 18, 2002
> 
> 
> No more time to comment now, as about to go out.
> 
> Mike
> 
> On 04/10/2019 16:42, Raul Miller wrote:
>> There's also  an implementation at
>> https://rosettacode.org/wiki/One-dimensional_cellular_automata#J
>> 
>>    9  Rule 30] 0=i:9
>> _________#_________
>> ________###________
>> _______##__#_______
>> ______##_####______
>> _____##__#___#_____
>> ____##_####_###____
>> ___##__#____#__#___
>> __##_####__######__
>> _##__#___###_____#_
>> 
>> Or, if it's rewritten:
>> 
>> Rule=:1 :0 NB. , x: number of generations, m: rule number, y: start state
>> :
>>   '_#'{~ (3 ((|.m#:~8#2) {~ #.)\ 0,],0:)^:(i.x) y
>> )
>> 
>>    (30 Rule =&0@i:)9
>> _________#_________
>> ________###________
>> _______##__#_______
>> ______##_####______
>> _____##__#___#_____
>> ____##_####_###____
>> ___##__#____#__#___
>> __##_####__######__
>> _##__#___###_____#_
>> 
>> Thanks,
>> 
> 
> 
> 
> -- 
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to