G'day,

With my only programming experience being C-64 Basic I'm finding that I struggle a bit understanding some of the concepts of Python, I wish I could block basic right out of my brain.

One of the things I can't get a grasp of is how to repeat a routine many times. For example a simple dice game where 6 dice are rolled, any that come up as 1 are kept, you keep rolling the dice until a 1 is not rolled.

A program to do that would need to generate a random number between 1 and 6 many times. In basic I would have made a sub routine for the random number. Only way I can think of to do it in python is to have a seperate script.

And at the end of the game I might want to play again and it would be nice to have something like - Play dice game again (y/n). I'm not sure how to run the program again other then re-loading it.

I know goto and gosub are evil, bad habits but I'm starting to miss them.

John

_________________________________________________________________
New year, new job – there's more than 100,00 jobs at SEEK http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau&_t=752315885&_r=Jan05_tagline&_m=EXT

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to