On Fri, Aug 8, 2014 at 1:50 AM, Greg Markham <greg.mark...@gmail.com> wrote:
> Hello,
>
> Python novice back again.  :)  I'm making progress in my learning process,
> but struggling whenever attempting to creatively go beyond what's required
> in the various chapter assignments.  For example, there's a simple random
> die roller program that looks like the following:


Hi Greg,

It looks like each die has the same dimensions.  What I mean is that
it looks like each "die" has the same number of lines, and each line
is the same width.  Is that assumption correct?  If so, then that
might simplify matters for you.  It sounds like you're trying to build
a "row" of dice.  To do so, you might be able to loop over the lines
of both dice at once to get the composite image.

That is:

    row[0] = die_1_lines[0] + die_2_lines[0]
    row[1] = die_1_lines[1] + die_2_lines[1]
    ...

where we take horizontal slices of each dice and stick them side by
side.  To make this work, we need to be able to get at individual
lines.  To break a string into a list of lines, see

    https://docs.python.org/2/library/stdtypes.html#str.splitlines
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to