[Jprogramming] Challenge 6 Many Many Cherry Trees

Dan Bron j at bron.us
Wed Feb 15 23:28:12 HKT 2012


Marc Simpson wrote:
>  One thing though-the original problem stated that: 
>  "Each row is a successive scramble of the character 
>  string above it with one added symbol"

Ah, I must've glossed over this part.  Thanks for the tip.  Here's another
take:

**SPOILER AFTER 15 BLANK LINES**











	   gw=:i.&.-@# (|. 1j1&#)"_1 [: scr\ scr =. ] {~ ?~@#
	   
	   gw 'many'
	   y    
	  m y   
	 y a m  
	n m a y 
	   
	   gw 'many'
	   n    
	  y n   
	 a n y  
	m a n y 
	   
	   gw 'cherrytrees'
	          r           
	         r e          
	        e e r         
	       e e e r        
	      r e e e s       
	     e s r e h e      
	    r c e e h s e     
	   r c s e e e r h    
	  t r e r e s c e h   
	 r r h e e e c s t r  
	r t c e y r s h e e r 
	   
	   a=:gw '%%%####'
	   a,.a,.a,.a
	      %             %             %             %       
	     # %           # %           # %           # %      
	    % % #         % % #         % % #         % % #     
	   % % # #       % % # #       % % # #       % % # #    
	  % % # # %     % % # # %     % % # # %     % % # # %   
	 % # % # # %   % # % # # %   % # % # # %   % # % # # %  
	% # # % # # % % # # % # # % % # # % # # % % # # % # # % 
	   

This solution is a fixer-upper.  In particular, I don't l like the redundant
scr and I sense it's unnecessary.  I've always liked  i.&.-  though.  It's
cute.  

-Dan





More information about the Programming mailing list