View Single Post
Old 07-20-2014, 10:06 PM   #2
Groundhog
Coordinator
 
Join Date: Dec 2003
Location: Sydney, Australia
The Basics

The first resource I picked up was 'Learn Python in 24 Hours'. I made it through the basics - variables, variable types, performing calculations, if/elif/else statements - with ease. I remembered enough from my brief VB6 attempts to make these early chapters more of a lesson in Python-specific syntax.

Lists/dictionaries/tuples were next and, while also quite basic, keeping my basketball sim in mind these represented the first real useful bits of knowledge re: how I envision my sim would work. Of course, every time I think that, I go on to discover a better way to do things, but that's the whole point of starting from the basics!

I had wondered about the whole issue of pulling in user/team/coach info and ratings and assigning them to variables that could be used in PbP/functions etc. It seems so basic, but until I'd seen dictionaries I didn't know how I might achieve that.

At this point, it seems to make sense to have a dictionary created for each team, with a unique ID for each player as the key, and then a list attached to that key holding the various ratings etc.

I have no idea at this stage how I would go about pulling in that information from a database or file and building the dictionaries automatically, but it's a start!
__________________
Politics, n. Strife of interests masquerading as a contest of principles.
--Ambrose Bierce
Groundhog is offline   Reply With Quote