int main(void){ int a[3302],b=3301,*c=a,d,e,f; for(e=b; --e; *c++=1) ; *c=2; for(d=2001; d--; printf("%05d",f)) for(c=a, e=b; e; f/=e--){ f += *c * 1e5; *c++ = f%e; } }translated into Tcl:
proc calce {} { list a set b 3301; set c 0; set f 0 for {set e [expr $b-1]} {$e>0} {incr e -1} { lappend a 1 } ;# fill array with 1 for(e=b;--e;*c++=1); lappend a 2 ;#*c=2; puts "Should be e =\n2.71828182845904523536028747135266249775724709369995... " for {set d 2001} {$d>0 } {puts -nonewline [format "%.5i" [expr int($f)] ] ; update } { ;#for(d=2001;d--;printf("%05d",f)) incr d -1 for {set c 0; set e $b} {$e>0} {flush stdout} {;# for(c=a,e=b;e;f/=e--){f+=*c*1e5;*c++=f%e;} set f [expr int($f + [lindex $a $c]*100000)] ;#f+=*c*1e5; lset a $c [expr round(fmod($f,$e))];# *c = f%e incr c ;# c++ set f [expr int($f/$e)] ;# f/=e incr e -1 ;#e-- } } } calceGWM 10.11.04 I have added an 'update' in the above for use with wish where the console is not updated due to the -nonewline option on puts - to see the spigot pouring numbers it is necessary to have an update.
2004-11-10 VI Also the name of the http://www.erights.org/elang/ language. Also the basis of verisity's hardware design verification tools. For want of a better link: http://www.verisity.com/partners/licensee/index.htmlAlso the logo for Eolas.