[Tutor] FW: 1 to 49 numbered grid
boB Stepp
robertvstepp at gmail.com
Thu Dec 8 10:41:11 EST 2016
Forwarding this to the Tutor list. Please note that your formatting
will be lost. Again, this is a plain text list. Also, please don't
top-post.
On Thu, Dec 8, 2016 at 9:38 AM, M Ali <MAli6 at dixonsaa.com> wrote:
> Hi Bob
>
>
>
> I am trying to create the below and wanted an idea as to how I can start it
> off. I am willing to put the hours in and create the program myself from
> scratch before I can start teaching my students it. I would appreciate it if
> you can guide me and get me started:
>
>
>
> • There are board positions 1 to 49
>
> • There are two players
>
> • Each player takes it in turn to play
>
> • A player rolls two dice (1‐6 each) o Display value of dice rolled o
> Player moves that number of places
>
> o IF a double is rolled, then move back that number of spaces
>
> o Message must be displayed with dice numbers o Message must be displayed
> when a double is rolled
>
> • Player wins by getting to square 49 o Does not need to be exact
>
> • Must have a start game message
>
> • Must have a 'won' message
>
> • All messages need to be stored in a text file and loaded at the start
> of the program
>
> • Need to have 4 obstacles stored in a text file, along with the number
> of squares they move forward or backward by. Must be loaded at the start of
> the game
>
>
>
>
>
> From: M Ali
> Sent: 08 December 2016 15:22
> To: 'boB Stepp'
> Subject: RE: [Tutor] 1 to 49 numbered grid
> Importance: High
>
>
>
> Hi Bob
>
>
>
> Thank you ever so much in getting in touch. I have been given an exemplar
> work of what I am suppose do by examination board, but it’s in VB and I am
> using Python 3.3.4 version. I do not know where to start from as I have
> never created a program like this before. I am trying to create something
> like this in Python and was wondering would it be possible.
>
>
>
>
>
> My students need to create something like the above, but I am not sure where
> to start from and any help or start will be much appreciated.
>
>
>
> Regards
>
>
>
> Mr Ali
>
>
>
> From: boB Stepp [mailto:robertvstepp at gmail.com]
> Sent: 08 December 2016 15:02
> To: M Ali
> Cc: tutor at python.org
> Subject: Re: [Tutor] 1 to 49 numbered grid
>
>
>
> Apologies! My ever friendly Gmail reset my font preferences along the way
> and put me on a non-monospace font. However, I hope the OP can determine my
> intent below despite the misalignment of my big one.
>
>
>
> Cheers!
>
> boB
>
> On Thu, Dec 8, 2016 at 8:51 AM, boB Stepp <robertvstepp at gmail.com> wrote:
>> Greetings!
>>
>> On Thu, Dec 8, 2016 at 4:00 AM, M Ali <MAli6 at dixonsaa.com> wrote:
>>>
>>> I was wondering if you can help me, as I am struggling to create a
>>> numbered grid in Python. I am trying to be able to create a snakes and
>>> ladders game in Python and it must have a numbered grid and involve 2
>>> players. I would appreciate it if you can help me or guide me to create this
>>> game.
>>
>> There are plenty of people here ready and willing to help. However,
>> you will need to be much more specific on where you are stuck.
>> Normally you should clearly state the problem you are trying to solve,
>> show the code relevant to your problem that you have written (copy and
>> paste), give any error tracebacks in full (copy and paste), state what
>> you were trying to do and what you expected, etc. It is also usually
>> helpful to state what version of Python you are using and your
>> operating system. Be forewarned: We will *not* do your homework for
>> you. You need to show effort and we will help you when you get stuck.
>>
>> As to what little you said, if you are printing your grid of numbers
>> to a terminal window, perhaps using triple quotes might be helpful?
>> Suppose you wanted a big number one:
>>
>> print("""
>> __
>> / |
>> |
>> |
>> |
>> |
>> ___|___
>> """)
>>
>> You could do things like set a variable equal to such a string. For
>> instance you can replace the print() with "one =" and put your
>> triple-quoted string here. You could do the same with variables two,
>> three, ... , nine. This might give you more flexibility down the
>> line. For instance you could have a dictionary of big numbers based
>> on doing this that might correlate with your grid numbers. As for
>> your grid you could do similar things, break your grid boxes into
>> repeating tiles and store these elements in a suitable variable to
>> reuse as needed. I am being very general here, but perhaps this can
>> give you some ideas.
>>
>> HTH!
>>
>>
>> --
>> boB
>
>
>
> --
> boB
--
boB
More information about the Tutor
mailing list