Scripts/I Ching

From J Wiki
Jump to navigation Jump to search

I Ching ideogram builder

WikiPedia:Unicode code pages: Digram Symbols, Yijing Monogram U2600+, Yijing Hexogram U4DC0+. Also knows as Divination symbols on Mac Character Palette

NB. I Ching ideograms

require 'viewmat'

divgram=: {&(2#"1(5#2)#:0 4 10)"1
frame=: 1: ([ ,.~^:2 [ ,. ,~ , [) [: ,/ 1: ,:"1 ]
divfmt=: [: frame@divgram #/@[ |.@-.@#: ]
viewdiv=: viewmat@:(]`]`]`(,/)`(,./^:2))@.(#@$)

Examples

  viewdiv 1 2 divfmt i. ,.2    NB. monogram: 0 1 - yin, yang

Div-1.2.png

  viewdiv 2 3 divfmt i. 3 3    NB. 3x digrams: 0 1 _1

Div-2.3.png

  viewdiv 3 2 divfmt i. 2 4    NB. trigrams

Div-3.2.png

  viewdiv 4 2 divfmt i. 4 4    NB. tetragrams

Div-4.2.png

  viewdiv 4 3 divfmt i. 9 9    NB. 3x tetragrams

Div-4.3.png

  viewdiv 6 2 divfmt i. 8 8    NB. hexagrams

Div-6.2.png

  viewmat |.|:#:i.64       NB. 'Great Horizontal Diagram'
                           NB. black=yin, bottom to top makes 2x ideogram

Div-xiantian.png

  viewmat |.|:4(# #: [: i. ^~)3  NB. 3x diagram

Div-xiantian.3.png