This CLE consists of a series of activities, all of which are to be done with the same partner.
Use a single text file, cle8.txt
, to hold you and your partner's accumulated work.
Start it off with your two NetIDs.
cle8.txt
.
simple {|x|puts "\tx = #{x}" }statement by statement (really expression by expression), going back and forth between iterator and block as appropriate, and adding to
cle8.txt
the output of each of the puts
calls in turn.
from_to
")cle8.txt
.
from_to
as specified on slide 189 and add it to cle8.txt
.
$ irb -r ./from_to.rb >> from_to(3,4) { |x| puts x } 3 4 => 2
yield
, continued")round_trip
and says "3".
cle8.txt
.
yield
")cle8.txt
.
select
as specified on slide 194 and add it to cle8.txt
.
The box on 195 with "What does the iterator/block interaction look like?" might provide a little insight on how to write it.
A plain text file named cle8.txt
with contents as described above.
Submit it on lectura with turnin
:
turnin 372-cle8 cle8.txt