Version 111 of Chinese Iching Random Weather Predictions

Updated 2010-07-28 01:46:52 by gold

Chinese Iching Random Weather Predictions


 This page is under development. Comments are welcome,
 but please load any comments in the comments section
 at the middle of the page. Thanks,[gold]


   Here is some starter code for
   Chinese Iching Random Weather Predictions. 
    The Iching is the ancient fortune telling
       book of China. The Iching literature mentions
       various methods for casting fortune patterns.
    In researching for the Iching Fortunes 
    page on this wiki,
    I ran into several mentions of 
   using the Iching to predict
  the weather.  In the iching itself,
 there are at least some
  inferences on weather.
  On the public wall in beijing, the iching 
  trigrams were generally posted  
   as a daily weather prediction in Ming times. 
   This page is more an investigation into
  the mindset of the Iching sages,
  using TCL visual and random subroutines  

---- ----

       The Iching is the ancient fortune telling
       book of China. The Iching literature mentions
       various methods for casting fortune patterns
       of Iching. The various methods include 
       hot ironing of turtle shells (-t.),
       manipulations of yarrow sticks, flipping coins,
       throwing shaman bones, and dice.
       One analogy from North America
       is a shaman throwing or
       shuffling stick dice.

       I made three stick dice for
       Iching by cutting a dowel of square cross section
       into three sticks.
       For the three stick dice, the flat sides are marked or
       burned with 2 or 3 holes alternately.
       Two sticks are marked
       with {3 2 3 2} dots on the sides. One stick is marked
       with {3 3 3 2} dots on the sides.
       In casting such three dice,
       the possible sums are 6,7,8, or 9. Further, the
       stick dice are cast six times to obtain whole lines
       or broken lines in a pattern or set of six lines.
       A set of six Iching lines is called a gua
       in the orient or a hexagram in some translations
       of the Chinese.

       In the Iching interpretations, casts of
       6 and 8 are broken or yin (female) lines,
       while casts of 7 and 9 are whole or yang (male) lines.
       The yin numbers of 6 and 8 are even numbers.
       The yang numbers of 7 and 9 are odd numbers.
       The casts are recorded by
       pencil with the first line
       at bottom and marking up the column.
       It is possible to record the numbers from the 
       casts with tally sticks  or Chinese counting rods,
       which are somewhat reminiscent of
       the Iching patterns themselves.
       After marking the original pattern or  
       hexagram, sometimes a second follow-up hexagram
       is developed by swapping throws of 6 for a 7
       and throws of 9 for a 6. These swaps  effectively
       trade a broken  line(6) for a whole line(7)
       and a whole line(9) for a broken line(6). 
       The throws for the changing
       lines (6&9) may not always 
       be come out in the first hexagram or 
       its component lines, so the followup hexagram
       may not exist {under consistent rules}.
       If the first hexagram is interpreted on a line
       by line basis, any changing lines(6&9) or second
       hexagram offers some modification or discount on
       the interpretation of the first hexagram.  

       Continuing with the development of hexagrams, there
       would be 2**6 or 64 hexagrams.
       And the ancient chinese
       were not finished with 64 hexagrams.
        At least one western Han text
       (Chiao shih Yi Lin ) gives consideration to transforms
       of 64*64 dimensions or 4096. So the
       chinese busted into
       the barrier,  2 ** 12 = 4096.  

       In developing a computer program or application,
       it is helpful to develop analogs 
       for the individual tasks of the application.
       An Iching application would have to compose, 
       beg, or borrow TCL procedures for random casts,
       tallies of scores, accounting files,
       display hexagram lines on a screen, 
       swapping changing lines, hexagram pattern 
       recognition and ranking interpretations.

       For computer procedures, the patterns are effectively a 
       horizontal bar code of 6 lines.

       In the process of designing the basic
       subroutine tasks, we could throw in some
       switches, logic chains, or daisy chains
       that break the outset rules given above.
       For example, TCL is so good at swapping lines (6&9)
       for the second hexagram, that it would 
       be easy to put a switch that generates or
       swaps all hexagram lines (6,7,8,&9)
        for their opposites.
       Also from some scripts of
       the Chinese Chou dynasty,
       different Iching fortune methods of
       yarrow sticks or coins would generate
       different probabilities of obtaining
       each hexagram line. Might be interesting to
       have a back door in the program
       to check (or adapt} the different probabilities
       of stick or coin throws. Several authors
       have pointed out that a few of the hexagrams
       look similar to Chinese characters or even
       Mayan calendar notation. Without wading too 
       deep into alternate realities, the Iching
       hexagrams could be used as numerals,
       script alphabet, game tokens, symbol recognition code,
       or maybe a programming language (like Greek
       letters for APL operators).            
       Such rule breaking helps keep the finished
       program more flexible.



       In the West,
       Leibniz recognized that
       the whole and broken lines
       in the hexagram patterns could
       be counted as ones and zeros, respectively in
       a binary number system. For example, a cast or   list
       of { 6,7,8,9,6,7 } could be expressed as a binary
       number, 010101. For computer procedures,
       the patterns are effectively a
       horizontal bar code of 6 lines.
       The probability of each line by 
       the yarrow stick method or coin casting method is
       different. 
 The probability of the yarrow stick method is 1,3,5,7 over 16.
 The number 6 or old yin is 1/16 or 0.0625
 The number 7 or young yang is 3/16 or 0.1875.
 The number 8 or young yin is 5/16 or 0.3125.
 The number 9 or old yang is 7/16 or .4375.
 For the yarrow sticks, the combined probability of any throw is
  .0625 + .1875 + .3125 + .4375 = 1

 For the iching dice pictured below, the three sticks read
 2,3,and 3 which totals 8. The combined probability of
 casting 2,3, and 3 is 0.3125 (with the sticks). 

 For the coins,the probability of the coin casting method is 2,2,6,6 over 16.
 The number 6 or old yin is 2/6 or 0.125. 

 The number 7 or young yang is 2/16 or 0.125.
 The number 8 or young yin is 6/16 or 0.375.
 The number 9 or old yang is 6/16 or .375.
 For the coins, the combined probability of any throw is
  .125 + .125 + .375 + .375 = 1

   For a system of 2 sided sticks or coins of the number N,
   the probability of getting all zeros or ones would be:
     set aa [ expr {  (1./(2**$N))} ] ;# generic TCL
  For three coins, the formula would be 
   set aa [ expr {  (1./(2**3)} ]    or 1/8
  For example the trigrams known as heaven (111) and
  earth (000) would have a probability of 1/8. 
  For six coins, the formula would be  set aa [ expr {  (1./(2**6)} ]
  or 1/64.
  For N dice, the probability that a one or zero would show up
  on one of N dice would be 
  set aa [ expr {  (1.-(1./(2**$N)))} ]  

  ----
   The Chinese believed that weather was the 
   combination of the 5 elements or chi forces  in the air
    namely, rain, sunshine, heat, cold and wind .
   they reasoned that the weather was the combination of
   chi forces between heaven and earth.
    For example, the combination of cold and rain produces snow.

   Using the trigrams as symbols , the combination of 
  two infer the mixing of conditions.
 Further, the trigrams were associated with directions. 
  foretell the weather
  1. based on the primary trigram
  2. the combination of trigrams
  3. the season
  4. prevailing conditions

     The  fortnight periods, more specific as to expected conditions. 
    and 5 seasons. spring, summer, late summer, autumn, and winter.


  It is possible to make a  iching gnomon using a pointed stick and
  board. These individual markers will register binary ones and zeros
  as the sun rises from 600 to 1200 hours. And flipping the orientation 
  of the board, measure the hours 1200 to 1800 hours. For the iching gnomon
  below, the shadow of 1300 hours is across the first bar, which is
  one hour after noon, meaning  1300 hours.  The six binary bars show 011111.  


 When the goinon end of the board  is pointed at the morning sun,
 the goinon will measure the hours (600+N) until noon.

 When the goinon end of the board  is pointed at the afternoon sun,
 the goinon will measure the hours (1200+N) until the sun goes down.
 As the goinon shadow passes a stick mark, the sequence of 6 binary numbers
 is 111111,  011111,001111,000111,000011,000001 or decimals
 63,31,15,7,3,1









   In the context of the oracle bones,
   the Shang were careful to 
   record the weather as the hunting
   party or warrior raid set out,
   presumably early in the morning.
   Secondly they recorded the
   oracle forecast and result.
   These observations on the oracle bones 
   contain elements of the scientific method.

     For a trigram, returning 2 out
    of 3 yin lines might 
   give a rainy forcast at binomial
    probability of 0.375.
    Any area with roughly 10 rainy
    days a month over the
   summer  would have a probability of
   10/30 or 0.333. Here is 
   possible theory that
   the trigram probability
    and the rainy day probability
   are somewhat comparable.

  For Shanghai on 8Jul2010, the two trigrams developed were 2 and 3 
 which indicates southwest and 
 rain conditions. The interpolated mean 
 temperature was 24 C. The internet
 reported rain and winds in the
 southwest at 7 mph, 27 C,  and 79 
 per cent humidity. The Shanghai timezone 
 was loaded into the code on the fly.   

  For Beijing on 11Jul2010, the temp was 22C,
  light rain,east wind at 9 mph, humidity 83%.
  The picked trigrams were 3 and 5, meaning
  hot sunny and windy, pretty much a bust for the
  Iching. Interpolated temperature 
  was 23.9C and chance of rainy day was 0.47.

---

   For Chicago on 11Jul2010, 
   the temp was 29C,  ,northwest wind at 16 kmph,  .
   The picked trigrams were 5 and 5,
   meaning  windy and change with SE wind,
   pretty much a strike out for the Iching. 
   Interpolated temperature was 
   17C and chance of rainy day was 0.27.










    Shanghai was checked on 21JUL2010, 
 the weather was mostly cloudy and 27 degrees C.
 Reported 84 %humidity and SE winds at 9mph.
 Iching forcast was trigrams 3 and 4,
 meaning hot sunny, and stormy.
 Mean temp was 30.47 C.and
 0.33 chance of rainy day. Iching
 predction seemed moderately accurate.
 ----
 The weather fronts do
 seem to come in cycles.
 The theory of weekend rain
 proposes greater chance
 on rain on weekends 
   Would like to gather
 some more testcases and profiles, maybe 
 some kind of neural filter
 or fuzzy logic could be developed.
 A very interesting cosine model
 for daily temperature by Martinez was found
 in the literature. A normalized solar loading
 curve were calculated at another site.


 ----
  With the buttons in the little 
 canvas demo, one can call up
  separate routines to lay
   out the different
   boards and install the various options  .
  In a teamwork situation, programming
 teams could divide up
 the several tasks with the framework.
    In the button call 
 up of the canvas demo, separate tasks
  can laid in successive
  statements to clear board,
 set states, layout the board, .
  Loading three statements in the button
   might be ClrCanvas .cv; 
  set state3 3;board .cv;
  This gets a little lengthy for a
  button line, so these statements could 
  be stacked in a separate subroutine.
  With some global statements for
  any constants and passing the
  canvas name as $w, the  subroutine
   could be written like 
  proc stackedlist (w) (
  global state3
  ClrCanvas $w; 
  set state3 3;
  board $w;
     ]









* EXTRA CREDIT


  On about 28 pieces of Chou bronzes,
  there were several
  series of numbers possibly 
  representing divinatory numbers.
  These series were described
  in a thesis by Chang Cheng Land,
  called Interpretation of Divinatory
  Inscriptions on Early Chou 
  Bronzes.The numbers in ancient
  Chou script are not completely understood, 
  but have the following number
  space { 1:36,2:0,3:0,4:0,5:11,6:64,7:33,8:24}.
  The puzzle is that ones and 
  fives are not normally generated in
  the modern I Ching practise,
  meaning  after 1100 AD. Part of
  the problem is that the Chinese
  scripts for one, two,three, and
  four were normally horizontal
  slashes in those times. So numbers
  2,3,and 4 could be confused 
   with markes for the number one.
  It  seems reasonable that a
   TCL procedure might be able
  to reproduce the same generating odds
   with dice or coins, 
  even the Chou generating procedures
  are lost but for a few peg points.

  Here are the peg points.
  1)  One generating method involves 
  36 counters, lacking four. 
  Apparently the counters are taken/divided 
   away by four and the remainders
  laid  in three piles, upper on side,
   middle upright, and lower on side.
   2) The number 36 makes one think of  

   the 36 chessboard squares, which are
   8 by 8 on a side. 3) The Chou reguarded 
   the odd numbers as "lucky" yang and 
   the even numbers as "unlucky" yin.
       # from the probability of 6-sided double dice,
     the number space of the bronze method guessimates
     at 23 .
       The bronze method sample space is likely 
    between the sample space of 4 coins (sp16) and
    5 coins (sp32).
     The probabilities from 4 2-sided sticks
    are a 40 to 60 percent off the estimated bronze figures.
    But the number 6 has highest frequency in
    both sticks and bronzes. In the 5 2-sided sticks,
    its number 7 with the highest frequency.

    Kind of hokey math, but if you assess 6 has 6 combos
    like in 4 and 5 sticks below,
    then  x= 6/.264 or 22.72  eg. nearest whole number space  is 23.
    Pseudocode.  llength { 6 6 6 6 6 6 etc } = 23 
    1's =    0.1487   * 23  =3.42   > 4
    5's = .0454 *23 or 1.04  > 2
    7's  = .136*23 or 3.128 > 4   
    8's = .0625 *23 or  1.43    > 2
     Pseudocode.  llength { 5 5 6 6 6 6 6 6 7 7 7 7 8 8 etc } = 23 
     Since 1's in bronzes are poorly understood,
     Pseudocode.  llength { 5 5 6 6 6 6 6 6 7 7 7 7 8 8 1 1 1 1 etc. } = 23 
     Since 1's in bronzes are poorly understood, don't mind
     filling up rest ( to 23) with ones
     So now the Suchenworth random pick procedure 
     lpick will deliever  the
     same frequency of characters on the bronzes.
     Pseudocode.  lpick { 5 5 6 6 6 6 6 6 7 7 7 7 8 8 1 1 1 1 1 1 1 1 1  } 
     With a text translation scheme and suitable unicode,
     the  TCL procedure can mimic the appearence of Chou
     script on the bronzes. 

 space of 4 2-sided sticks marked 1 and 2
   space was { 4 5 5 6 5 6 5 7 5 6 6 7 6 7 6 8},size of 16
  sticks prob.   prob.    est. bronze prob.
   4    1/16    0.04625   unk
   5    5/16    .3125    0.0454545454545
   6    6/16    0.375    0.264462809
   7    3/16    0.1875   0.13636363636
   8    1/16    0.0625   0.0991735537

      space of 5  2-sided  sticks marked 1&2, 

   probabilities are
    multiples/fractions  of bronze values  

  6      6/32=.1875
  7       10 /32=   .3125

   8     9/32=.2815

Screenshots Section

http://farm5.static.flickr.com/4078/4781356338_5b53b1a444.jpg

http://farm5.static.flickr.com/4121/4796219415_455bd2f5a2.jpg

http://farm5.static.flickr.com/4136/4812522943_33727ff8ec.jpg

http://farm5.static.flickr.com/4114/4812413403_e697523a46.jpg

http://farm5.static.flickr.com/4098/4818003683_be9dddea77.jpg

http://farm5.static.flickr.com/4123/4821292691_35da154995.jpg


Comments Section

         Please place any comments here, Thanks.

gold Changes.

----
**References***

   * [Simple Canvas Demo]
  
   http://wiki.tcl.tk/14617


   http://wiki.tcl.tk/14853



   www.ejournal.unam.mx/atm/Vol04-3/ATM04302.pdf

  http://rishida.net/tools/conversion/, outstanding unicode conversion online!!!

 
  http://pinyin.info/tools/converter/chars2uninumbers.html


    http://en.wikipedia.org/wiki/Miscellaneous_Symbols_Unicode_block

   http://www.dennismerrittjungiananalyst.com/China_paper.htm
    http://www.openexchange.org/archives/AMJ04/gordon.html
    http://www.superiching.com/guanature.htm

    http://news.bbc.co.uk/2/hi/sci/tech/146120.stm
    http://nasgem.rpi.edu/files/1686

     http://www.biroco.com/yijing/Shih-chuan_Chen.pdf
    
    Early Bronzes, chen lang
  
      [http://www.biroco.com/yijing/Chang_Cheng-lang.pdf]

       http://www.nature.com/nature/journal/v256/n5515/abs/256296a0.ht
      http://mysite.du.edu/~jcalvert/math/chinum.htm



        Doctor Syd,  The Math Forum, 2/25/96  on probability of 6 choose 2


http://www.chineseastrologyonline.com/OracleBone.htm
http://www.chinavista.com/experience/oracle/oracle.html
http://www.lib.cuhk.edu.hk/uclib/bones/bones.htm
http://www.chinapage.com/oracle/oracle.html
http://www.chinapage.com/archeology/030411.pdf
http://www.chinapage.com/oracle/news.html
http://www.chinesefortunecalendar.com/CLC/Default.htm
http://www.chinesefortunecalendar.com/CLC/LunarCalendar.htm









**appendix TCL programs**


 # Restart with tcl: -*- mode: tcl; tab-width: 4; -*- \
 exec wish $0 ${1+"$@"}
    #based on
 # demo2-canvas.tcl - HaJo Gurt - 2005-12-13 - http://wiki.tcl.tk/15073
 #:by gold,   chinese  iChing random weather

 # written on Windowws XP on eTCL
     # working under TCL version 8.5.6 and eTCL 1.0.1
     # gold on TCL WIKI , 17Jul2010

    set xpieces {  \u2630 \u2631 \u2632 \u2633 \u2634 \u2635 \u2636 \u2637}
  package require Tk
 proc lpick L {lindex $L [expr int(rand()*[llength $L])];}
  proc average L {expr ([join $L +])/[llength $L].}

  proc meanmonth {julianday monthdata} {

   set goofy [ expr {$julianday / 30.}]
   set month [ expr {int( $goofy)}]

   set answer [lindex $monthdata $month]

   return $answer
  }
    
     proc chseason {aa} {
     set chinaseason "?"
    if { $aa >= 20 && $aa <= 93 } {set chinaseason "spring"}
    if { $aa >= 93 && $aa <= 167 } {set chinaseason "summer"}
    if { $aa >= 167 && $aa <= 242 } {set chinaseason "late summer"}
     if { $aa >= 242 && $aa <= 315} {set chinaseason "autumn"}
     if { $aa >= 315 && $aa <= 365} {set chinaseason "winter"}
     if { $aa >= 0 && $aa <= 6} {set chinaseason "winter"}
     return $chinaseason }

     proc cmonth {aa} {

     set cmonth "?"
    if { $aa >= 36 && $aa <= 51 } {set cmonth "beginning of spring"}
    if { $aa >= 51 && $aa <= 66 } {set cmonth "rain water"}
    if { $aa >= 66 && $aa <= 81 } {set cmonth "excited insects"}
     if { $aa >= 81 && $aa <= 96} {set cmonth "spring equinox"}
     if { $aa >= 96 && $aa <= 157} {set cmonth "clear and bright"}
     if { $aa >= 157 && $aa <= 126} {set cmonth "grain rains        "}
     if { $aa >= 126 && $aa <= 142} {set cmonth "summer begins"}
     if { $aa >= 142 && $aa <= 158} {set cmonth "grain filling"}
     if { $aa >= 158 && $aa <= 173} {set cmonth "grain in ear"}
     if { $aa >= 173 && $aa <= 189} {set cmonth "summer solstice"}
     if { $aa >= 189 && $aa <= 205} {set cmonth "slight heat"}
     if { $aa >= 205 && $aa <= 220} {set cmonth "great heat"}
     if { $aa >= 220 && $aa <= 236} {set cmonth "autumn begins"}
     if { $aa >= 236 && $aa <= 251} {set cmonth "limit of heat"}
     if { $aa >= 251 && $aa <= 267} {set cmonth "white dew"}
     if { $aa >= 267 && $aa <= 282} {set cmonth "autumn equinox"}
     if { $aa >= 282 && $aa <= 297} {set cmonth "cold dew"}
     if { $aa >= 297 && $aa <= 312} {set cmonth "hoar frost descends"}
     if { $aa >= 312 && $aa <= 327} {set cmonth "Winter begins"}
    if { $aa >= 327 && $aa <= 341} {set cmonth "slight snow"}
      if { $aa >= 341 && $aa <= 356} {set cmonth "great snow"}
     if { $aa >= 356 && $aa <= 365} {set cmonth "winter solstice"}
      if { $aa >= 1 && $aa <= 6} {set cmonth "winter solstice"}
     if { $aa >= 6 && $aa <= 21} {set cmonth "slight cold"}
      if { $aa >= 21 && $aa <= 36} {set cmonth "great cold"}
     if { $aa >= 366} {set cmonth "?"}
    return $cmonth    }

        proc pi {} {expr acos(-1)}

 proc interlinear { xx1 xx2 xx3 yy1 yy3 } {
 return [expr {  ((($xx2-$xx1)*($yy3-$yy1))/($xx3-$xx1))+ $yy1 } ] ;}

     proc tempform { aa bb cc } {
  set  hour1 $cc

  set bigterm [ expr {(($aa+$bb)/2.)+(($bb-$aa)/2.)} ]
    set hour3 6

     set term2 [ expr { [pi]*($hour1+ 10)/(10+$hour3)    }]
  set hour2 12
  set hour3 14
   #set cc 20
  if { $cc <= 14} {
  #set res [ expr { -1.*$bigterm*cos( $term2 )     }]
  set res [ expr { -1.*$bigterm*cos( $term2 )     }]
   #puts "first $res"
  return $res}

    set term3 [ expr { [pi]*($hour1+ 10)/(10+$hour3)    }]

     if { $cc > 14} {
      set hour3 13
     set term3 [ expr { [pi]*($hour1- 14)/(14-$hour3)    }]
      set res [ expr { $bigterm*cos( $term3 ) *-1.    }]}
   #puts "second  $res"
    return $res
       }

      proc tempformxxx { aa bb cc } {
  set  hour1 $cc

  set bigterm [ expr {(($aa+$bb)/2.)+(($bb-$aa)/2.)} ]

      set term5 [ expr { }]

     set term2 [ expr { [pi]*($term5)/(10+$hour1)     }]

  set hour2 12
  set hour3 14
    set cc 9
  if { $cc <= 14} {

        set hprime5 [ expr { }]

     set term2 [ expr { [pi]*($hprime5)/(10+$hour1)     }]

  set res [ expr { -1.*$bigterm*cos( $term2 )     }]
  #puts "first $res"
  return $res}

    set term3 [ expr { [pi]*($hour1+ 10)/(10+$hour3)    }]

     if { $cc > 14} {
      set hour3 13
     set term3 [ expr { [pi]*($hour1- 14)/(14-$hour3)    }]
      set res [ expr { $bigterm*cos( $term3 ) *-1.    }]}
   #puts "second  $res"
    return $res
       }

     proc listnumbers { aa bb} { for {set i [ expr {int($aa)}]} {$i<=$bb} {incr i} {lappend dd [ expr .1* $i] };return $dd}

       proc sinwave { w } {
   console show

   set goo [listnumbers 1 70 ]
  foreach item   $goo  {
    puts [ expr { cos ($item) } ]
     }

     }

      proc clrcanvas {w} {
    $w delete  "all"
  }

  proc pick {w zone } {
    global y xpieces
    incr y 10
    set txt canvas

  set boo 50
  set font2  "Helvetica 120"
  set font5  "Helvetica 10"
    set color4 blue
    set state3 [lpick { 0 1 2 3 4 5 6 7  } ]
     set texter [ lindex  $xpieces $state3]
 $w create text 100   100 -text $texter -font $font2 -width $boo -fill $color4 -tag obj_357034101

    $w create text 200   180 -text [seer $state3 ]  -tags "text"  -font $font5
       set texter [ lpick $xpieces]

   set state3 [lpick { 0 1 2 3 4 5 6 7  } ]
     set texter [ lindex  $xpieces $state3]

     $w create text  300   100 -text $texter -font $font2 -width $boo -fill $color4 -tag obj_672148664
     set systemTime [clock seconds]

     # "The time is: [clock format $systemTime -format %H:%M:%S]"
    # "The date is: [clock format $systemTime -format %j]"
     # [clock format $systemTime -format {Today is: %A, the %d of %B, %Y}]
       set day [clock format $systemTime -format %j ]
 $w create text 200   200 -text [seer $state3 ]  -tags "text"  -font $font5
   set juliandater "julian date is [clock format $systemTime -format %j -timezone $zone]"
   set mean20 [ cmonth $day ]
   set mean25 [ chseason $day ]
  $w create text 200   225 -text "chinese season is    * $mean25 " -tags "text"  -font $font5
  $w create text 200   245 -text "chinese fortnight  is    * $mean20 " -tags "text"  -font $font5

   $w create text 200   425 -text "$juliandater  " -tags "text"  -font $font5

 $w create text 200   440 -text [  clock format [clock scan now] -timezone $zone]  -tags "text"  -font $font5
     weathermean .cv $zone

  }

     proc weathermean {w zone} {
    set boo 50
  set font2  "Helvetica 120"
  set font5  "Helvetica 10"
     set meanmax { 1.6 4.0 11.3 19.9 26.4 30.3 30.8 29.5 25.8 19.0 10.1 3.3 3.3}

    if { $zone == ":Asia/Shanghai" } {
 set meanrainmm { 39 59 81 102 115 152 128 133 156 61 51 35 35 35 35 35}

 set rainydays { 9 10 13 13 14 12 10 12 9 8 7 7 7 7 7  }

   set meanmin { .5 1.5 5.1 10.6 15.7 20.3 24.8 24.7 20.5 14.7 8.6 2.4 2.4 2.4 2.4 2.4   }
  set meanmax { 7.7 8.6 12.7 18.6 23.5 27.2 31.6 31.5 27.2 22.3 16.7 10.6 10.6 10.6  }
  }

 if { $zone == ":Asia/Hong_Kong" } {
 set meanrainmm { 24.9 52.3 71.4 188.5 329.5 388.1 374.4 444.6 287.5 151.9 35.1 34.5 34.5 34.5}

 set rainydays { 5.6 9.5 10.5 11.7 15.5   18.8 17.8 17.4 14.8 8.1 5.7 4.3 4.3 4.3 4.3}

   set meanmin { 14.1 14.4 16.9 20.6 23.9 26.1 26.7 26.4 25.6 23.4 19.4 15.7 15.7 15.7}
  set meanmax { 18.6 18.6 21.5 25.1 28.4 30.4 31.3 31.1 30.2 27.7 24.0 20.3 20.3 20.3  }
 }

  if { $zone == ":Asia/Taipei" } {
  #beijing
        set meanrainmm { 3 6  9 26 29 71  176 182  49  19 6 2 2 2 2}

        set rainydays { 2 3 4 5 6 9 14 12 7 5 3  2 2 2 2}

   set meanmin {  -9.4 -6.9 -0.6 7.2 13.2 18.2 21.6  20.4  14.2  7.3 -.4 -6.9 -6.9 -6.9}
  set meanmax { 1.6 4.0 11.3 19.9 26.4 30.3 30.8 29.5 25.8 19.0 10.1 3.3 3.3 v3.3   }
  }

    if { $zone == ":America/Chicago" } {
     set meanrainmm {   38.9 34.5 68.3 92.5 84.3 96.0 93.0 107.2 97.0 61.2 74.2 62.7 62.7 }

     set rainydays { 7.3 6.2 9.0 9.5 8.9 8.0 8.0 7.5 7.7 6.6 7.9 7.8 7.8 7.8 }

   set meanmin { -10.6 -8.2 -1.9 3.7 8.7 14.2 17.0 16.4 12.2 5.7 -0.2 -7.2 -7.2 -7.2  }
     set meanmax {-1.7 0.8 7.7 14.8 21.2 26.4 28.7 27.7 23.8 17.4 9.1 1.1 1.1 1.1  }
   }

     set systemTime [clock seconds]

    set day [clock format $systemTime -format %j ]
    set mean1 " mean min temp [ meanmonth $day $meanmin] "
    set mean2 "mean max temp [ meanmonth $day $meanmax]"
     set mean3 " mean perc.  in mm per m [ meanmonth $day  $meanrainmm] "
    set mean4 " Rainy days per m [format "%6.2f" [ meanmonth $day $rainydays]]  "

    set mean5 " chance of rainy day in month[format "%6.2f" [expr {[ meanmonth $day $rainydays]/30.}]]"

    set mean6 " mean perc. in mm per day [format "%6.2f" [ expr {[ meanmonth $day  $meanrainmm]/30.}]] "
     set systemTime [clock seconds]
    set hour [clock format $systemTime -format %k -timezone $zone]
    #set hour 13.
    set mean7 [ meanmonth $day $meanmin]
    set mean8 [ meanmonth $day $meanmax]
      if { $hour < 12. } { set mean7 " mean interpolated temp.($hour H) C deg. [format "%6.2f" [interlinear .00001 10. 12. $mean7 $mean8 ]] "}
      if { $hour >= 12. } { set mean7 " mean interpolated temp.($hour H) C deg. [format "%6.2f" [interlinear 12. $hour 24. $mean7 $mean8 ] ] "}

    set kick [ tempform [ meanmonth $day $meanmin]  [ meanmonth $day $meanmax]   $hour]
     set kick [ expr { abs($kick) } ]
    set mean8 " cosine' formula   [format "%6.2f" $kick] C. "
      
     set mean9 " chinese fortnight [cmonth $day ]"
    #set mean7 " mean interpolated temp. C deg.  [interlinear 12. $hour 24. $mean7 $mean8 ] "
     $w create text 200   300 -text $mean1  -tags "text"  -font $font5

  $w create text 200   320 -text $mean2  -tags "text"  -font $font5
  $w create text 200   340 -text $mean3  -tags "text"  -font $font5
  $w create text 200   360 -text $mean6  -tags "text"  -font $font5
  $w create text 200   380 -text $mean4  -tags "text"  -font $font5
  $w create text 200   400 -text $mean5  -tags "text"  -font $font5
  $w create text 200   280 -text $mean7  -tags "text"  -font $font5
  $w create text 200   265 -text $mean8  -tags "text"  -font $font5

   #console show
   #puts [ tempform [ meanmonth $day $meanmin]  [ meanmonth $day $meanmax]   $hour     ]
   }
      proc seer {state3} {
   global xpieces
   #set state3 [lpick { 1 2 3 4 5 6 7 8 } ]

      if { $state3 == 0 } {return " 1   Force   heaven   northwest   * colder and change,ice,snow"}
     if { $state3 == 1 } {return " 2   Open   swamp   west          * damp and dewy,rain    "}
     if { $state3 == 2 } {return " 3   Radiance   fire   south      * hot and sunny,less clouds"}
     if { $state3 == 3 } {return " 4   Shake   thunder   east       * stormy"}
     if { $state3 == 4 } {return " 5   Ground   wind   southeast    * windy and change"}
     if { $state3 == 5 } {return " 6   Gorge   water   north        * colder and rain,rain,snow,fog "}
    if { $state3 == 6 } {return " 7   Bound   mountain  northeast  * change for better, clouds"}
       if { $state3 == 7 } {return " 8   Field   earth   southwest    *  cloudy,foggy"}
    set guess "?"
  return $guess
   }

  proc leave {w} {
     exit
  }

   proc board {w} {
    #set state3 1
    set state2 1
    clrcanvas $w
    . configure -background orange -highlightcolor brown -relief raised -border 30
    $w configure -bg tan

    }

  #: Main :
  frame .f1
  frame .f2
  pack  .f1 .f2

  set maxX 400
  set maxY 450
  set y      0

  set x1 120
  set x2 150
  set y1  50
  set y2  80

  canvas  .cv -width $maxX -height $maxY  -bg tan
  pack    .cv -in .f1

  button  .b0 -text "clear" -command { clrcanvas .cv }
  button  .b1 -text "chicago"  -command {clrcanvas .cv;pick .cv :America/Chicago     }
  button  .b2 -text "hongkong"  -command { clrcanvas .cv;pick .cv :Asia/Hong_Kong  }
  button  .b3 -text "shanghai"   -command {clrcanvas .cv;pick .cv :Asia/Shanghai}
  button  .b4 -text "beijing"   -command {clrcanvas .cv;pick   .cv :Asia/Taipei }
  button  .b5 -text "board"   -command { board   .cv }
      button  .b6 -text "cos"   -command { sinwave  .cv }
      button  .b7 -text "exit"   -command {leave   .cv }
      button  .b8 -text "exit"   -command {leave   .cv }
  pack .b0 .b1 .b2 .b3 .b4 .b5  .b6 .b7 .b7 .b8 -in .f2  -side left -padx 2
     board   .cv
 #catch {console show}


***FIRST VERSION*** 
 ======

*SECOND VERSION WITH ADDED HACKS

     #start of deck#!/bin/sh
    #based on 
    # demo2-canvas.tcl - HaJo Gurt - 2005-12-13 - http://wiki.tcl.tk/15073
    #:by gold,   chinese  iChing random weather 


 # written on Windowws XP on eTCL 
     # working under TCL version 8.5.6 and eTCL 1.0.1 
     # gold on TCL WIKI , 17Jul2010




    set xpieces {  \u2630 \u2631 \u2632 \u2633 \u2634 \u2635 \u2636 \u2637} 
     package require Tk
    proc lpick L {lindex $L [expr int(rand()*[llength $L])];}
     proc average L {expr ([join $L +])/[llength $L].}





 
  proc meanmonth {julianday monthdata} {
     
   set goofy [ expr {$julianday / 30.}]
   set month [ expr {int( $goofy)}]
  
   set answer [lindex $monthdata $month]
 

   return $answer
  }
  proc meanrelmonth {julianday monthdata} {
     
   set goofy [ expr {$julianday / 30.}]
   set month [ expr {int( $goofy)}]
   set x1 6
   set x2 8
   set x3 10
   set y1 5
   set y3 8
   set answer5 [expr { ((x2-x1)*(y3-y1))/(x3-x1)) + y1 } ]
   set answer [lindex $monthdata $month]
   set answer2 [lindex $monthdata $month]
   set answer3 [lindex $monthdata [ expr { $month + 1} ]]
   set average [ expr {($answer +$answer3)/2}]
   set portion [ expr {($answer +$answer3)/2}]
   return $answer
  }

      proc interlinear { xx1 xx2 xx3 yy1 yy3 } {
        return [expr {  ((($xx2-$xx1)*($yy3-$yy1))/($xx3-$xx1))+ $yy1 } ] ;}


proc ClrCanvas {w} {
    $w delete  "all" 
  }

  proc DrawAxis {w} {
    set midX [expr { $::maxX / 2 }]
    set midY [expr { $::maxY / 2 }]
    $w create line 0     $midY  $::maxX   $midY  -tags "axis"
    $w create line $midX 0        $midX $::maxY  -tags "axis"
  }

  proc PaintText {w Txt} {
    global y
    incr y 10
    $w create text 20 $y -text $Txt -tags "text"
  }




  proc pick {w  } {
    global y xpieces
    incr y 10
    set txt canvas
   
 
  set boo 50
  set font2  "Helvetica 120"
  set font5  "Helvetica 10"
    set color4 blue
    set state3 [lpick { 0 1 2 3 4 5 6 7  } ]
     set texter [ lindex  $xpieces $state3] 
 $w create text 100   150 -text $texter -font $font2 -width $boo -fill $color4 -tag obj_357034101 
    
    $w create text 200   230 -text [seer $state3 ]  -tags "text"  -font $font5
       set texter [ lpick $xpieces]

   set state3 [lpick { 0 1 2 3 4 5 6 7  } ]
     set texter [ lindex  $xpieces $state3] 

 $w create text  300   150 -text $texter -font $font2 -width $boo -fill $color4 -tag obj_672148664 
 set systemTime [clock seconds]

# "The time is: [clock format $systemTime -format %H:%M:%S]"
# "The date is: [clock format $systemTime -format %j]"
# [clock format $systemTime -format {Today is: %A, the %d of %B, %Y}]

 $w create text 200   250 -text [seer $state3 ]  -tags "text"  -font $font5
   $w create text 200   425 -text "julian date is [clock format $systemTime -format %j ]"  -tags "text"  -font $font5
 $w create text 200   440 -text [  clock format [clock scan now]]  -tags "text"  -font $font5
weathermean .cv
         
  }
        
     proc weathermean {w} {
    set boo 50
  set font2  "Helvetica 120"
  set font5  "Helvetica 10"
     set meanmax { 1.6 4.0 11.3 19.9 26.4 30.3 30.8 29.5 25.8 19.0 10.1 3.3 3.3}  


 set meanrainmm { 3 6  9 26 29 71  176 182  49  19 6 2 2 2 2}  

 set rainydays { 2 3 4 5 6 9 14 12 7 5 3  2 2 2 2}

   set meanmin {-9.4 -9.4 -6.9 -0.6 7.2 13.2 18.2 21.6  20.4  14.2  7.3 7.3 7.3}  
    set systemTime [clock seconds]

    set day [clock format $systemTime -format %j ]
    set mean1 " mean min temp [ meanmonth $day $meanmin] "
    set mean2 "mean max temp [ meanmonth $day $meanmax]"
     set mean3 " mean perc.  in mm per m [ meanmonth $day  $meanrainmm] "
    set mean4 " Rainy days per m [ meanmonth $day $rainydays]  " 
     
    set mean5 " chance of rainy day in month [expr {[ meanmonth $day $rainydays]/30.}]"
  

    set mean6 " mean perc. in mm per day [ expr {[ meanmonth $day  $meanrainmm]/30.}] "
     set systemTime [clock seconds]
    set hour [clock format $systemTime -format %k ]
    #set hour 13.
    set mean7 [ meanmonth $day $meanmin] 
    set mean8 [ meanmonth $day $meanmax]
      if { $hour < 12. } { set mean7 " mean interpolated temp.($hour H) C deg.  [interlinear .00001 10. 12. $mean7 $mean8 ] "}
      if { $hour >= 12. } { set mean7 " mean interpolated temp.($hour H) C deg.  [interlinear 12. $hour 24. $mean7 $mean8 ] "}

     #set mean7 " mean interpolated temp. C deg.  [interlinear 12. $hour 24. $mean7 $mean8 ] "
     $w create text 200   300 -text $mean1  -tags "text"  -font $font5

  $w create text 200   320 -text $mean2  -tags "text"  -font $font5
  $w create text 200   340 -text $mean3  -tags "text"  -font $font5
  $w create text 200   360 -text $mean6  -tags "text"  -font $font5
  $w create text 200   380 -text $mean4  -tags "text"  -font $font5
  $w create text 200   400 -text $mean5  -tags "text"  -font $font5
  $w create text 200   280 -text $mean7  -tags "text"  -font $font5
   }
      proc seer {state3} {
   global xpieces
   #set state3 [lpick { 1 2 3 4 5 6 7 8 } ]
   
if { $state3 == 0 } {return " 1   Force   heaven   northwest   * colder and change,ice,snow"}
if { $state3 == 1 } {return " 2   Open   swamp   west          * damp and dewy,rain    "}
if { $state3 == 2 } {return " 3   Radiance   fire   south      * hot and sunny,less clouds"}
if { $state3 == 3 } {return " 4   Shake   thunder   east       * stormy"}
if { $state3 == 4 } {return " 5   Ground   wind   southeast    * windy and change"}
if { $state3 == 5 } {return " 6   Gorge   water   north        * colder and rain,rain,snow,fog "}
if { $state3 == 6 } {return " 7   Bound   mountain  northeast  * change for better, clouds"}
if { $state3 == 7 } {return " 8   Field   earth   southwest    *  cloudy,foggy"}
 set guess "?"
  return $guess
}

  proc DrawBox {w} {
    global x1 y1 x2 y2
    $w create rect  50  10  100  60  -tags "box"
    $w create rect $x1 $y1  $x2 $y2  -tags "box"
    incr x1 15
    incr x2 15
    incr y1 10
    incr y2 10
  }

  proc leave {w} {
     exit
  }

  
   proc board {w} {
    #set state3 1
    set state2 1
    ClrCanvas $w
    . configure -background orange -highlightcolor brown -relief raised -border 30
    $w configure -bg tan


     
    
    }
       


  #: Main :
  frame .f1
  frame .f2
  pack  .f1 .f2

  set maxX 400
  set maxY 450
  set y      0

  set x1 120
  set x2 150
  set y1  50
  set y2  80

  canvas  .cv -width $maxX -height $maxY  -bg tan 
  pack    .cv -in .f1

  button  .b0 -text "Clear" -command { ClrCanvas .cv }
  button  .b1 -text "Text"  -command { PaintText .cv "Canvas" }
  button  .b2 -text "Axis"  -command { DrawAxis  .cv }
  button  .b3 -text "Box"   -command { DrawBox   .cv }
  button  .b4 -text "pick"   -command {ClrCanvas .cv;pick   .cv }
  button  .b5 -text "board"   -command { board   .cv }
 button  .b6 -text "exit"   -command {leave   .cv }
 button  .b7 -text "exit"   -command {leave   .cv }
  pack .b0 .b1 .b2 .b3 .b4 .b5  .b6 .b7 -in .f2  -side left -padx 2
board   .cv
 #catch {console show}
        #start of deck
        #start of deck #!/bin/sh
 # Restart with tcl: -*- mode: tcl; tab-width: 4; -*- \
 exec wish $0 ${1+"$@"}
 


    #end of deck
    #end of deck
      #end of deck
      #end of deck      
      #end of deck
    #end of deck


****Version with added hacks ****





    #start of deck
        #start of deck
        #start of deck 
       
#!/bin/sh
 # Restart with tcl: -*- mode: tcl; tab-width: 4; -*- \
 exec wish $0 ${1+"$@"}
#based on 
 # demo2-canvas.tcl - HaJo Gurt - 2005-12-13 - http://wiki.tcl.tk/15073
 #:by gold,   chinese  iChing random weather 


 # written on Windowws XP on eTCL 
     # working under TCL version 8.5.6 and eTCL 1.0.1 
     # gold on TCL WIKI , 17Jul2010








 set xpieces {  \u2630 \u2631 \u2632 \u2633 \u2634 \u2635 \u2636 \u2637} 
  package require Tk
 proc lpick L {lindex $L [expr int(rand()*[llength $L])];}
  proc average L {expr ([join $L +])/[llength $L].}





 
  proc meanmonth {julianday monthdata} {
     
   set goofy [ expr {$julianday / 30.}]
   set month [ expr {int( $goofy)}]
  
   set answer [lindex $monthdata $month]
 

   return $answer
  }
 

 proc interlinear { xx1 xx2 xx3 yy1 yy3 } {
 return [expr {  ((($xx2-$xx1)*($yy3-$yy1))/($xx3-$xx1))+ $yy1 } ] ;}
 proc listnumbers { aa bb} { for {set i [ expr {int($aa)}]} {$i<=$bb} {incr i} {lappend dd [ expr .1* $i] };return $dd}
    
 proc sinwave { w } {
   console show
  
   set goo [listnumbers 1 70 ]
  foreach item   $goo  {
    puts [ expr { cos ($item) } ]
     }
    
  
 }



proc clrcanvas {w} {
    $w delete  "all" 
  }

 


  proc pick {w zone } {
    global y xpieces
    incr y 10
    set txt canvas
   
 
  set boo 50
  set font2  "Helvetica 120"
  set font5  "Helvetica 10"
    set color4 blue
    set state3 [lpick { 0 1 2 3 4 5 6 7  } ]
     set texter [ lindex  $xpieces $state3] 
 $w create text 100   150 -text $texter -font $font2 -width $boo -fill $color4 -tag obj_357034101 
    
    $w create text 200   230 -text [seer $state3 ]  -tags "text"  -font $font5
       set texter [ lpick $xpieces]

   set state3 [lpick { 0 1 2 3 4 5 6 7  } ]
     set texter [ lindex  $xpieces $state3] 

 $w create text  300   150 -text $texter -font $font2 -width $boo -fill $color4 -tag obj_672148664 
 set systemTime [clock seconds]

# "The time is: [clock format $systemTime -format %H:%M:%S]"
# "The date is: [clock format $systemTime -format %j]"
# [clock format $systemTime -format {Today is: %A, the %d of %B, %Y}]

 $w create text 200   250 -text [seer $state3 ]  -tags "text"  -font $font5
   $w create text 200   425 -text "julian date is [clock format $systemTime -format %j -timezone $zone]"  -tags "text"  -font $font5
 $w create text 200   440 -text [  clock format [clock scan now] -timezone $zone]  -tags "text"  -font $font5
weathermean .cv $zone
         
  }
        
     proc weathermean {w zone} {
    set boo 50
  set font2  "Helvetica 120"
  set font5  "Helvetica 10"
     set meanmax { 1.6 4.0 11.3 19.9 26.4 30.3 30.8 29.5 25.8 19.0 10.1 3.3 3.3}  

    if { $zone == ":Asia/Shanghai" } {
 set meanrainmm { 3 6  9 26 29 71  176 182  49  19 6 2 2 2 2}  

 set rainydays { 2 3 4 5 6 9 14 12 7 5 3  2 2 2 2}

   set meanmin {-9.4 -9.4 -6.9 -0.6 7.2 13.2 18.2 21.6  20.4  14.2  7.3 7.3 7.3}  
  }

 if { $zone == ":Asia/Hong_Kong" } {
 set meanrainmm { 3 6  9 26 29 71  176 182  49  19 6 2 2 2 2}  

 set rainydays { 2 3 4 5 6 9 14 12 7 5 3  2 2 2 2}

   set meanmin {-9.4 -9.4 -6.9 -0.6 7.2 13.2 18.2 21.6  20.4  14.2  7.3 7.3 7.3}  
  }

  if { $zone == ":Asia/Taipei" } {
 set meanrainmm { 3 6  9 26 29 71  176 182  49  19 6 2 2 2 2}  

 set rainydays { 2 3 4 5 6 9 14 12 7 5 3  2 2 2 2}

   set meanmin {-9.4 -9.4 -6.9 -0.6 7.2 13.2 18.2 21.6  20.4  14.2  7.3 7.3 7.3}  
  }

    if { $zone == ":America/Chicago" } {
 set meanrainmm { 3 6  9 26 29 71  176 182  49  19 6 2 2 2 2}  

 set rainydays { 2 3 4 5 6 9 14 12 7 5 3  2 2 2 2}

   set meanmin {-9.4 -9.4 -6.9 -0.6 7.2 13.2 18.2 21.6  20.4  14.2  7.3 7.3 7.3}  
  }


     set systemTime [clock seconds]

    set day [clock format $systemTime -format %j ]
    set mean1 " mean min temp [ meanmonth $day $meanmin] "
    set mean2 "mean max temp [ meanmonth $day $meanmax]"
     set mean3 " mean perc.  in mm per m [ meanmonth $day  $meanrainmm] "
    set mean4 " Rainy days per m [format "%6.2f" [ meanmonth $day $rainydays]]  " 
     
    set mean5 " chance of rainy day in month[format "%6.2f" [expr {[ meanmonth $day $rainydays]/30.}]]"
  

    set mean6 " mean perc. in mm per day [format "%6.2f" [ expr {[ meanmonth $day  $meanrainmm]/30.}]] "
     set systemTime [clock seconds]
    set hour [clock format $systemTime -format %k -timezone $zone]
    #set hour 13.
    set mean7 [ meanmonth $day $meanmin] 
    set mean8 [ meanmonth $day $meanmax]
      if { $hour < 12. } { set mean7 " mean interpolated temp.($hour H) C deg. [format "%6.2f" [interlinear .00001 10. 12. $mean7 $mean8 ]] "}
      if { $hour >= 12. } { set mean7 " mean interpolated temp.($hour H) C deg. [format "%6.2f" [interlinear 12. $hour 24. $mean7 $mean8 ] ] "}

     #set mean7 " mean interpolated temp. C deg.  [interlinear 12. $hour 24. $mean7 $mean8 ] "
     $w create text 200   300 -text $mean1  -tags "text"  -font $font5

  $w create text 200   320 -text $mean2  -tags "text"  -font $font5
  $w create text 200   340 -text $mean3  -tags "text"  -font $font5
  $w create text 200   360 -text $mean6  -tags "text"  -font $font5
  $w create text 200   380 -text $mean4  -tags "text"  -font $font5
  $w create text 200   400 -text $mean5  -tags "text"  -font $font5
  $w create text 200   280 -text $mean7  -tags "text"  -font $font5
   }
      proc seer {state3} {
   global xpieces
   #set state3 [lpick { 1 2 3 4 5 6 7 8 } ]
   
if { $state3 == 0 } {return " 1   Force   heaven   northwest   * colder and change,ice,snow"}
if { $state3 == 1 } {return " 2   Open   swamp   west          * damp and dewy,rain    "}
if { $state3 == 2 } {return " 3   Radiance   fire   south      * hot and sunny,less clouds"}
if { $state3 == 3 } {return " 4   Shake   thunder   east       * stormy"}
if { $state3 == 4 } {return " 5   Ground   wind   southeast    * windy and change"}
if { $state3 == 5 } {return " 6   Gorge   water   north        * colder and rain,rain,snow,fog "}
if { $state3 == 6 } {return " 7   Bound   mountain  northeast  * change for better, clouds"}
if { $state3 == 7 } {return " 8   Field   earth   southwest    *  cloudy,foggy"}
 set guess "?"
  return $guess
}

 

  proc leave {w} {
     exit
  }

  
   proc board {w} {
    #set state3 1
    set state2 1
    clrcanvas $w
    . configure -background orange -highlightcolor brown -relief raised -border 30
    $w configure -bg tan


     
    
    }
       


  #: Main :
  frame .f1
  frame .f2
  pack  .f1 .f2

  set maxX 400
  set maxY 450
  set y      0

  set x1 120
  set x2 150
  set y1  50
  set y2  80

  canvas  .cv -width $maxX -height $maxY  -bg tan 
  pack    .cv -in .f1

  button  .b0 -text "clear" -command { clrcanvas .cv }
  button  .b1 -text "chicago"  -command {clrcanvas .cv;pick .cv :America/Chicago     }
  button  .b2 -text "hongkong"  -command { clrcanvas .cv;pick .cv :Asia/Hong_Kong  }
  button  .b3 -text "shanghai"   -command {clrcanvas .cv;pick .cv :Asia/Shanghai}
  button  .b4 -text "peking"   -command {clrcanvas .cv;pick   .cv :Asia/Taipei}
  button  .b5 -text "board"   -command { board   .cv }
 button  .b6 -text "cos"   -command { sinwave  .cv }
 button  .b7 -text "exit"   -command {leave   .cv }
  pack .b0 .b1 .b2 .b3 .b4 .b5  .b6 .b7 -in .f2  -side left -padx 2
board   .cv
 #catch {console show}


      #end of deck
      #end of deck* 
       #end of deck
      #end of deck
      #end of deck
      #end of deck







    #end of deck
    #end of deck
   #end of deck
   #end of  deck
   #end of deck
   #end of deck
    #end of deck
 

test on fonts

      {