Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
|
|
@ -1,15 +1,28 @@
|
|||
doc{
|
||||
========
|
||||
Function: foo
|
||||
========
|
||||
# Determine The Average Word Name Length
|
||||
|
||||
Stack
|
||||
----
|
||||
a1 a2 - b
|
||||
To determine the average length of a word name two values
|
||||
are needed. First, the total length of all names in the
|
||||
Dictionary:
|
||||
|
||||
Usage
|
||||
-----
|
||||
Adds a1 to a2 returning b.
|
||||
}doc
|
||||
~~~
|
||||
#0 [ d:name s:length + ] d:for-each
|
||||
~~~
|
||||
|
||||
: foo ( aa-b ) + ;
|
||||
And then the number of words in the Dictionary:
|
||||
|
||||
~~~
|
||||
#0 [ drop n:inc ] d:for-each
|
||||
~~~
|
||||
|
||||
With these, a simple division is all that's left.
|
||||
|
||||
~~~
|
||||
/
|
||||
~~~
|
||||
|
||||
Finally, display the results:
|
||||
|
||||
|
||||
~~~
|
||||
'Average_name_length:_%n\n s:format s:put
|
||||
~~~
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue