Four is the number of letters in the ...: Difference between revisions

Content added Content deleted
Line 1,120: Line 1,120:
</pre>
</pre>


=={{header|Mathematica}}==
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<lang Mathematica>
<lang Mathematica>(*==Number names==*)
(*==Number names==*)


(*Mathematica has a built-in function for getting the name of an integer. It's a semantically rich function (dealing with many languages and grammatical variants), and consequently it would slow down our algorithm significantly. So, I've used the built-in function to seed/memoize special-purpose functions. Furthermore, the problem is suited to using a representation of the sentence that is an array of strings rather than a single monolithic string, and so these integer name functions will return arrays of strings.*)
(*Mathematica has a built-in function for getting the name of an integer. It's a semantically rich function (dealing with many languages and grammatical variants), and consequently it would slow down our algorithm significantly. So, I've used the built-in function to seed/memoize special-purpose functions. Furthermore, the problem is suited to using a representation of the sentence that is an array of strings rather than a single monolithic string, and so these integer name functions will return arrays of strings.*)
Line 1,207: Line 1,206:
},
},
"\n\n"
"\n\n"
]</lang>
]
</lang>


{{out}}
{{out}}
<pre>First two hundred one numbers in sequence:
<pre>
First two hundred one numbers in sequence:
{4, 2, 3, 6, 2, 7, 2, 3, 5, 4, 2, 4, 8, 3, 2, 3, 6, 5, 2, 3, 5, 3, 2, 3, 6, 3, 2, 3, 5, 5, 2, 3, 5, 3, 2, 3, 7, 5, 2, 3, 6, 4, 2, 3, 5, 4, 2, 3, 5, 3, 2, 3, 8, 4, 2, 3, 7, 5, 2, 3, 10, 5, 2, 3, 10, 3, 2, 3, 9, 5, 2, 3, 9, 3, 2, 3, 11, 4, 2, 3, 10, 3, 2, 3, 10, 5, 2, 3, 9, 4, 2, 3, 11, 5, 2, 3, 12, 3, 2, 3, 11, 5, 2, 3, 12, 3, 2, 3, 11, 5, 2, 3, 11, 3, 2, 3, 13, 5, 2, 3, 12, 4, 2, 3, 11, 4, 2, 3, 9, 3, 2, 3, 11, 5, 2, 3, 12, 4, 2, 3, 11, 5, 2, 3, 12, 3, 2, 3, 11, 5, 2, 3, 11, 5, 2, 3, 13, 4, 2, 3, 12, 3, 2, 3, 11, 5, 2, 3, 8, 3, 2, 3, 10, 4, 2, 3, 11, 3, 2, 3, 10, 5, 2, 3, 11, 4, 2, 3, 10, 4, 2, 3, 10, 3, 2, 3, 12, 5, 2, 3, 11}
{4, 2, 3, 6, 2, 7, 2, 3, 5, 4, 2, 4, 8, 3, 2, 3, 6, 5, 2, 3, 5, 3, 2, 3, 6, 3, 2, 3, 5, 5, 2, 3, 5, 3, 2, 3, 7, 5, 2, 3, 6, 4, 2, 3, 5, 4, 2, 3, 5, 3, 2, 3, 8, 4, 2, 3, 7, 5, 2, 3, 10, 5, 2, 3, 10, 3, 2, 3, 9, 5, 2, 3, 9, 3, 2, 3, 11, 4, 2, 3, 10, 3, 2, 3, 10, 5, 2, 3, 9, 4, 2, 3, 11, 5, 2, 3, 12, 3, 2, 3, 11, 5, 2, 3, 12, 3, 2, 3, 11, 5, 2, 3, 11, 3, 2, 3, 13, 5, 2, 3, 12, 4, 2, 3, 11, 4, 2, 3, 9, 3, 2, 3, 11, 5, 2, 3, 12, 4, 2, 3, 11, 5, 2, 3, 12, 3, 2, 3, 11, 5, 2, 3, 11, 5, 2, 3, 13, 4, 2, 3, 12, 3, 2, 3, 11, 5, 2, 3, 8, 3, 2, 3, 10, 4, 2, 3, 11, 3, 2, 3, 10, 5, 2, 3, 11, 4, 2, 3, 10, 4, 2, 3, 10, 3, 2, 3, 12, 5, 2, 3, 11}


Line 1,225: Line 1,222:
The one millionth, word is 'the' consisting of three letters.
The one millionth, word is 'the' consisting of three letters.


The ten millionth, word is 'thousand' consisting of eight letters.
The ten millionth, word is 'thousand' consisting of eight letters.</pre>
</pre>


=={{header|Nim}}==
=={{header|Nim}}==