Re: [Tutor] Struggling with logic .....

2013-01-19 Thread Alan Gauld
On 19/01/13 16:50, Barry Drake wrote: has much nicer features for a novice. Incidentally, if I re-code the example, should I alter it to Python3 syntax while I'm at it? Is there any good reason to move away from Python2? Python 3 is the future so getting used to it sooner rather than later i

Re: [Tutor] Struggling with logic .....

2013-01-19 Thread Barry Drake
On 19/01/13 14:33, Alan Gauld wrote: line is: ['1', '2', '3', '4'] Length: 4 Random Code: (3, 4, 2, 3) Result: 0 - you have a correct number in an incorrect position Result: 0 - you have a correct number in an incorrect position Result: 0 - you have a correct number in an incorrect positio

Re: [Tutor] Struggling with logic .....

2013-01-19 Thread Alan Gauld
On 19/01/13 11:14, Barry Drake wrote: I noticed it doesn't get the scoring right when there are duplicate digits! You haven't given an example with duplicate digits so I'll need to take your word for it! line is: ['1', '2', '3', '4'] Length: 4 Random Code: (3, 4, 2, 3) Result: 0 - you

[Tutor] Struggling with logic .....

2013-01-19 Thread Barry Drake
Hi there Some months ago I decided to have a crack at Python. I set myself the task of coding the 'Mastermind' game and got into great problems where the random generated number contained duplicated digits. I recently decided to get back to it as I have volunteered to introduce the older