Summary: Comments Section Please place any comments here Thanks gold Change Redundant procedure deleted LV slightly reformatted code to some level of consistency added a few braces around expr arguments and removed a redundant proc definition gold Change 13Mar2007 omitted exp in expr for base2 TCL8 5 > CJL thinks that following the guidelines Screenshots Section would make this page much more readable and give browsers a chance to flow the formatting gold Change 17Mar2007 Pan feature in Kaching tcl is sticking badly Temporary fix for pan touch right mouse then use middle mouse to pan foreach piece + set chartbamboo plainsub $chartbamboo $piece set reading list split $chartbamboo end iching data proc binaryexchange gualisting converts gualisting as a list to binary decimal numbers global dx dy colors color global guabinary guadecimal guatransform set guabinary whitelist $gualisting set guabinary join split $guabinary set guabinary plainsub $guabinary 6 0 set guabinary plainsub $guabinary 7 1 set guabinary plainsub $guabinary 8 0 set guabinary plainsub $guabinary 9 1 set guabinary plainsub $guabinary return $guabinary proc second hexagram compute gualisting subroutine under test global bookvalue second hexagram set gualisting lreverse $gualisting set second hexagram list set second hexagram join $gualisting set second hexagram plainsub $second hexagram 6 7 set second hexagram plainsub $second hexagram 9 6 set guabinary binaryexchange $second hexagram set decimalout convertbase2to10 $guabinary set bookgua kvsearch $bookvalue $decimalout return $bookgua proc bonereadxx coinsread global dx dy colors color gualisting reading global bookvalue bookvalue2 second hexagram set dj 1 set gualisting list if $coinsread == 1 for set j 0 $j<6 incr j $dj set bone1 lpick 3 3 3 2 set bone2 lpick 3 3 2 2 set bone3 lpick 3 3 2 2 set bonereading expr $bone1 + $bone2 + $bone3 set wow expr $bone1 + $bone2 + $bone3 lappend gualisting $wow if $coinsread == 2 for set j 0 $j<6 incr j $dj set bone1 lpick 3 3 2 2 set bone2 lpick 3 3 2 2 set bone3 lpick 3 3 2 2 set bonereading expr $bone1 + $bone2 + $bone3 set wow expr $bone1 + $bone2 + $bone3 lappend gualisting $wow set guabinary list 1 0 1 1 1 si tiene problema set gualisting lreverse $gualisting reading hexagram lines top down opposed to reverse down top give different binary values set guabinary binaryexchange $gualisting set decimalout convertbase2to10 $guabinary set bookgua kvsearch $bookvalue2 $decimalout set second hexa second hexagram compute $gualisting wxxccc delete 1 0 end set outoutfoulspirit last bone is $wow gua listing is $gualisting binary $guabinary decimal $decimalout Iching gua $bookgua test 2nd hex $second hexagram 2nd h test $second hexa $second hexagram $reading wxxccc insert end $outoutfoulspirit proc castfortune global dx dy colors color gualisting second hexagram set colorx black for set i 0 set y 0 $i<6 incr i incr y $dy set colorx brown for set j 0 set x 0 $j<3 incr j incr x $dx set colorx brown if $j == 1 if lindex $gualisting $i == 6 set colorx white if lindex $gualisting $i == 7 set colorx brown if lindex $gualisting $i == 8 set colorx white if lindex $gualisting $i == 9 set colorx brown can create rectangle $x $y expr $x+$dx expr $y+$dy fill $colorx set dx 50 set dy 30 set colorx blue for set i 0 set y 0 $i<6 incr i incr y $dy set colorx blue for set j 0 set x 0 $j<3 incr j incr x $dx set colorx blue if $j == 1 if lindex $second hexagram $i == 6 set colorx white if lindex $second hexagram $i == 7 set colorx blue if lindex $second hexagram $i == 8 set colorx white if lindex $second hexagram $i == 9 set colorx blue can create rectangle expr $x + 180 $y expr expr $x +180 +$dx expr $y+$dy fill $colorx xskipskipdirectory $env HOME endofdeck endofdeck $text string map list $item $replacewith set text
Image Dimensions: 320 x 250
Image originally found here.