**Sumerian Workcrew & Payroll and eTCL Slot Calculator Demo Example** This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER in your comment with the same courtesy that I will give you. Its very hard to reply intelligibly without some background of the correspondent. Thanks,[gold] ---- <> [gold] Here is some eTCL starter code for calculating workcrews and materials from dimensions of ancient Sumerian buildings. The impetus for these calculations was checking reed and mud brick construction in some accounts from UrIII. Most of the testcases involve replicas or models, using assumptions and rules of thumb. The eTCL calculator is using proportions from a family home or apartment of 8 sar bricks to develop a workcrew report. These workcrew reports appear to be issued on a daily basis for payment of workcrews, but do not present a complete picture of the property. Sometimes the deeds, wills, and court cases will give more details of the property walls and boundaries. Not all features or lines shown in the eTCL calculator may be found in an individual accounting report. The average Sumerian mudbrick house was about 90 sq. meters, and the average room size was 3 meters width by 3.65 meters length,3* 3.65, or about 10.95 square meters (from several excavations). The coefficient 20 E2 DU3.A (house build work in base 60) was 20/60 sar or 10.6 sqm, the size of a room or family home apartment. The Sumerian mudbrick houses generally contained rooms of 11 square meters built around a central courtyard. For a testcase, the general guidelines suggest about 6 rooms (3*3.6 m.) on both sides of a central courtyard about 5 meters wide. *** Pseudocode and Equations *** ====== area = [* length width ] # square meters Sumerian price in silver = [/ liters 300.] Sumerian price in liters grain = [* silver 300.] # 1 silver piece = 1 gur = 300 liters of grain liters = [* volume_in_cubic_cm .001] price? = raw materials + labor + profit price? = raw materials + heat process price? = raw materials + labor average price per unit = revenue / units sold ====== *** Table 1, Date Production*** ---- ---- ***Testcases Section*** In planning any software, it is advisable to gather a number of testcases to check the results of the program. The math for the testcases can be checked by pasting statements in the TCL console. Aside from the TCL calculator display, when one presses the report button on the calculator, one will have console show access to the capacity functions (subroutines). **** Testcase 1 **** ---- ***Screenshots Section*** ****figure 1.**** [http://s23.postimg.org/otsyflx97/sumerian_date_tree_production_calculator_TCL_WIK.png] ---- ***References:*** * Cocquerillat, D. 1968. Palmearies et cultures de l’Enna d’Uruk (559–520). * Cuneiform Digital Library Journal, search on Equivalency Values * Ur III Equivalency Values[http://cdli.ox.ac.uk/wiki/doku.php?id=ur_iii_equivalency_values] * Especially, the Ur III Equivalency Values for dates sections. * The Sumerian keywords search on the cdli * are very effective, but major size files to download ---- **Appendix Code** ***appendix TCL programs and scripts *** ====== # pretty print from autoindent and ased editor # Sumerian date tree production calculator # pretty print from autoindent and ased editor # Sumerian construction workcrew report calculator # written on Windows XP on eTCL # working under TCL version 8.5.6 and eTCL 1.0.1 # gold on TCL WIKI , 14jun2014 package require Tk namespace path {::tcl::mathop ::tcl::mathfunc} frame .frame -relief flat -bg aquamarine4 pack .frame -side top -fill y -anchor center set names {{} {length meters:} } lappend names {width meters:} lappend names {height meters : } lappend names {wall thickness meters: } lappend names {answer: material cubic meters} lappend names {vol of Sumerian bricks cubic meters:} lappend names {number of Sumerian bricks: } foreach i {1 2 3 4 5 6 7} { label .frame.label$i -text [lindex $names $i] -anchor e entry .frame.entry$i -width 35 -textvariable side$i grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1 } proc volx { aa bb cc } { set volem [* $aa $bb $cc ] return $volem } proc about {} { set msg "Calculator for Sumerian Workcrew Report from TCL WIKI, written on eTCL " tk_messageBox -title "About" -message $msg } proc calculate { } { global answer2 global side1 side2 side3 side4 side5 global side6 side7 testcase_number global tlength global tlengthsq surfacearea global tlengthx global brick1 brick2 brick3 brick4 brick5 global brick6 brick6 brick7 brick8 brick9 global brick10 brick11 brick12 brick14 global brick15 brick16 brick17 brick18 global brick19 brick20 brick21 brick22 global brick23 brick24 brick25 brick26 global brick27 brick28 brick29 brick30 incr testcase_number set tlength [* $side1 1. ] set twidth [* $side2 1. ] set theight [* $side3 1. ] set tthickness [* $side4 1. ] set brickl 0.33 set brickw 0.33 set brickt 0.08 set brickvolx [volx 0.33 0.33 0.08] set wallside [volx $tlength $theight $tthickness] set wallfront [volx $twidth $theight $tthickness] set totalvolx [+ [* $wallside 2. ] [* $wallfront 2. ]] set brickvol [* 0.33 0.33 0.08] set bricknumx [/ $totalvolx $brickvol ] set bricksar [/ $bricknumx 720. ] set brick2 [int [* $bricksar [/ 24. 8. ]]] set brick1 $bricksar set brick3 [int [* $bricksar [/ 16. 8. ]]] set brick4 [int [* $bricksar [/ 8. 8. ]]] set brick5 [int [* $bricksar [/ 9. 8. ]]] set brick6 [int [* $bricksar [/ 3. 8. ]]] set brick7 [int [* $bricksar [/ 18. 8. ]]] set brick8 [int [* $bricksar [/ 6. 8. ]]] set brick10 [+ $brick2 $brick3 $brick4 $brick5 $brick6 $brick7 $brick8 ] set side5 $totalvolx set side6 $brickvol set side7 $bricknumx } proc fillup {aa bb cc dd ee ff gg} { .frame.entry1 insert 0 "$aa" .frame.entry2 insert 0 "$bb" .frame.entry3 insert 0 "$cc" .frame.entry4 insert 0 "$dd" .frame.entry5 insert 0 "$ee" .frame.entry6 insert 0 "$ff" .frame.entry7 insert 0 "$gg"} proc clearx {} { foreach i {1 2 3 4 5 6 7} { .frame.entry$i delete 0 end } } proc reportx {} { global side1 side2 side3 side4 side5 global side6 side7 testcase_number global tlengthsq surfacearea global tlength global brick1 brick2 brick3 brick4 brick5 global brick6 brick6 brick7 brick8 brick9 global brick10 brick11 brick12 brick14 global brick15 brick16 brick17 brick18 global brick19 brick20 brick21 brick22 global brick23 brick24 brick25 brick26 global brick27 brick28 brick29 brick30 console show; puts "%|table| printed in|TCL WIKI format |% " puts "&|testcase number:| $testcase_number| |& " puts "&|building length:| $side1| |& " puts "&|building width meters: |$side2| |& " puts "&|building height meters: |$side3| |& " puts "&|building thickness meters: | $side4| |& " puts "&|material volume meters**3: |$side5| |& " puts "&|brick volume meters**3: |$side6| |& " puts "&|number of bricks: | $side7| |& " puts "&|$brick1|brick sars, 720 bricks per sar:|& " puts "*** Sumerian Workcrew Report*** " puts "&|$brick2|men making bricks:[int $brick1] brick sar|& " puts "&|$brick3|men carry bricks: 60 ninda original|& " puts "&|$brick4|men mix clay for mortar: |& " puts "&|$brick5|men carry reeds : 90 bundles original|& " puts "&|$brick6|men mix clay for mortar: |& " puts "&|$brick7|men carry reed bundles: 180 b. original |& " puts "&|$brick8|men mix clay for mortar: |& " puts "&|$brick10|total workdays: |& " puts "&| House ordered by Lugal (prince) Lu-Sara | |& " puts "&| foreman Lu-Sinnar | |& " puts "&| scribe Ur-Kul | |& " puts "&| seal | |& " } frame .buttons -bg aquamarine4 ::ttk::button .calculator -text "Solve" -command { calculate } ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 3.8 3.2 3. 1.2 50.4 .0087 5785. } ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 3.6 3. 3. 1.2 47.5 .0088 5454. } ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 30. 10. 3. 1.2 288. .0087 33050. } ::ttk::button .clearallx -text clear -command {clearx } ::ttk::button .about -text about -command about ::ttk::button .cons -text report -command { reportx } ::ttk::button .exit -text exit -command {exit} pack .calculator -in .buttons -side top -padx 10 -pady 5 pack .clearallx .cons .about .exit .test4 .test3 .test2 -side bottom -in .buttons grid .frame .buttons -sticky ns -pady {0 10} . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30 wm title . "Sumerian Workcrew Report " ====== ---- *** Pushbutton Operation*** For the push buttons, the recommended procedure is push testcase and fill frame, change first three entries etc, push solve, and then push report. Report allows copy and paste from console. For testcases in a computer session, the eTCL calculator increments a new testcase number internally, eg. TC(1), TC(2) , TC(3) , TC(N). The testcase number is internal to the calculator and will not be printed until the report button is pushed for the current result numbers (which numbers will be cleared on the next solve button.) The command { calculate; reportx } or { calculate ; reportx; clearx } can be added or changed to report automatically. Another wrinkle would be to print out the current text, delimiters, and numbers in a TCL wiki style table as ====== puts " %| testcase $testcase_number | value| units |comment |%" puts " &| volume| $volume| cubic meters |based on length $side1 and width $side2 |&" ====== ---- [gold] This page is copyrighted under the TCL/TK license terms, [http://tcl.tk/software/tcltk/license.html%|%this license]. **Comments Section** <> Please place any comments here, Thanks. <> Numerical Analysis | Toys | Calculator | Mathematics| Example