Generator/Exponential: Difference between revisions

Tidy up the task description
(add E example)
(Tidy up the task description)
Line 3:
'''Task description'''
 
:1.# Create a function returning a generator of the m'th powers of the positive integers starting from zero, in order, and without obvious or simple upper limit. (Any upper limit to the generator should not be stated in the source but should be down to factors such as the languages natural integer size limit or computational time/size).
:2.# Use it to create a generator of:
::2.1.# Squares.
::2.2.# Cubes.
:3.# Create a new generator that filters all cubes from the generator of squares.
:4.# Drop the first 20 values from this last generator of filtered results then show the next 10 values
:Note that this tasks ''requires'' the use of generators in the calculation of the result.
 
:The Tcl example correctly fulfils the task requirements.
 
'''See also'''
Anonymous user