[sf-lug] [PYCLASS] Session 3: Monday Oct 6
jim
jim at well.com
Fri Oct 3 11:10:02 PDT 2008
good points!
a very crude iterative tool is provided
in the functions that take function names
and then repeat them some specific number
of times.
would have been interesting to explore
a do_twice() function that can be called
recursively, which would handle (powers of
two) times (doing something) repeatedly.
you want 13? somehow combine
do_twice(depth = 3) with do_twice(depth = 2)
with do_once().
not that i've coded it.
On Fri, 2008-10-03 at 10:16 -0700, Alex Kleider wrote:
>
> --- On Fri, 10/3/08, jim <jim at well.com> wrote:
>
> >
> > # "matrix" means grid of all boxes
> > determine number of boxes in the matrix
> > determine horizontal and vertical dimensions of boxes
> > calculate horizontal line length (box_horizontal *
> > num_boxes)
> >
> > at start point, print "+ '
> > label:
> > build boxes across loop Z times:
> > build horizontal line loop Y number of times:
> > print some number X of "- "
> > print a "+"
> > at end of line print "\n"
> > do verticals
> > print "/ "
> > build horizontal line loop Y number of times:
> > print some number X of " "
> > print "/ "
> > at end of line print "\n"
> > goto label N times to make N rows of boxes
> >
>
> My frustrations with this exercise is that we have not yet been exposed to iterative (for, while, etc) constructs so your methodology as I understand it can not work with in the limits of what we've covered so far.
> But wait until the next chapter!
> In my humble opinion, we should allow two weeks for completion of exercises for chapter 4. There's a huge amount of work to do there,
> but at least the for loop is introduced giving us the tool we so sorely miss in doing the grid exercise this week.
> All of this is very time consuming but great fun.
>
>
>
>
>
> _______________________________________________
> sf-lug mailing list
> sf-lug at linuxmafia.com
> http://linuxmafia.com/mailman/listinfo/sf-lug
>
More information about the sf-lug
mailing list