[Jprogramming] a zoom function (doubling points accross rows and columns)
Raul Miller
rauldmiller at gmail.com
Wed Jul 16 22:38:36 UTC 2014
Yes, I got as far as
2#2#"1#: dfh;.1 ' FF 81 BD A5 A5 BD 81 FF'
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1
1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1
1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1
1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1
1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1
1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1
1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1
1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1
1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
when I saw your spoiler.
Oh well... :)
Thanks,
--
Raul
On Wed, Jul 16, 2014 at 6:32 PM, 'Pascal Jasmin' via Programming
<programming at jsoftware.com> wrote:
> spoiling quiz with answer already, neat short fork.
>
> zoom =: [ # #"1
>
>
> ----- Original Message -----
> From: 'Pascal Jasmin' via Programming <programming at jsoftware.com>
> To: Programming forum <programming at jsoftware.com>
> Cc:
> Sent: Wednesday, July 16, 2014 6:08:28 PM
> Subject: [Jprogramming] a zoom function (doubling points accross rows and columns)
>
> there are too many ways to write this function, and there is probably a way that is better than what I could think of.
>
> #. inv dfh &> ' 'cut 'FF 81 BD A5 A5 BD 81 FF'
> 1 1 1 1 1 1 1 1
> 1 0 0 0 0 0 0 1
> 1 0 1 1 1 1 0 1
> 1 0 1 0 0 1 0 1
> 1 0 1 0 0 1 0 1
> 1 0 1 1 1 1 0 1
> 1 0 0 0 0 0 0 1
> 1 1 1 1 1 1 1 1
>
> zoom =: ([ * ({.,{:)@:$@:]) $ [:, ([, [ * {:@:$@:]) $"1 #"1
>
> 2 zoom #. inv dfh &> ' 'cut 'FF 81 BD A5 A5 BD 81 FF'
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
> 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
> 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1
> 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1
> 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1
> 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1
> 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1
> 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1
> 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1
> 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1
> 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
> 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
>
> for every cell in original, a 2x2 copy of that cell is made.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list