User:Dan Bron/Snippets/PrettyPictures

From J Wiki
Jump to: navigation, search

Idea for the next puzzle to present: draw pretty pictures using

   require 'viewmat'
   PP =: 1 : 'viewmat@:(u [: | j./~@:i:)'   NB.  The original  +&.*:/~@:i:  is much slower
   f PP n

where f is some short, elegant J verb and n a positive integer. Examples:

f description png @ n=60
1 > filled in circle Pp01.png
2 = <. hollow circle Pp02.png
3 <.@:] Bullseye, delta-circumference = 1 Pp03.png
4 m ([ * [: <. 0.5 + %~) ] Bullseye, delta-circumference = m Pp04.png
5 2 | <.@:] hard to describe; just try it with various n (10, 50, 100, 250) Pp05.png
6 0 = 5 | <.@:] similar to above, but the concentric circles more discernable Pp06.png
7 +/\@:] rainbow half-hyperbola, gradual descent. Pp07.png
8 (|. -@:,~ )~ rainbow full-hyperbola (inside-out circle) Pp08.png
9 (|. -@:,~@:-:)~ circle vs. hyperbola. Pp09.png
10 <./\ prism/double spectrum/double slit experiment/one dimensional circle Pp10.png
11 >./\ sunrise over the ocean Pp11.png
12 >./\@:] acute rainbow Pp12.png
13 _1 o. ] concentrate Pp13.png
14  1 o. ] kinda like the m | <.@:] pictures Pp14.png
15 _1 <.@:o. ] i c u Pp15.png
16 _1 >.@:o. ] like the bullsyes, but delta-circumference isn't constant (the bands change widths) Pp16.png
17 [/\ _1 >.@:o. ] LSD sunrise Pp17.png
18 100 | 1000 * ^. concentric rainbows Pp18.png
19 100 | 1000 * ^.@:] kindergarten Pp19.png
21 100 | 1000 * (%:2) ^. ] fractal thingummy Pp21.png
22 [: ?. <.@] paint splatter Pp22.png
23 ,/@:e.@:<.@:] DNA dance (n must be small -- try n=.20 and maximize the resulting plot window Pp23.png
24 =@:] It's for Victory! Pp24.png
25 |:@:(]/.)@:] valentine Pp25.png
26 |:@:(/: /.)@:] louvre Pp26.png
27 |:@:(/:~/.)@:] pyramid power Pp27.png
28 involte@:,~@:>:@:-:@:[ { ,@:] modern art (definition of involute) Pp28.png
29 (- >./@:,)@:involute@:,~@:>:@:-:@:[ { ,@:] modern art 2 Pp29.png
30 !~ and in the darkness bind them Pp30.png
31 |~ compass Pp31.png
32 [ | !~ ring around the rosey Pp32.png
33 p..@:] cold front Pp33.png
34 [: |.@:|: 100 | 1000 * ] %~ ({.~_,#)@:p..@:] hallelujah Pp34.png
35 [: |: 100 | 1000 * p.. skipping stone Pp35.png