Differences between revisions 42 and 43
 ⇤ ← Revision 42 as of 2008-12-08 10:45:34 → Size: 5026 Editor: anonymous Comment: converted to 1.6 markup ← Revision 43 as of 2008-12-16 08:12:11 → ⇥ Size: 5832 Editor: OlegKobchenko Comment: images generated with animate addon Deletions are marked like this. Additions are marked like this. Line 10: Line 10: || 1||`>`||filled in circle||{{attachment:001.png}}|||| 2||`= <.`||hollow circle||{{attachment:002.png}}|||| 3||`<.@:]`||Bullseye, delta-circumference = 1|| |||| 4||`m ([ * [: <. 0.5 + %~) ]`||Bullseye, delta-circumference = `m`||{{attachment:004.png}}|||| 5||`2 | <.@:]`||hard to describe; just try it with various `n` (10, 50, 100, 250)|| |||| 6||`0 = 5 | <.@:]`||similar to above, but the concentric circles more discernable|| |||| 7||`+/\@:]`||rainbow half-hyperbola, gradual descent.|| |||| 8||`(|. -@:,~ )~`||rainbow full-hyperbola (inside-out circle)|| |||| 9||`(|. -@:,~@:-:)~`||circle vs. hyperbola.|| |||| 10||`<./\`||prism/double spectrum/double slit experiment/one dimensional circle|| |||| 11||`>./\`||sunrise over the ocean|| |||| 12||`>./\@:]`||acute rainbow|| |||| 13||`_1 o. ]`||concentrate|| |||| 14||` 1 o. ]`||kinda like the `m | <.@:]` pictures|| |||| 15||`_1 <.@:o. ]`||i c u|| |||| 16||`_1 >.@:o. ]`||like the bullsyes, but delta-circumference isn't constant (the bands change widths)|| |||| 17||`[/\ _1 >.@:o. ]`||LSD sunrise|| |||| 18||`100 | 1000 * ^.`||concentric rainbows|| |||| 19||`100 | 1000 * ^.@:]` ||kindergarten|| |||| 21||`100 | 1000 * (%:2) ^. ]` ||fractal thingummy|| |||| 22||`[: ?. <.@]`||paint splatter|| |||| 23||`,/@:e.@:<.@:]`||DNA dance (`n` must be small -- try `n=.20` and maximize the resulting plot window|| |||| 24||`=@:]`||It's for Victory!|| |||| 25||`|:@:(]/.)@:]`||valentine|| |||| 26||`|:@:(/: /.)@:]`||louvre|| |||| 27||`|:@:(/:~/.)@:]`||pyramid power|| |||| 28||`involte@:,~@:>:@:-:@:[ { ,@:]`||modern art ([[JForum:programming/2006-November/004228|definition of involute]])|| |||| 29||`(- >./@:,)@:involute@:,~@:>:@:-:@:[ { ,@:]`||modern art 2|| |||| 30|| `!~`||and in the darkness bind them || |||| 31|| `|~`||compass || |||| 32|| `[ | !~`||ring around the rosey|| |||| 33|| `p..@:]` || cold front || |||| 34|| `[: |.@:|: 100 | 1000 * ] %~ ({.~_,#)@:p..@:]` || hallelujah || |||| 35|| `[: |: 100 | 1000 * p..`|| skipping stone || || || 1||`>`||filled in circle||{{attachment:pp01.png}}|||| 2||`= <.`||hollow circle||{{attachment:pp02.png}}|||| 3||`<.@:]`||Bullseye, delta-circumference = 1|| {{attachment:pp03.png}}|||| 4||`m ([ * [: <. 0.5 + %~) ]`||Bullseye, delta-circumference = `m`||{{attachment:pp04.png}}|||| 5||`2 | <.@:]`||hard to describe; just try it with various `n` (10, 50, 100, 250)||{{attachment:pp05.png}} |||| 6||`0 = 5 | <.@:]`||similar to above, but the concentric circles more discernable||{{attachment:pp06.png}} |||| 7||`+/\@:]`||rainbow half-hyperbola, gradual descent.||{{attachment:pp07.png}} |||| 8||`(|. -@:,~ )~`||rainbow full-hyperbola (inside-out circle)||{{attachment:pp08.png}} |||| 9||`(|. -@:,~@:-:)~`||circle vs. hyperbola.||{{attachment:pp09.png}} |||| 10||`<./\`||prism/double spectrum/double slit experiment/one dimensional circle||{{attachment:pp10.png}} |||| 11||`>./\`||sunrise over the ocean||{{attachment:pp11.png}} |||| 12||`>./\@:]`||acute rainbow||{{attachment:pp12.png}} |||| 13||`_1 o. ]`||concentrate||{{attachment:pp13.png}} |||| 14||` 1 o. ]`||kinda like the `m | <.@:]` pictures||{{attachment:pp14.png}} |||| 15||`_1 <.@:o. ]`||i c u||{{attachment:pp15.png}} |||| 16||`_1 >.@:o. ]`||like the bullsyes, but delta-circumference isn't constant (the bands change widths)||{{attachment:pp16.png}} |||| 17||`[/\ _1 >.@:o. ]`||LSD sunrise||{{attachment:pp17.png}} |||| 18||`100 | 1000 * ^.`||concentric rainbows||{{attachment:pp18.png}} |||| 19||`100 | 1000 * ^.@:]` ||kindergarten||{{attachment:pp19.png}} |||| 21||`100 | 1000 * (%:2) ^. ]` ||fractal thingummy||{{attachment:pp21.png}} |||| 22||`[: ?. <.@]`||paint splatter||{{attachment:pp22.png}} |||| 23||`,/@:e.@:<.@:]`||DNA dance (`n` must be small -- try `n=.20` and maximize the resulting plot window||{{attachment:pp23.png}} |||| 24||`=@:]`||It's for Victory!||{{attachment:pp24.png}} |||| 25||`|:@:(]/.)@:]`||valentine||{{attachment:pp25.png}} |||| 26||`|:@:(/: /.)@:]`||louvre||{{attachment:pp26.png}} |||| 27||`|:@:(/:~/.)@:]`||pyramid power||{{attachment:pp27.png}} |||| 28||`involte@:,~@:>:@:-:@:[ { ,@:]`||modern art ([[JForum:programming/2006-November/004228|definition of involute]])||{{attachment:pp28.png}} |||| 29||`(- >./@:,)@:involute@:,~@:>:@:-:@:[ { ,@:]`||modern art 2||{{attachment:pp29.png}} |||| 30|| `!~`||and in the darkness bind them ||{{attachment:pp30.png}} |||| 31|| `|~`||compass ||{{attachment:pp31.png}} |||| 32|| `[ | !~`||ring around the rosey||{{attachment:pp32.png}} |||| 33|| `p..@:]` || cold front ||{{attachment:pp33.png}} |||| 34|| `[: |.@:|: 100 | 1000 * ] %~ ({.~_,#)@:p..@:]` || hallelujah ||{{attachment:pp34.png}} |||| 35|| `[: |: 100 | 1000 * p..`|| skipping stone ||{{attachment:pp35.png}} || Line 47: Line 47: * Errors represented with `[\]` -- OlegKobchenko <>

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

## Discussion

• Errors represented with [\] -- OlegKobchenko 2008-12-16 08:12:11

• Consider adding glwh to standardize picture size for screenshots. -- OlegKobchenko 2006-12-13 01:37:50

• As samples, pictures for smallest nice rectangular size of viewmat: 121, i.e. n=60 -- OlegKobchenko 2006-12-13 06:35:40

• Here is more compact thumbnail layout:
 1. filled in circle > 2. hollow circle = <. 3. Bullseye, delta-circumference = 1 <.@:] 4. Bullseye, delta-circumference = m m ([ * [: <. 0.5 + %~) ]
• -- OlegKobchenko 2006-12-13 06:50:08

Oleg provided a mechanism to save `viewmat` images to PNG files, so I feel that the following should generate all the image files for this table. However, it does not; I just get a bunch of empty white images.

Debugging indicates that it is probably a repaint/selected window issue. I do not know how to fix it.

```load 'viewmat media/platimg debug'
coinsert 'jgl2'

PP      =:  1 : 'viewmat@:(u [: | j./~@:i:)'
glqall  =:  (|. \$ [:glqpixels 0 0&,)@glqwh
glwh    =:  3 : 'wd''pmovex '',(+0 0,y-glqwh_jgl2_@\$@#)&.".wd''qformx'''

ppp     =:  dyad define           NB. Pretty picture print
wdreset''

". '(',y,') PP 60'

NB.  jvm_g_paint_jviewmat_ :: 0: ''
glwh 4 3*30
NB.  jvm_g_paint_jviewmat_ :: 0: ''

6!:3]0.5
(glqall'') writeimg jpath '~temp\pp\',x,'.png'
6!:3]0.5

wdreset''
)

A       =:  '>' ; '= <.' ; '<.@:]'                              NB.  Etc
B       =:  'filled_in_circle' ; 'hollow_circle' ; 'bullseye'   NB.  Etc

B ppp&.> A```

-- DanBron 2007-03-16 15:42:32 Well this steps into the uncharted treacherous territory of sync programmatic execution and async GUI. So I guess to do it like that, the use of timer might help. But that's an overkill.

I recommend using something that is proven and supported like the animate addon. You can designate each picture as a step in the animation. And all will be saved nicely in a series of files. I guess you could take it further by making code that will convert your boxed list of picture verbs into a script for animate automatically. Or have just one new animate script that will accept a list of picture verbs in some form and derive number of steps, etc. Maybe an Options dialog.

-- OlegKobchenko 2007-03-16 16:35:59

DanBron/Snippets/PrettyPictures (last edited 2008-12-16 08:12:11 by OlegKobchenko)