Four boxes of a dozen eggs:
4 2 6 $ <'O'
--T-T-T-T-T-┐
│O│O│O│O│O│O│
+-+-+-+-+-+-+
│O│O│O│O│O│O│
L-+-+-+-+-+--
--T-T-T-T-T-┐
│O│O│O│O│O│O│
+-+-+-+-+-+-+
│O│O│O│O│O│O│
L-+-+-+-+-+--
--T-T-T-T-T-┐
│O│O│O│O│O│O│
+-+-+-+-+-+-+
│O│O│O│O│O│O│
L-+-+-+-+-+--
--T-T-T-T-T-┐
│O│O│O│O│O│O│
+-+-+-+-+-+-+
│O│O│O│O│O│O│
L-+-+-+-+-+--
Thanks to Ric, here are four boxes of hugs, just in time for the holidays!
4 2 6 $ <'()X'
----T---T---T---T---T---┐
│()X│()X│()X│()X│()X│()X│
+---+---+---+---+---+---+
│()X│()X│()X│()X│()X│()X│
L---+---+---+---+---+----
----T---T---T---T---T---┐
│()X│()X│()X│()X│()X│()X│
+---+---+---+---+---+---+
│()X│()X│()X│()X│()X│()X│
L---+---+---+---+---+----
----T---T---T---T---T---┐
│()X│()X│()X│()X│()X│()X│
+---+---+---+---+---+---+
│()X│()X│()X│()X│()X│()X│
L---+---+---+---+---+----
----T---T---T---T---T---┐
│()X│()X│()X│()X│()X│()X│
+---+---+---+---+---+---+
│()X│()X│()X│()X│()X│()X│
L---+---+---+---+---+----
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Thursday, December 20, 2012 3:32 AM
To: [email protected]
Subject: Re: [Jprogramming] Hugs and Kisses
Here are the "baby steps" to get your solution:
G=: 13 :';y$<''()X'''
G
[: ; (<'()X') $~ ]
G 2 2 3
()X()X()X()X()X()X()X()X()X()X()X()X
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Thursday, December 20, 2012 3:20 AM
To: [email protected]
Subject: Re: [Jprogramming] Hugs and Kisses
That's neat! Maybe we'll start talking from right to left too!
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Ric Sherlock
Sent: Thursday, December 20, 2012 2:49 AM
To: Programming JForum
Subject: Re: [Jprogramming] Hugs and Kisses
I like Bob's better but here is another variant
HANDK=: [: ; (<'()X') $~ ]
HANDK 3 2 2
()X()X()X()X()X()X()X()X()X()X()X()X
or
Hugs=: '()'
Kisses=: 'X'
give=: [: ; <@[ $~ ]
Hugs give 3 2 2
()()()()()()()()()()()()
(Hugs,Kisses) give 3 2 2
()X()X()X()X()X()X()X()X()X()X()X()X
On Thu, Dec 20, 2012 at 8:39 PM, Linda Alvord
<[email protected]>wrote:
> Bob's version just jumps to a neat simple function F :
>
> H=: 13 :'((}:y),2*{:y)$''()'''
> H 2 6
> ()()()()()()
> ()()()()()()
> K=: 13 :'y$''X'''
> K 2 6
> XXXXXX
> XXXXXX
> F=: 13 : '(3**/y)$''()X'''
> F
> '()X' $~ 3 * */
>
> A dozen hugs and kisses:
>
> F 3 2 2
> ()X()X()X()X()X()X()X()X()X()X()X()X
> F 2 6
> ()X()X()X()X()X()X()X()X()X()X()X()X
> F 12
> ()X()X()X()X()X()X()X()X()X()X()X()X
>
> Linda
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Linda
> Alvord
> Sent: Thursday, December 20, 2012 2:18 AM
> To: [email protected]
> Subject: Re: [Jprogramming] Hugs and Kisses
>
> Here's my version that uses H and K. I was hoping for a simpler way:
>
> H=: 13 :'((}:y),2*{:y)$''()'''
> H 2 2 3
> ()()()
> ()()()
>
> ()()()
> ()()()
> K=: 13 :'y$''X'''
> K 2 2 3
> XXX
> XXX
>
> XXX
> XXX
> HANDK=: 13 :',(((*/y),2)$,H y),.((*/y),1)$,K y'
> HANDK
> [: , ((2 ,~ */) $ [: , H) ,. (1 ,~ */) $ [: , K
> HANDK 2 2 3
> ()X()X()X()X()X()X()X()X()X()X()X()X
>
> Linda
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Linda
> Alvord
> Sent: Wednesday, December 19, 2012 10:07 PM
> To: [email protected]
> Subject: Re: [Jprogramming] Hugs and Kisses
>
> You sidestepped some problems very nicely! Sleep is often useful.
>
> Linda
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of bob
> therriault
> Sent: Wednesday, December 19, 2012 10:48 AM
> To: [email protected]
> Subject: Re: [Jprogramming] Hugs and Kisses
>
> After a good night's sleep,
>
> HAK=: '()X' $~ 3 * */
> HAK 2 2 3
> ()X()X()X()X()X()X()X()X()X()X()X()X
> HAK 1 1 1
> ()X
>
> This felt like one of those Edward DeBono solutions where what you
> know gets in the way of what you are trying to do. In this case, I
> just needed to create a string of '()X' of a certain length and I was
> letting the original shape get in the way.
>
> Cheers, bob
>
> On 2012-12-18, at 11:22 PM, bob therriault wrote:
>
> > Hi Linda,
> >
> > Using your definitions for Hugs and Kisses I came up with this.
> >
> > HANDK =: 3 : 0
> > h=. ('()'$~}:,2*{:) y
> > k=. y $ 'X'
> > h ,@((_2]\,@[),.|:@,@]) k
> > )
> > HANDK 2 2 3
> > ()X()X()X()X()X()X()X()X()X()X()X()X
> >
> > Cheers, bob
> >
> > On 2012-12-18, at 7:48 PM, Linda Alvord wrote:
> >
> >> H=: 13 :'((}:y),2*{:y)$''()'''
> >
> > --------------------------------------------------------------------
> > -- For information about J forums see
> > http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm