- Jun 15, 2001
- 34,900
- 2,061
- 126
I'm trying to run Conway's Game of Life in One Line of APL (Link) using GNU APL and for whatever reason, I can't get it to work. APL just does nothing. I've tried various values for N (the number of iterations to run), but I've had no luck.
I know it's a long shot, but does anyone have any ideas?
Here's my code:
Edit: I missed a space between the inputs for the vector V. Oops. Well, it will run for one generation, but will break after that. I run into a system limit (fun_oper) if N is greater than one. Here's the entire program if anyone is interested:
I know it's a long shot, but does anyone have any ideas?
Here's my code:
Code:
⍎'⎕',∈N⍴⊂S←'←⎕←(3=T)∨M∧2=T←⊃+/(V⌽¨⊂M),(V⊖¨⊂M),(V,⌽V)⌽¨(V,V←1¯1)⊖¨⊂M'
Edit: I missed a space between the inputs for the vector V. Oops. Well, it will run for one generation, but will break after that. I run into a system limit (fun_oper) if N is greater than one. Here's the entire program if anyone is interested:
Code:
M←4 4⍴0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
N←2
⍎'⎕',∈N⍴⊂S←'←⎕←(3=T)∨M∧2=T←⊃+/(V⌽¨⊂M),(V⊖¨⊂M),(V,⌽V)⌽¨(V,V←1 ¯1)⊖¨⊂M'
Last edited:
