Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Not a winner for sure, but I think it can be a golfed a little more.
time {set p "";time {set p [string totitletot [lindex $d [expr int(rand()*[llength $d])]]]$p} 4;puts $p\ [expr 5.7004*[string lengthle $p]]} 5
Try it online!Try it online!
time {set p "";time {set p [string totitle [lindex $d [expr int(rand()*[llength $d])]]]$p} 4;puts $p\ [expr 5.7004*[string length $p]]} 5
Try it online!
time {set p "";time {set p [string tot [lindex $d [expr int(rand()*[llength $d])]]]$p} 4;puts $p\ [expr 5.7004*[string le $p]]} 5
demo — The line 1 purpose is only to put the dictionary contents into the variable dTry it online!
d
demo — The line 1 purpose is only to put the dictionary contents into the variable d
#tcl, 137