View Single Post
Old 08-02-2014, 02:27 AM   #24
Groundhog
Coordinator
 
Join Date: Dec 2003
Location: Sydney, Australia
Some Progress...

Another productive day of (trying to) code! I revamped the intro to give the starting lineups. Simple, but had to write a quick function to translate the heights as they are stored into "English" - for example, 6'9 is stored as 69:

Code:
Welcome to Quicken Loans Arena where the Cleveland Cavaliers (25-11) are up against the visiting Charlotte Hornets (17-16). Starting Lineups: Cleveland Cavaliers: -------------------- C: A. Varejao, 6'11 PF: T. Thompson, 6'9 SF: L. James, 6'8 SG: A. Wiggins, 6'8 PG: K. Irving, 6'3 Charlotte Hornets: -------------------- C: A. Jefferson, 6'10 PF: N. Vonleh, 6'9 SF: L. Stephenson, 6'5 SG: G. Henderson, 6'5 PG: K. Walker, 6'1

Up next is the opening tip, which has changed only slightly from what I posted earlier in the thread - mainly due to the amount of times I've changed from lists to dictionaries for storing and passing around information:

Code:
A. Varejao and N. Vonleh are in the middle for the opening tip. The ball is up. N. Vonleh wins the tip, possession is with Charlotte.

This result now sets Charlotte as the attacking team and Cleveland on defense. I setup a variable, either 0 (home team) or 1 (away) that is relational and used by all functions and calculations to reference the right information for the team on offense and defense. It took me a few days to work out the best way to do this, and resulted (of course) in having to rewrite a bunch of lines, but I'm really happy with how it turned out.

Code:
K. Walker brings the ball up the court for Charlotte. K. Walker has the ball at the top of the arc, and signals the play. A. Jefferson moves up to set the high screen for K. Walker. K. Irving goes under the screen.

For these 4 statements there's a lot of calculations that took place behind the scenes. We checked who was defending Kemba Walker based on the strategy of the team - Cleveland are playing man defense, and Irving is assigned to guard the opposing PG. The screener and defender had a chance of committing a foul. We then checked the screen strategy for Walker, and it's set to go under the screens. We checked his defender (Kyrie) to see if he made the right decision based on that strategy. He did.

That's as far as I've got with the commentary, but the next few steps of the play are also finished.

A few more examples of what can be generated from what I've completed so far:

Code:
A. Varejao and N. Vonleh are in the middle for the opening tip. The ball is up. A. Varejao wins the tip, possession is with Cleveland. K. Irving brings the ball up the court for Cleveland. K. Irving has the ball at the top of the arc, and signals the play. A. Varejao moves up to set the high screen for K. Irving. A. Varejao wipes K. Walker out with a great pick! K. Irving reaches the right side elbow with some space.

Varejao had a quality screen here, which gets Kyrie open off the pick, which will affect the next step of the play, opening up the jumpshot or drive.
Code:
K. Irving brings the ball up the court for Cleveland. K. Irving has the ball at the top of the arc, and signals the play. A. Varejao moves up to set the high screen for K. Irving. A. Varejao is called for the illegal screen on K. Walker.

An offensive foul.

Code:
A. Varejao and N. Vonleh are in the middle for the opening tip. The ball is up. A. Varejao wins the tip, possession is with Cleveland. K. Irving brings the ball up the court for Cleveland. K. Irving has the ball at the top of the arc, and signals the play. A. Varejao moves up to set the high screen for K. Irving. K. Irving moves into the high pick, but K. Walker fights through the screen.

Similar to the quality screen above, this gives Kemba Walker an opportunity to disrupt the play and make a play on the ball in the next step of the play.
__________________
Politics, n. Strife of interests masquerading as a contest of principles.
--Ambrose Bierce

Last edited by Groundhog : 08-02-2014 at 02:29 AM.
Groundhog is offline   Reply With Quote