Search for tag: "object"

Zoom Dec. 3. Generators

In this presentation we will review, generators which lead into the last major topic of the course (coroutines). Once again, this will involve a lot of visualization.We also start off this…

From  Hannah Lee on December 3rd, 2020 2 plays

Lesson 29.4 The yield Statement

While generators are coroutines, the communication only goes one way: from the child to the calling parent. In this video we show how to reverse this communication, passing down information from the…

From  Hannah Lee on December 3rd, 2020 1 plays

Lesson 28.7 Iterator Chaining

Generators take iterators as input, but they also produce one as output. In this video we show how to chain iterators together, doing complex operations on our data.

From  Hannah Lee on December 3rd, 2020 4 plays

Lesson 28.6 map and filter

In this video we talk about two very famous generators: map and filter. We show how to use these to replace writing code with a for-loop.

From  Hannah Lee on December 3rd, 2020 6 plays

Lesson 28.5 Generator Design

Now that we know how generators work, it is time to write our own. In this video we show how easy it is. We just take out experience with the accumulator pattern and replace the accumulator with a…

From  Hannah Lee on December 3rd, 2020 6 plays

Lesson 28.3 The yield Statement

Making iterator classes is hard. In this video, we show an alternative, allowing us to write the iterator as a ‘function”. This requires the addition of a new python statement, the yield…

From  Hannah Lee on December 3rd, 2020 5 plays

Lesson 28.2 Iterable Classes

In this video, we show how to make our own iterable and iterator classes. These are actually tightly linked, and you need one to create the other.

From  Hannah Lee on December 3rd, 2020 6 plays

Lesson 28.1 Iterators

We are familiar with iterables, types that we can use in a for-loop. In this video we introduce the iterator. This is a type that can be used in a for-loop, but we can also manually step through the…

From  Hannah Lee on December 3rd, 2020 8 plays

Lesson 27.8 Application Design

Game applications (and graphical applications in general) can get pretty complicated. In this video we talk about how to break up your code to make it more readable and more manageable. In some…

From  Hannah Lee on November 30th, 2020 27 plays

Lesson 27.4 Application Input

The big difference between a game and a movie is the ability to respond to player input, be it from a mouse or a keyboard. In this video we show how to us the tools provided by the GameApp class to…

From  Hannah Lee on November 30th, 2020 27 plays

Lesson 27.3 The GameApp Class

In this video we introduce the GameApp class, which is a class written by your instructor. In the last assignment you will be creating a subclass of the class to run your game. This video highlights…

From  Hannah Lee on November 30th, 2020 34 plays

Lesson 27.2 Animation Frames

The while-loop that drives the game is hidden. This is going to create some interest challenges, particularly when you need variables that carry over from animation frame to animation frame. In this…

From  Hannah Lee on November 30th, 2020 33 plays

Zoom Nov. 12. Dynamic Typing

Our last presentation on classes reviews the issue of typing, and why this has become much trickier with the introduction of subclasses. This is the last material covered in the second exam.The…

From  Hannah Lee on November 12th, 2020 14 plays

Zoom Nov. 10. Operators and Abstraction

in this presentation we review the Python data model, showing off the various operators we can define in Python. This is an area where Python is much more advanced than older object-oriented…

From  Hannah Lee on November 12th, 2020 3 plays

Lesson 25.6 Complex Custom Error Types

When we were recording the video on custom error types, it ran quite long. So we decided to break it up into a second video. In this video we look at a slightly more complicated error type. We also…

From  Hannah Lee on November 12th, 2020 35 plays

Lesson 25.5 Custom Error Types

Now that we can raise an error of any type, it is time to make our own error types. In this video we show that this is incredibly simple, and needs almost no code.

From  Hannah Lee on November 12th, 2020 35 plays