background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "Практика программирования на Python 3, лекция №9"

input logo icon
Video tags
|

Video tags

мфти
фопф
информатика
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:02
please sit down, we are in the 9th lecture and but
00:00:11
again, it’s more like a master class format,
00:00:13
I don’t want to tell you a lot as much
00:00:15
as I want to show you,
00:00:18
but there will be a little more stories last
00:00:23
time last time procos told them about the
00:00:28
last time I told you about the course
00:00:31
and I don’t remember the students, I remember exactly
00:00:35
that they factored, we did
00:00:39
object-oriented, just last
00:00:41
time the ball was remade, they stuffed the
00:00:44
bolt class, they did it, I remember exactly, but
00:00:51
the value of
00:00:52
object-oriented
00:00:53
programming is not only that it
00:00:56
allows all the complexity of the work of the
00:00:59
Daud object to be shoved under some kind of cover and under a
00:01:01
certain hood and thereby factoring to
00:01:06
separate this complexity into a separate
00:01:08
entity one of the most important tasks in
00:01:13
organizing the work of a programmer in
00:01:16
organizing program code
00:01:18
is precisely to scatter all the complexity
00:01:22
into some separate
00:01:23
components so that the big one is more or less a
00:01:26
large project could be supported,
00:01:29
read and understood, in short, the value of the
00:01:36
a.p. not only that it allows you to
00:01:39
push data and code into a class to
00:01:43
encapsulate the data along with the code
00:01:45
that serves this data, but also
00:01:48
that
00:01:51
object-oriented
00:01:52
programming perfectly turns
00:01:54
into object-oriented
00:01:55
design as a tool for actually
00:01:59
inventing and, in principle, for the last time
00:02:02
when I began to describe the
00:02:05
attributes and methods of the ball class to the corner,
00:02:09
you already saw that I deliberately did not do it
00:02:12
right away on the computer, but I took it and
00:02:14
drew it until I drew a
00:02:16
rectangle like this in which I wrote,
00:02:19
I have a class ball, here it is there are
00:02:22
some properties
00:02:24
before attributes, here it has some
00:02:29
methods, I won’t even try to
00:02:31
repeat myself now until there’s no need now it’s that
00:02:38
besides this, there are
00:02:42
relationships between classes in
00:02:48
last week in the past worked at
00:02:51
work you already have elements of opium,
00:02:53
in fact, there was a gun that
00:02:56
needed to be rewritten so that it would
00:03:00
work, it would work with this
00:03:03
gun, you will work two more
00:03:08
paws,
00:03:09
that is, this is a week and another
00:03:12
week for those who have Monday off and
00:03:14
I say in any case, do this, you
00:03:17
need will expand adding
00:03:21
functionality gradually, we are now
00:03:24
reaching the level where you
00:03:27
yourself must begin to propose
00:03:29
and change the project your side, you want
00:03:32
something
00:03:33
because what remains is essentially laboratory
00:03:36
work, a cannon and there is such artillery, it’s allotted for a
00:03:40
single week, maybe
00:03:42
even mother will take a bite so that the artillery
00:03:44
dacha and more, it is essentially such a
00:03:46
modernized cannon,
00:03:49
and then your
00:03:52
semester project begins, which you
00:03:54
yourself must conduct like this, but still,
00:03:58
apparently we will start group work in a
00:04:01
week because now
00:04:04
you still need to do it yourself my project
00:04:07
to cook and I won’t say anything today
00:04:10
about the organizational
00:04:12
component,
00:04:13
so the trick is that it turns out that
00:04:15
these are the drawings that I draw of
00:04:17
water and people, I am for communication, but now
00:04:22
communication should be both vertical and so there are
00:04:26
different classes and just
00:04:31
imagine that I’ll take these 2nd grade
00:04:33
several classes and draw them side by side
00:04:35
just on a piece of paper or on the board,
00:04:37
and for example I’ll take and do what
00:04:40
this very eve
00:04:42
Ogan gun was called, it’s called the banking one, it
00:04:45
will be gun, to me the difference is let it be gun,
00:04:50
well, here’s an object, or rather an object class
00:04:54
first turn, yes, the class of guns gave me
00:04:57
one copy of this gun, at
00:05:01
least in the current version, yes, but you
00:05:03
understand, remember which ball this time and
00:05:05
multiplied as soon as it was wrapped
00:05:08
in the class, I created many copies
00:05:10
at all, did not present it to any service, and
00:05:12
I already have a list on created and they all fly,
00:05:16
in principle, with guns, the same thing
00:05:18
will happen, and so I will also write down
00:05:22
some properties and their methods will
00:05:26
not be so few, let’s now
00:05:28
even discuss another thing and is there
00:05:31
any kind of relationship between
00:05:33
them here is the simplest relationship
00:05:39
that can exist is called an
00:05:41
association, an association it draws, it’s just
00:05:45
that a stick connected everything, so you
00:05:47
drew an association, but the most
00:05:49
primitive features we design,
00:05:51
imagine yes, this is a completely living
00:05:53
situation,
00:05:54
choco does not have 2 classes, but he has these classes,
00:05:57
that is, he distinguishes entities from
00:05:58
subject area, etc., and in general,
00:06:00
what kind of business
00:06:01
logic will we have, and he begins
00:06:03
to do object-oriented analysis,
00:06:04
and so this is an object, this is an object, this is an
00:06:06
object, so what is it connected with, and
00:06:10
there is such a thing as an association,
00:06:14
respectively, I have a cannon and a
00:06:18
ball before the target I will have a ball
00:06:22
as a target, it should be somehow,
00:06:24
although no wait, the target is still
00:06:29
unknown what will be the target, yes, in
00:06:31
principle, I can draw a 3rd grade here,
00:06:34
yes, because, well, probably a cannon, it
00:06:36
shoots before a cannon, a
00:06:38
projectile and a target, must be created yes, I’ll call it here as
00:06:42
target target, I honestly don’t know what it
00:06:46
will be like now, I need to look at the
00:06:48
project since it’s better to organize it,
00:06:51
but I see it so far until gumball
00:06:55
target, well, really, it would be more likely to
00:06:59
call ball something, not a bunch of
00:07:02
ball ball, but something like a
00:07:04
projectile, how can you call it a projectile, gone,
00:07:08
for example, yes, probably, but you can call it at
00:07:12
least no, what can you call a
00:07:14
projectile, I’m in the corner, I don’t immediately have the
00:07:21
usual thoughts in my head, but what grannies will add, you can
00:07:26
call it, yes, really,
00:07:30
well, for example, good, but I’ll leave the bolt for now
00:07:33
In short, here’s the thing: my gun, the
00:07:38
mixing doesn’t interact directly,
00:07:40
to be honest, there’s still no direct
00:07:44
association,
00:07:45
imagine a gun pulling the
00:07:48
star method of Gita or a target pulling some
00:07:51
method from Pushkin, it’s strange before these targets
00:07:54
of there are a lot of I can’t imagine somewhere there
00:07:56
are displayed on the map yes there is a possibility of them showing there
00:07:58
maybe they have, well let’s say
00:08:01
they have a show method
00:08:02
let’s say they have a move method for
00:08:05
these trades to move yes they
00:08:07
will be flying there for example conditionally what will
00:08:10
happen to them there will be injections there
00:08:13
naturally By the way,
00:08:15
our method of some kind must have disappeared, it was going to be
00:08:17
displayed, yes, and even then, if now I don’t
00:08:19
divide it into displaying the physics of
00:08:22
the model to the model of the
00:08:24
actual behavior, there should also be
00:08:26
movement accordingly, but once again
00:08:30
the trick is that I have an association,
00:08:33
here it is yes, in fact, before the cannon
00:08:39
fires, the projectile hurts,
00:08:44
and, accordingly, this one hurts,
00:08:47
but I still left wisely, I called it
00:08:48
before, I don’t know what it is here, it’s
00:08:51
called something here or not,
00:08:55
the target is not called ball here in this
00:08:58
version I don’t like the way the
00:09:00
project is being done here now, we’ll
00:09:01
correct it now, in short, I won’t
00:09:04
correct the name right now, although I don’t
00:09:06
like it, in fact, the sooner you
00:09:08
correct the name to adequately, the
00:09:10
better, because then it will
00:09:12
appear many times in the project, it will be
00:09:14
more difficult fix it, pull it out and
00:09:17
rename it, in short, I have an
00:09:22
indirect association like this,
00:09:23
the question arises: is there
00:09:27
a direction of the association?
00:09:29
Well, in short, here I have a target,
00:09:33
these same points are flying to me, balls are
00:09:37
flying from a cannon,
00:09:39
and these balls are they have to check whether they
00:09:44
hit the target and or you have to bid
00:09:47
closely for real I have a
00:09:48
list of
00:09:50
flying projectiles there is a list of targets
00:09:53
I have to go over the target has to
00:09:57
go through the list of projectiles and
00:09:59
say the asset hit it hollow like or the
00:10:02
projectiles should pull the target method and
00:10:05
held there check k-lite for example yes yes
00:10:09
who whom there is such a thing as
00:10:14
the direction of association, that is, we have
00:10:17
a gun, it is obvious that it essentially
00:10:20
generates it was on the floor exactly
00:10:23
generates well, as the object appears, we are
00:10:25
unlikely to store this bolt in the
00:10:28
stash guns there are already created
00:10:30
objects lying around somewhere strange, but
00:10:32
rather we will generate this object at the
00:10:34
moment of the shot, it is logical and
00:10:35
corresponded to what it generates
00:10:39
and, moreover, that is, I can
00:10:43
draw an arrow like this to
00:10:45
which will display
00:10:47
the direction of this association at the same
00:10:50
time the gender does not belong to the gun itself, it
00:10:54
is not its fight, how to say it is a
00:10:56
representative of a special case,
00:10:59
it is not just, well, the class between
00:11:03
which there is an association, it is more difficult to
00:11:09
choose this direction,
00:11:13
this situation may even happen, I am very sorry
00:11:16
that I did not draw it very well,
00:11:18
to the point of redrawing it for
00:11:20
greater clarity,
00:11:22
although I feel sorry for the time, I want to say
00:11:30
that my focus can be
00:11:32
realized in such a way
00:11:34
that I, accordingly, seem to be
00:11:37
amazed, that is, they destroy and
00:11:41
hit,
00:11:46
and accordingly, with such a project, I
00:11:49
project these are my thoughts for now about these
00:11:52
objects and with this approach me that from
00:11:55
some method
00:11:57
there is a polo movement or there I don’t know the
00:12:00
target check there is something else there yes I
00:12:03
will have to go through these trades you try to
00:12:05
check there I get in I don’t get in I understand
00:12:09
option 2
00:12:11
why not you can take it and accordingly they
00:12:14
all get in as if yes but in the sense that they are
00:12:16
amazed, yes they can be vulnerable, until they are amazed, they are
00:12:20
defeated and that they are
00:12:24
amazed, although it’s not really about that they are
00:12:26
amazed envy, make an association like this, that
00:12:29
is, they will go over whether there is
00:12:31
some kind of projectile that
00:12:34
just hit me like a soap
00:12:37
ball, that’s it ready to burst at an hour,
00:12:40
you can program it this way, and why not,
00:12:44
you can program it this way, although it would probably be
00:12:46
more logical to go there,
00:12:49
but what’s interesting is that the third
00:12:53
situation is possible, first of all, according to the principle of keep it
00:12:56
simple stupid,
00:12:59
you can not do it at all, leave a piece
00:13:06
in a purely structural paradigm, then do it
00:13:10
function of the game
00:13:12
function of the game which will be responsible for
00:13:15
checking whether the ball hits the target,
00:13:19
you can do this, you can, I’m telling
00:13:22
you again, it’s very inconvenient, I really want to erase a piece right now,
00:13:25
at least so that I can
00:13:26
free up a little space, I now
00:13:28
need it next to this line, I
00:13:32
drew it unsuccessfully in any case, the properties there, the
00:13:37
methods, in short, don’t even matter, what’s important is that
00:13:41
this association can
00:13:44
be undirected if the relationship
00:13:47
between classes is put into a separate
00:13:49
function that deals with their association, it
00:13:54
pulls from this coordinates, it
00:13:57
pulls from this
00:13:59
one atom, it takes them there, check but what’s the
00:14:02
downside is that the whole complexity of their
00:14:07
relationships with each other will be
00:14:11
hidden inside this function,
00:14:13
that is, to receive and we wanted when we
00:14:16
created the class in general and talked about
00:14:19
responsibility, our class is responsible for and the
00:14:22
question is, who should be responsible for
00:14:27
this rather complicated perhaps the
00:14:29
task of checking for a hit and, well, the
00:14:32
actual call for destruction, where
00:14:35
should this complexity be hidden, who
00:14:37
encapsulates this responsibility in themselves,
00:14:40
you understand a very interesting question, why is
00:14:45
it especially complex, yes, because I
00:14:49
can have many different options
00:14:52
for projectiles, that is, I am drawing class 1 bull, but
00:14:56
in fact, I can
00:14:58
have many of these classes and a gun can generate no
00:15:01
single variant of projectile, but many variants of
00:15:03
projectiles, and there
00:15:08
can be quite a lot of different targets, so
00:15:11
let’s say this thing and say how
00:15:14
this whole association of them can be
00:15:18
made in a separate association class there
00:15:23
may well be one that will
00:15:27
deal specifically with relationships,
00:15:30
that is, it will receive a specific
00:15:32
instance of the ball and a specific target in
00:15:34
order to check if they
00:15:37
match, so that accordingly the target can be
00:15:40
taken away as much the halls and how much it has,
00:15:43
so check whether it has his shields
00:15:45
against this type of score, do
00:15:48
they have the same color on the green ball, does it
00:15:51
only hit green targets,
00:15:52
is it something else, how are you, this is the complexity of
00:15:54
relationships, it can be hidden
00:15:56
inside this I don’t know stake and joker
00:16:01
conditionally and again
00:16:05
you can find some arguments for
00:16:07
some people are against this decision, yes, that
00:16:10
is, conventionally, I will call him before k-lite
00:16:13
checker, but nevertheless, yes, you can
00:16:18
come up with limiting his responsibility to
00:16:20
some task so that he is responsible for a
00:16:23
specific thing and it corresponds so
00:16:25
that it does not work out so what are he something
00:16:27
internal things go too deep into
00:16:30
it, too deep into it, the nose itself goes in there, the
00:16:34
fact that we can, without writing a single
00:16:36
line in a programming language,
00:16:39
discuss architectural issues like this on a piece of paper, this is
00:16:42
already very
00:16:44
cool, it’s true, and it’s possible if you have
00:16:49
some
00:16:50
programming experience, then you can how to
00:16:53
imagine yourself what consequences this
00:16:56
will have
00:16:58
one more thing I’ll also draw now I’ll
00:17:01
erase the properties and methods
00:17:02
here it’s just clean here it’s cool
00:17:05
I’m writing everything to myself yes
00:17:08
we’re all without a rectangle and here’s a certain association I
00:17:10
’ll remove the k-lite checker now because I wo
00:17:14
n’t actually implement it now,
00:17:16
I will have all the complexity hidden
00:17:18
inside the ball, and the direction of this
00:17:20
association will be there, that is, it
00:17:22
will hit in the sense of hitting,
00:17:28
so I said that there are many
00:17:33
different options for projectiles, but how can I
00:17:36
actually display this, that is to do
00:17:39
what a cannon is supposed to shoot a projectile in
00:17:42
any case means there must be a wildly
00:17:44
basic association but it generates
00:17:47
of course I can appear with combinatorial
00:17:52
complexity yes I will draw here y besides
00:17:54
the bolt there are several boxes of
00:17:57
vegetables throwing boxes very much you
00:18:02
now here we will draw a rocket laser yes y
00:18:05
accordingly, one or two and something else will appear for me, and
00:18:08
again there 1 and 2,
00:18:12
my picture will become sharply more complicated and
00:18:14
the number of lines by which this is all
00:18:16
generated, but the cold will multiply,
00:18:19
but I can make the next one among all all all
00:18:21
all projectiles
00:18:23
among all all all all all all all projectiles
00:18:26
I I can take it and, well, isolate it globally,
00:18:31
but it’s global,
00:18:34
maybe it wasn’t a projectile at all, but I’ll still call it
00:18:38
shell and I have these variants of [ __ ], there
00:18:45
can be many different classes of projectiles,
00:18:50
balls, boxes, missiles, lasers, and so I
00:18:55
go and say, here I have there is a bolt, yes, but
00:18:58
there is some kind,
00:19:04
let's say a laser every day, let's say the launch laser will be a
00:19:07
laser gun, in the sense of dragging this is the laser
00:19:09
ray
00:19:11
laser ray, well, somehow they are not glued, it is not
00:19:18
clear that they are a special case
00:19:21
of a projectile and this matter is reflected as
00:19:25
follows, I say these guys, yes, they
00:19:29
are a special case of him
00:19:36
and I’m drawing, I’m just now drawing
00:19:40
this direction of the arrow, but in
00:19:42
my opinion I’m drawing correctly, and in
00:19:44
my opinion I’m not painting it over, it’s just
00:19:47
drawn like this, I’m not sure, to be
00:19:50
honest but the trick is that these and
00:19:54
this relationship is not an association,
00:19:57
this is another relationship, this is just such
00:20:01
a situation that this is a special case of shells, a
00:20:04
specific implementation of this conditionally
00:20:07
abstract one, it has reached well, some kind of
00:20:10
ammunition, it’s clear, it’s unclear, the implementation
00:20:17
is like an abstract class, but they are a class then
00:20:21
yes, I can make objects of
00:20:23
type bool, many different ones, up to objects of type
00:20:26
lazer, kinder, I can also do a lot of them and the
00:20:29
spool of those here and
00:20:31
there, these objects will live for me, fly,
00:20:34
move, but they will be special
00:20:38
cases of this show, it can be
00:20:43
formulated as follows: that
00:20:45
I have a parent class and child
00:20:50
classes, I have a
00:20:53
hierarchy of classes, hierarchy, moreover,
00:20:59
my child classes can inherit the
00:21:04
properties and methods of the parent class and
00:21:08
this is also very cool because then
00:21:11
if there is inheritance, that is, just
00:21:14
like the program code that was written for the
00:21:16
sheila, it will be both here and there then
00:21:19
it turns out that it’s really cool for me, I don’t
00:21:27
have to rewrite this program
00:21:29
code, it’s clear that inheritance is very cool,
00:21:32
this includes the mechanism of
00:21:34
dry programming until the morning Peter
00:21:36
sat down,
00:21:37
but there is such a trick, it’s very important
00:21:41
to think through the abstraction correctly so that it doesn’t
00:21:44
arise that you have a target there but he
00:21:47
looks a bit like a gan there, let me make
00:21:49
a target, this is the most special case, that’s not how it is
00:21:53
depicted this thing is like this, yes, often
00:21:55
in the case of a gan,
00:21:59
you understand, there
00:22:01
is a principle in this madness, I won’t go
00:22:06
deeper into this matter now, the setting
00:22:08
criterion for barbar risks on
00:22:11
but the point is that there should be a
00:22:14
correct abstraction, yes, that is, these are
00:22:17
special cases of
00:22:21
this class and
00:22:24
they should not require anything
00:22:27
additional based on what
00:22:31
their parent class required. Now
00:22:34
let’s say again, let’s not go too
00:22:35
deep into the details, so I
00:22:38
drew a little before
00:22:39
it became clear what a hierarchy is, yes, I
00:22:42
said the words inherited by the way, it may
00:22:45
well be 5 heir of us heir of the
00:22:48
heir of the child may be a
00:22:49
daughter, there may be some kind of
00:22:51
gravity there, it may well be that the bolt is
00:22:55
not necessarily a gravity [ __ ] you will die to the
00:22:58
bolts a modified movement was given
00:23:00
in a different way I was able to move, a special
00:23:05
case of a ball, because everything else is
00:23:06
done in the same way as a ball
00:23:08
bounces off conditionally, a loser doesn’t
00:23:11
bounce off, flies away like we did
00:23:18
last time, we didn’t touch this didcot, this is
00:23:21
the code that you all had, so
00:23:25
I’m now lagging behind you. this is an
00:23:28
unfinished gun, well, first of all, I told you
00:23:32
that there is such a guy here,
00:23:34
so you can ask him to take it here,
00:23:36
say while listening, turn half a turn, he
00:23:38
only monitors the syntax, he didn’t do
00:23:41
any inspections of the knife, the inspector
00:23:43
came to us only errors in this
00:23:46
situation, he will only show there are some
00:23:48
errors there, I don’t see
00:23:52
anything, they don’t show errors, in
00:23:54
fact there are, well, in short, I turned it around, I
00:23:57
really love it when
00:23:58
the interpreter in this case is not
00:24:00
just an interpreter development environment,
00:24:02
it does a detailed inspection, it helps you
00:24:06
see many things that will inevitably lead to
00:24:09
errors in fact, but there is
00:24:12
red, moreover, here on the right on
00:24:16
this
00:24:17
scale, I can actually see the
00:24:20
paint and right here, right here, seriously, in
00:24:24
regions, also explain what’s wrong to Rome
00:24:27
Frida on
00:24:28
parenthesis, remove unnecessary brackets,
00:24:32
okay, let’s start with these same
00:24:37
mistakes, I don’t like the way the
00:24:42
class is named here for dad 8 should
00:24:44
start with a capital letter.
00:24:52
takumi mode past
00:24:59
further class gun
00:25:05
means further further further class target
00:25:16
oh now just a second
00:25:21
close to get
00:25:23
so now it’s not yet but he tells
00:25:26
me that
00:25:27
why are there empty parentheses here there’s
00:25:29
really no need what else is wrong here are the
00:25:32
red errors they require of course
00:25:34
primary then there is how I can’t do this
00:25:36
actually in the committee,
00:25:37
well, here’s a simple thing I have here for now, the
00:25:40
stub function is still there, I even have a
00:25:42
re-therm fall of the
00:25:43
wrong men, so now I
00:25:45
quickly corrected it, so we look at the
00:25:49
ball, everything is more or less yes, it’s red
00:25:52
such errors are not visible, well, what is there in
00:25:56
green, he underlines the arts grid
00:25:58
nuka nuka nuka nuka hit counting test
00:26:01
underline until throw a gun
00:26:04
underline in red what's the matter here because
00:26:08
new attributes are created in the
00:26:10
Asia constructor here I create them at the level of the entire
00:26:12
class well like like in this m2 power of
00:26:15
what is by the way in 2 power interesting this is
00:26:18
not help but
00:26:25
what what am I doing right now.
00:26:30
I just can’t get used to the fact that my
00:26:33
bypass mode is here so well, and actually there you
00:26:42
also need to create a line to the one
00:26:45
that will display the gun
00:26:48
so wonderful conf so teal so can
00:27:02
fix me don’t you hold us this yes there are of
00:27:06
course not so few of us here apparently before the luck
00:27:09
start why the luck of releasing the
00:27:16
mouse button ball
00:27:18
new God yes now we’ll fix it again
00:27:21
for now and now I’ll fix the red errors
00:27:24
so that this thing will basically start then
00:27:26
we’ll clean up the functionality of the target well
00:27:29
as you can see here already yes in
00:27:32
order to write such code you also have to
00:27:34
code there’s a lot to write and
00:27:36
you can start to get confused in it if you don’t
00:27:39
structure it, but nevertheless it’s
00:27:40
structured well and what’s also quite
00:27:43
valuable is that you can collapse it, it also
00:27:46
allows you to hide the complexity, you do
00:27:48
n’t look at it
00:27:49
for the time being, then you don’t need to delve into this matter
00:27:51
or leave it alone that is, here is
00:27:54
the method once and you hid all the contents of the method,
00:27:57
they are also very convenient, okay, I wanted, I
00:28:01
wanted what to do with a constructor and I don’t have the strength,
00:28:09
yes, here and there, six of these lines need to be
00:28:13
shifted to the right to the villages in points sal liv
00:28:20
is equal to 1 so don' t work out of an object
00:28:24
is created in ukraine oval new sales
00:28:30
points above
00:28:32
this apparently there will be points written like this
00:28:35
initialization of the new target all on screw y
00:28:47
red we also look at what errors it still
00:28:50
sees so t1 equals target means we have
00:28:54
here here dev new green yes that is,
00:28:57
there is a function here that creates a
00:29:00
new game and this function is new game, it is
00:29:03
hung on the timer root author 750
00:29:07
new game that is, it is spinning, but again,
00:29:10
most likely not the south, and I should probably
00:29:11
name it, but if it is a spinning
00:29:15
function, it should probably be called let
00:29:18
's warm it up like this somehow now let's
00:29:24
look again at global gant t1 who are
00:29:28
you one target screen 1 aa hair for a long time I have
00:29:38
n't seen this code actually a year without seeing the
00:29:42
objects of the bottom boiler let's still
00:29:44
correct major errors so
00:29:54
here we are stupid for this it’s clear rutman onion
00:30:01
so new game and went to mail.ru
00:30:04
and where is the initialization and the initialization is
00:30:08
somewhere here so well, I don’t like that
00:30:13
I don’t have goals here there is a piece
00:30:17
that creates something and there is
00:30:20
a piece that is also something creates I
00:30:24
would really like to have one place
00:30:26
where everything is created, at least yes, so
00:30:29
I’ll make a function that will be
00:30:31
called like for example, in reality
00:30:38
it will most likely
00:30:39
not be, but nevertheless
00:30:43
global I will need globally who is the
00:30:45
root widget because I’m on I’ll
00:30:48
create it and there will be one canvas for the
00:30:52
entire module,
00:30:53
so I’ll have a global
00:30:55
variable so, well, and accordingly these are
00:30:57
the shuffles and work, what happened there, I
00:31:14
wonder what’s wrong
00:31:19
and
00:31:27
stopped responding to me, I don’t understand
00:31:31
what’s wrong and not on my keyboard once again
00:31:36
and stop watch a bunch maybe the keyboard
00:31:38
popped out stupidly no the keyboard something
00:31:45
flew off so okay I'm
00:31:55
sorry there's a meme or
00:31:57
emulation it's given so
00:32:15
honestly what's wrong I pressed the
00:32:20
mouse wrong the keyboard is reacting the keyboard is dead
00:32:22
and it seems to be on the plane apparently there's still
00:32:25
something there Once again, let's put you down, you're not a fornicator,
00:33:05
some kind of mode, apparently I can't
00:33:08
do anything at all, everything is normal, everything is like that, five
00:33:17
lines to the right, everything is okay, so why do
00:33:27
I have a root frame, why am
00:33:30
I interested in a frame, but I wanted the visible buttons
00:33:32
there in this example, a teacher with a frame
00:33:34
to put it this way the canvas is called Congo so
00:33:38
he’s also comfortable here he’s not
00:33:40
happy that I don’t have an empty line
00:33:42
additional so well look at
00:33:50
the blots we look at the blots that he doesn’t
00:33:58
instance it likes x define out site and
00:34:01
no so look look how
00:34:04
really I have neither at Target should
00:34:08
happen in a good way, but obviously not here,
00:34:12
well, that is, the X-axis of the game
00:34:14
should not be created for me, in theory, here they
00:34:17
can change dates engineers Target
00:34:20
itself here is the model I don’t really
00:34:22
like this orbit that how it
00:34:25
is generated new actually sells in fact,
00:34:31
I don’t have it and now I’m taking into account the code that I
00:34:34
wrote, it’s not about it won’t solve I wrote, but in
00:34:37
my opinion I wrote this code, after all, two
00:34:40
years ago, it seems I wrote it, but a year
00:34:42
ago I looked again, in general, this is the
00:34:45
situation with some outdated code
00:34:48
that still doesn’t work, it’s
00:34:51
actually quite typical and instead of
00:34:53
designing from scratch and writing, I’m
00:34:55
poking around in it. Another big question is what’s
00:34:57
faster, but honestly, my experience tells me
00:34:59
that it won’t be fast for a writer either,
00:35:02
so it’s better and I’ll dig deeper,
00:35:05
especially since it doesn’t cause disgust in it bright
00:35:07
until obviously and special flaws are
00:35:10
sketched and on a special obvious yes the
00:35:12
first class has a constructor 2 3 no
00:35:15
guess why yes so that you can
00:35:18
look at the 1st class and do it like that in the
00:35:21
second or third the same as in the first in the
00:35:24
first there is a line document in the second in the
00:35:26
third there are them at the dacha in the second what else
00:35:29
is there and in the third they are not at all well ok
00:35:32
almost not at all so in short hitting
00:35:39
the balls the target oh so they gathered conf
00:35:48
cowards
00:35:49
targeting your target does not depend on
00:35:52
the position mouse, this is our corner
00:35:54
on the idea of ​​​​working creed line
00:36:04
I don’t see any obvious errors, I’ll try
00:36:12
to run some as is, yes, I understand
00:36:15
that it’s unlikely that you got it to work, let’s
00:36:18
run it, let’s run the circuit shift of 10 then
00:36:26
throwing is not be fine, well, show me why do
00:36:31
I have a piece there that is still
00:36:34
taken out separately, yes, well, let’s go five
00:36:37
lines from here, they gave them in the afternoon, we’ll drag them to
00:36:41
where we have, by the way, I don’t call the cops,
00:36:44
so yes, let’s call so
00:36:52
main here on we insert
00:36:57
these five lines here
00:37:01
and you need to call it, that is, I
00:37:04
’ll call it naturally before
00:37:07
making a call new game main new game
00:37:16
Rutman onion, so again, I do
00:37:19
n’t like new game, what should I do? You don’t
00:37:22
like some kind of identifier in the
00:37:25
charme share, there is the possibility of global
00:37:27
replacements but at the same time, the intelligent one will find
00:37:29
such a replacement for which it will find this particular
00:37:34
identifier, that is, nowhere there in the
00:37:37
namespace of another but also
00:37:39
called exactly where the extended to it
00:37:42
syntactically analyzes
00:37:44
where this function is called from and
00:37:47
so I can now take by the way I can
00:37:50
kontrol
00:37:51
if I’m not mistaken not kontrol b how can I
00:37:55
jump to the definition of gou that declaration
00:38:01
from the womb
00:38:04
after I had to jump again I’ll
00:38:08
try again,
00:38:09
well, counter that contour shift b she
00:38:13
go out to interrogate my Zimov mode
00:38:16
kontrol b come on, come on, he doesn’t want to
00:38:25
poison to the definition okay with the mouse I'll remove the
00:38:29
Shumovsky mode next time for newspapers
00:38:32
goal the declaration of users
00:38:36
I ended up where I get to the declaration, that
00:38:39
is, to the place where this function is described
00:38:41
new game there are a couple of extra lines that
00:38:45
can be deleted painlessly so yes there is
00:38:53
such a text editor you've already seen it
00:38:55
called wine but the UN it's specific
00:39:01
to Linux, it's a very old text
00:39:04
editor, but it works like a complete
00:39:07
meal and, in fact, many many
00:39:10
things can be done in it, but I
00:39:13
personally really like it,
00:39:15
last time I worked in Rome, conclusion,
00:39:18
we saw this thing last time, but system administrators
00:39:25
love him, some programmers,
00:39:27
so I got hooked on him a long time ago
00:39:29
and I don’t really like him, but in the Punch
00:39:33
Army there’s even one in charme
00:39:35
when you install a patch within the framework of te
00:39:37
desnude, he just suggested it to me
00:39:39
when I installed it a new time, he suggested
00:39:41
a if you want vim mode I want it, well, I have an appetite
00:39:46
for some combinations, but they stop
00:39:48
earning money until they live to jump to the
00:39:50
original one, it’s inconvenient for
00:39:53
sure there is another one, too,
00:39:56
probably Tito’s dimmers have already been done so that
00:39:58
they, too, all work with the standard
00:40:02
configuration, too, these are for the keyboard
00:40:04
combinations
00:40:07
dad, so that’s the same targeting g1
00:40:13
power-up it’s generally not clear that it’s normal
00:40:17
to call variables like that, but it turns out that it’s
00:40:24
Tagan 1 ha Nazin, it turns out,
00:40:29
well, wait, I’m going to go through
00:40:31
all the texts now, rename them, tell me,
00:40:36
it’s clear, nothing is clear, it’s
00:40:39
not true, I’m real, I’m not looking at it right now -
00:40:41
it’s clear in fact, but what
00:40:46
should I do when I don’t like something
00:40:48
there is such an opportunity to take it and
00:40:51
rename it actively by the way it’s created
00:40:53
below where it’s created I don’t see in May it’s not
00:40:58
created one yes so no we’re a little
00:41:06
also 1 equals gun so first of all with
00:41:10
big letter gun so secondly,
00:41:13
yes, naturally, since that’s the case, my gun
00:41:17
should be global, yes, but once
00:41:21
again, I have some kind of
00:41:23
module-level variable, I really don’t like it, I do
00:41:26
n’t even like it, to be honest, yes, I’d
00:41:29
rather let it be canvas like be here in
00:41:33
the charme there is a possibility
00:41:35
of intelligent renaming here there
00:41:37
is there such a 3rd factor right-
00:41:41
clicked on the identifier reflector ren
00:41:44
him and please do so on the sound on you
00:41:50
and he ran through the entire project
00:41:55
wherever canvas he found and replaced
00:41:57
if where - in the comment I came across the
00:41:59
words ends, he didn’t replace if
00:42:02
a variable that is not directly related to
00:42:05
this one, then he didn’t replace it, it’s
00:42:07
called a variable that
00:42:09
contains longer ones, discarding it didn’t
00:42:12
replace it, it’s a very neat
00:42:14
intellectual search with a replacement,
00:42:16
in fact, well, and accordingly,
00:42:19
this one here I also want to replace
00:42:23
ren and it turns out that it’s 1 hectare on 1 hectare in some
00:42:30
places there’s only one gun, I actually have only
00:42:34
one gun, I don’t know if it makes sense why
00:42:38
generate extra ones, let it be just gun,
00:42:43
maybe I want then I refactored
00:42:48
what is actually complicated there not to
00:42:51
be limited to just the fact of presence,
00:42:53
it will be necessary to have 2 guns, too, there will be no
00:42:56
control whether the next move is so
00:43:02
interesting where the numbers will then be needed
00:43:07
this canvas is done on this, but what if
00:43:12
it is not needed well now we’ll see
00:43:16
with everyone somewhere or not so
00:43:21
nothing MT-10 define
00:43:23
everything is clear t1 is equal to target it should
00:43:27
be a global gun target well,
00:43:32
actually let’s rename t1 and
00:43:39
the factor of lines with a small letter
00:43:45
accordingly target so me that
00:43:48
on us open
00:43:50
wow that is, it can’t find t1 which and
00:44:01
you’re the only one
00:44:12
I didn’t understand
00:44:31
even I don’t understand now let’s try again ren
00:44:37
im target it seems to have worked the
00:44:52
bidding is trampling the treasury and tribute to Aida the target was
00:45:00
not created by the ID
00:45:03
dag uncomment well create it
00:45:06
naturally not in zeros yes I need something to
00:45:08
pass into the constructor the actual
00:45:11
parameters before the
00:45:12
target is created where in a specific x and y
00:45:16
and yes and there shouldn’t be anything else, well, a certain
00:45:21
radius is obvious, let’s look at the
00:45:24
floor and the target, because it’s basically similar to me
00:45:29
x y a r that the calamus is always 10 different colors,
00:45:39
so the bow
00:45:56
didn’t reach right here,
00:46:00
no gaze, which one is where,
00:46:05
but by the way, the trick, yes, it turns out that We have a
00:46:13
method, but it’s not written there, well, apparently
00:46:17
this new target is called
00:46:19
to change these values ​​to new ones, but
00:46:25
you can probably look for this, I
00:46:28
can stand on the new target, press alt f7
00:46:31
and it shouldn’t highlight all the
00:46:34
staples, how is this curvature, please show me
00:46:39
alt and all fingers another
00:46:44
keyboard combination is pinching,
00:46:45
here it is the only place of use
00:46:51
we love, but there is only one on still
00:46:54
used there, here you are one Newt orbits
00:47:01
what is love is not clear and the root of the
00:47:09
new game that is, the new game is called
00:47:12
repeatedly and every time what happens is the
00:47:15
binding is garbage some kind of truth, well, who is
00:47:22
looping new guy fashion there is no button
00:47:28
accordion again why stick it repeatedly that is, the
00:47:32
new game function it clearly does strange things
00:47:35
why is it looped there
00:47:36
should be a function that ticks like this
00:47:39
in time kitty for example there is a
00:47:42
fund timer time handler well something like that so yes,
00:47:46
which one will hold the game loop for itself,
00:47:49
well, it’s clear that it
00:47:51
needs to be something there, consider it such a
00:47:53
grid, I don’t know what it won’t say about z local
00:47:58
believed z is not you at
00:48:00
all, I don’t know why we need this z so
00:48:04
at-1 what is it there was such a thing, there was a trade,
00:48:08
we could now rename it, let's have
00:48:15
an effect than the clock where now through and he doesn't
00:48:25
want to,
00:48:40
I'll try now,
00:48:46
in fact, I see that I'm still here in some
00:48:50
places forgot this matter to 151
00:48:54
country line,
00:48:55
so I'll make a replacement for 151 what other
00:48:59
line 162
00:49:05
yes I will make a replacement a.a.
00:49:10
no there's already tarver there it won't work
00:49:15
162 replace t1 with target and do it
00:49:23
globally in every line
00:49:26
so great
00:49:34
little power vemo we're stupid refuse oh
00:49:43
listen forgive me please I he
00:49:48
he didn't open Oleg 8 UAH l I managed to
00:49:53
get into this one in that one which I already
00:49:58
checked, now let’s get in and
00:50:04
see everything has already been fixed, the hardware has already been fixed for me, I apologize,
00:50:07
it’s my
00:50:09
carelessness, I didn’t notice that the file
00:50:12
has changed, the frame does
00:50:16
n’t seem to be needed on the crap screen 1k lord
00:50:29
what I like in cowards
00:50:31
typewriter says an error you have some kind of
00:50:34
spit these are little things, it
00:50:45
seems to me that yes, everything is more or less, but
00:50:48
it’s not like that, and it’s not in order that it’s new target
00:50:51
is called from there, so I’ll try to
00:50:55
remove it and write it here, here’s
00:51:00
the initialization of the new target great wall but it
00:51:07
corresponded, but I what’s the situation for
00:51:10
what and the text I I’ll do this whole thing
00:51:22
after I’ve visualized the creation of
00:51:26
visual objects after I’ve
00:51:27
chosen x y and the radius. By the way, pay
00:51:30
attention here I’m using a
00:51:32
tram assignment, you know why,
00:51:34
but in order to make it
00:51:39
easier to work with this x y here and for me to write
00:51:42
a virgin, that is, I’m doing synonymous with the name x y&r,
00:51:46
respectively, for not glad tardis,
00:51:50
what do I get in one place and there is no
00:51:53
rental sink
00:51:58
if x y parameters started trading should be
00:52:02
born where not in a random position,
00:52:08
let it be and once again I will now connect my
00:52:11
task so that the department, in principle,
00:52:12
starts working when it if we make money, we
00:52:15
will be able to move something further,
00:52:20
even if factoring doesn’t make sense to do it on a
00:52:23
working course, Katya sometimes, I’m now
00:52:26
in a sense doing or
00:52:28
factoring on a non-working one, this is
00:52:30
just such that it’s not possible
00:52:32
to work normally, but why am I forcibly
00:52:42
trying to start it, that’s what he says
00:52:45
the parameter is not data, but let me remove it,
00:52:47
let the target when creating a trade, then it
00:52:50
appears in a random place, it will be
00:52:53
quite logical, well, the contour shift and at
00:53:01
10 the target inject knows the guys trade,
00:53:06
let's see where it is called from here
00:53:09
it is called, remove control shift and at
00:53:18
10 then yes what do you even see, the gun
00:53:24
is growing and some kind of projectile appears, obviously
00:53:27
multi-colored, you see 1 233 something is, the
00:53:31
target is in stock, even
00:53:34
fused together, yes, the very thing they read at
00:53:39
work, yes, this is the direction of the
00:53:42
barrel itself towards the mouse as long as the mouse is
00:53:45
pointing somewhere in a reasonable place and there
00:53:48
is like this problem of division by zero,
00:53:50
but nevertheless it
00:53:53
works globally, then the projectile itself will interfere, it does
00:53:57
n’t fly anywhere well, the football was flying z there was no
00:54:03
need to delete it,
00:54:06
so we need to, I
00:54:10
have this one, we don’t know how to
00:54:13
restart it for some reason it
00:54:15
restarts obviously new game does not
00:54:16
belong to the cycle, but you can clearly
00:54:20
see this while target.
00:54:22
lego bows for being voice shield test
00:54:28
target give something is happening here clearly and
00:54:30
it must be a check of the relationship
00:54:33
must clearly be in time in
00:54:36
time dotsya time
00:54:38
handler here he is being torn out from the same time
00:54:42
handler and at this time finn or in this
00:54:49
function please me I’ll actually be
00:54:52
dealing with the fact that I’ll touch this very
00:54:55
form inbox boobs global variable
00:54:59
then the target should be global,
00:55:03
but where not replace
00:55:21
replace with time handler on foot I want to
00:55:24
restart and I specify it without
00:55:27
parentheses, that is, I pass it as a link to
00:55:30
this function so that they can call well and
00:55:34
750 this is strange the calculation should
00:55:38
happen more often oh 50 microseconds
00:55:48
milliseconds well now the muzzle has stopped
00:55:58
growing the muzzle has stopped growing
00:56:06
target shadow
00:56:14
gun power up and I have some kind of
00:56:18
heyner in general on the mouse
00:56:20
and I time the handler called him at all
00:56:25
didn’t call it time to call ours
00:56:31
so that it works at least once,
00:56:32
after which we can talk about something at all.
00:56:35
Now it’s actually growing in a
00:56:39
good way. Russia needs an event
00:56:42
from the mouse, that is, when it came from the mouse from the
00:56:44
other side and when the mouse has already been pressed for a
00:56:47
new event at this doesn’t happen, but
00:56:49
I need a time cut-off here, it
00:56:52
was actually somehow implemented, I
00:56:55
remembered the moment of clicking the mouse,
00:56:58
the moment of releasing the mouse, and accordingly,
00:57:01
you can now shift escape to minimize the
00:57:08
lower cat fire, but
00:57:17
finally I don’t remember listen, what a tough
00:57:25
f2 what is in 2 we cosine and sine of the angle
00:57:35
you were able to win them from it, but is it necessary to use this
00:57:46
horn,
00:57:50
you know, look,
00:57:53
let’s say it even seems to work, but I
00:57:58
don’t understand how it’s very difficult for me to
00:58:01
exploit the fact that I don’t know
00:58:04
how it works, but yes, but the point is that a
00:58:12
I don’t have a clearly defined task right now,
00:58:16
what exactly should I do, I’m
00:58:19
trying to fix something right now, frantically,
00:58:22
by the way, so
00:58:23
that it’s less frantic, this time
00:58:26
the program is launched, it
00:58:28
can, in principle, be launched, you can try to
00:58:32
fix specific things, that is, for
00:58:34
example, so that the ball flies now it
00:58:37
doesn’t flies, so what do I need to
00:58:40
find out how it’s still an error crashes there at the end and
00:58:46
run periodically a movie where obviously
00:58:49
I should have this tank for
00:58:52
which hangs on time
00:58:54
what
00:58:59
forbo
00:59:00
husband bane bulls listen again this kind of
00:59:04
[ __ ] is not good before the floor should be so
00:59:18
okay
00:59:19
furball inbox bulbule hit test old
00:59:23
pull the ball checks whether
00:59:26
it has collided brackets accepts the target and the
00:59:29
target itself is basically alive in this case life
00:59:33
and and we turn 0 and bidding hit you
00:59:41
why is there a binding
00:59:47
you destroyed the target oh there confit
00:59:58
[music]
01:00:05
when maybe the theme of war needs to be returned
01:00:08
here
01:00:21
now a good solution is not born,
01:00:31
let’s let them fly for what is
01:00:33
happening to you here here nested
01:00:36
loops are moving accordingly while there is
01:00:42
while there is and now he has a
01:00:45
ball to 1 to wave ator no and so he doesn’t
01:00:51
wash until salmov exists, he’s twitching,
01:00:56
which means apparently the whole problem is that
01:00:58
he had a husband, all sorts of [ __ ], well, of course, here it is,
01:01:02
it’s [ __ ] fix me describes
01:01:06
moving the sword in one frame redrawing
01:01:08
we can steal this thing became the ball to
01:01:10
which we actually did and what is
01:01:12
missing is missing apparently he you x and
01:01:15
you y see they are zero are set
01:01:18
well when the ball appears it should
01:01:21
appear in what place the layer needs to be
01:01:26
transferred actually some initial
01:01:28
you x and y for not lysing that’s if I
01:01:37
really want to give
01:01:38
it out in general, 4450 is actually quite
01:01:41
strange, some default values
01:01:45
where the trick is that it should
01:01:51
appear from the barrel of a gun,
01:01:55
let's buy an analyte now and
01:01:58
stick it in so that it appears at the
01:02:00
tip of the gun barrel,
01:02:01
but first of all, now even if I
01:02:04
register to him you have their traces here under the
01:02:07
default value 0 and
01:02:08
here go and this shouldn’t
01:02:12
really happen
01:02:23
what are they being issued from there I need to
01:02:28
transfer them from there I need to go where the
01:02:32
gun class is located
01:02:34
here from the gun class and in the gun class when
01:02:37
we fire a shot with a sword,
01:02:40
actually here, here’s a lucky break and I’ll be honest,
01:02:46
look, this is what f2 he
01:02:52
f2 he is such a flag he marks the
01:02:58
pressed button so that when the
01:03:01
button is pressed, he doesn’t know that it was pressing and
01:03:04
accumulating some variable there,
01:03:06
apparently
01:03:17
in short fair to and do he should that new
01:03:22
was you x nor was looking out let's see
01:03:24
what he's doing
01:03:25
sat down in . 2 of 2 power so multiply by the
01:03:31
cosine with l n and n this is probably
01:03:35
anvil obviously before n this is engl let’s
01:03:40
rename it and so I’m getting confused in
01:03:44
this so new you were their set they
01:04:01
but here’s what else is the trick look yes I
01:04:06
immediately them I’m registering
01:04:09
in general, I’m trying to change them from here because
01:04:13
they are not in order, they must be registered, these
01:04:16
same x and y must be registered
01:04:18
inside the class constructor, that is,
01:04:21
here, when I create a new ball,
01:04:24
I must already tell it that x xor y
01:04:30
and the radius in fact these too. r is also
01:04:33
written plus is equal to the general plus and it’s
01:04:38
strange again, so
01:04:45
now I’ll figure it out
01:04:56
in short, I’ll put it here underscores and
01:04:59
there will be a local variable which I’m
01:05:01
now creating a ball not Ebola,
01:05:06
here I’ll create it so I’ll give it to him
01:05:11
accordingly whom
01:05:13
xan and bitterly vyksa
01:05:17
you and bitterly drying let me I’ll call vyksa
01:05:23
y here locally and this is vx
01:05:34
again for the bolt knew bull p
01:05:44
I also wasn’t deleted here
01:05:54
oh
01:06:00
so very good so eng I’m counting
01:06:04
yes it will be luck and the moment of the end of
01:06:07
pressing the button now I think it should be
01:06:18
calculated by the angle and
01:06:21
radius of this very thing Pushkin water
01:06:24
muzzle creed line ah di yes go stores this
01:06:32
very live aid he config so targeting
01:06:38
this function that is triggered by
01:06:39
aiming at mouse movement is hung
01:06:42
the ranking aiming
01:06:46
so and look, yes this is it. 24 this is
01:06:53
the location of the cannon by the way, you also
01:06:56
see that the cannon is hard-coded always
01:06:58
in these coordinates, this is bad, it should
01:07:01
be able to, well, let these constants
01:07:03
be named by them and let them lie
01:07:05
right in my class itself, even if as
01:07:08
properties of the class, but in any case not like
01:07:11
that so now let’s figure out that
01:07:17
we have this one here, one two, these are the
01:07:22
coordinates I need, I take
01:07:25
these two lines and drag them fair and i x y,
01:07:34
here I’ll write something like this, yes this is x,
01:07:46
click ah fur coat, not
01:07:56
so much yet ok, so x y I have now
01:08:02
registered the center of the tip of the muzzle, here is the tip of the
01:08:05
muzzle that I should fly, the
01:08:07
projectile will be so engl and here it
01:08:10
is calculated yes this tunngle is
01:08:18
interesting
01:08:24
sex y these x y should
01:08:32
actually be sat down. xlv. y this is exactly
01:08:36
the location of this
01:08:39
gun itself, the centers
01:08:41
and it doesn’t have them, these are the numbers
01:08:52
before they exist just like that,
01:09:03
we fix it, we insert that, well, let’s do it the
01:09:06
old fashioned way until it breaks 20 by
01:09:09
X 450 by Y where else is that
01:09:12
hardcoat I’m still I don’t know, but it’s a mess
01:09:16
in a good way, we need to remove it, so what’s
01:09:19
interesting is the second one, and this is the second piece,
01:09:27
x and y sat down, and this is the second chamber, the starting
01:09:33
position is the position of the gun until the mouse arrives,
01:09:38
since I’m starting this thing, control
01:09:41
shift of 10, I’m learning
01:09:47
oh-oh-oh what's the matter
01:09:53
canvas creed oval says I can't tables
01:09:58
in who do I need the pool army or something
01:10:02
tapu
01:10:03
how so electron is not taboo
01:10:07
x to pull the pool intex I have tapu
01:10:15
how so my bulldozer is being created at the
01:10:23
moment when they began to create a new ball
01:10:25
I, as a CSO, had a line thrown here
01:10:35
so hide, obviously it was done by the gun
01:10:41
at the moment the shot ended, so it
01:10:45
makes ball
01:10:46
x y in x and y and x are two, sorry
01:10:55
guys, you see, at the end there is a
01:11:00
syntax error oh, I accidentally
01:11:03
closed it, not very scary, but stop andron,
01:11:19
come on, well, and the komono appears at the tip of the muzzle, it’s
01:11:24
true that this is a
01:11:28
serial advantage, the same garbage
01:11:30
remains to tell him the speed
01:11:33
now, I don’t have the
01:11:35
correct speed yet, so we find
01:11:38
the speed at the moment of this fire 2 yes you
01:11:44
x and y as they are I think yes,
01:11:49
I see the second chip, yes, here it is in your mouth
01:11:53
and you are here in x and y, let's
01:11:57
see, to start debugging printing,
01:12:00
let's print them, and what kind of speed is
01:12:04
there, in principle, forgive again, closed it's
01:12:10
fun, since the machine came out as an ulcer in May
01:12:18
let's now it will generate on the radio and
01:12:22
print the speed to its 36 29 look at the
01:12:32
ball you ball set forth moss seems to be
01:12:39
there, it seems like there is a movie and let's
01:12:42
see if it is called or not, that
01:12:46
is, in my main loop where I have
01:12:49
this time hander
01:12:59
exactly - of course, redrawing it is one
01:13:03
thing, changing the coordinates is another thing,
01:13:06
let’s counter if I don’t don’t want okay hunger,
01:13:11
this very declaration resource is in this in
01:13:22
this batch, let’s redraw it
01:13:28
to 3, touched something, there was something for
01:13:32
this,
01:13:38
what’s it called?
01:13:45
cord sense,
01:13:47
exactly yes, I can just sit down
01:13:52
the mesh ort to do really yes,
01:14:02
come on dear,
01:14:05
which one is even too well flying
01:14:13
through yes well global they are flying globally they are
01:14:16
already flying
01:14:17
okay I see that now we won’t
01:14:23
be able to do anything significant for
01:14:25
let me at least send this it's a
01:14:27
commit thing, let's look at the noise we
01:14:31
made in the end, I'll git div look at how
01:14:36
many lines I have globally
01:14:38
changed, I'm not happy with what has
01:14:41
happened so far I don't like it and the
01:14:50
balls are flying, that's good, they don't fly in the
01:14:54
first stages of gravity we
01:14:58
looked here, here is the obfuscated
01:15:00
version, they don’t reflect from the walls,
01:15:03
they don’t hit the target, I don’t get
01:15:08
the experience, it’s not reflected anywhere how many
01:15:11
balls I shot down or how much they cost,
01:15:14
my balls fly perfectly, but these goals
01:15:19
should be generated new ones, and it
01:15:24
would be nice to have goals so that they move, so that they
01:15:26
fly, ideally, so that they also
01:15:29
collide according to the law of conservation of
01:15:31
momentum in the background, let’s say
01:15:33
they have the same mass, an absolutely elastic
01:15:35
collision in which they will
01:15:37
exchange speeds, but it
01:15:39
will be cool, in fact, it’s not so
01:15:44
difficult to add it’s not so it’s difficult to
01:15:47
write, but the point is that now
01:15:52
maybe I should really
01:15:53
start, I wanted it to be like yours
01:15:56
in the same conditions, to pee in order to find
01:16:04
fault with the code before understanding the essence,
01:16:08
this is an important part of the work, to be able to
01:16:11
understand the essence of the program code
01:16:13
is considered figure it out, fix it,
01:16:18
understandably, tinker with this matter to
01:16:23
force it
01:16:24
so that the target or waist up,
01:16:27
respectively, there
01:16:29
must be some kind of servicing function
01:16:31
now there is this function time handler
01:16:35
up in which all the complexity is hidden,
01:16:38
listen and well, let it even be hidden in it,
01:16:40
it’s okay, you
01:16:44
clean code, write documentation for
01:16:46
each method, what it does, what
01:16:49
task it has, and all the legacy so-
01:16:51
called old code that is outdated
01:16:55
is better to just throw it out, that is, if
01:16:58
something is not working, something that is
01:17:01
not used, but it’s lying around,
01:17:04
it’s better to just delete it so that it doesn’t just
01:17:07
lie around like that, now I
01:17:09
just wrote this as a toy that fell apart,
01:17:12
oh, where is this approach going to end up here,
01:17:15
yes, I was fixing it like this,
01:17:17
tell me, but I’m wondering, you’ve
01:17:20
already been tinkering with this code
01:17:22
correctly
01:17:23
until what stage you got there and everything is
01:17:28
flying out of gravity, reflected from the walls
01:17:31
and the goal is amazed to do what is normal,
01:17:46
well, cool, cool, this is very good, it means
01:17:51
you are ahead of me, how much time did it
01:17:54
take you to do this, and again in
01:18:10
different ways up to 2 pairs 2 hours three,
01:18:18
well, what can I say, you have a fresh
01:18:21
brain, so it’s good that you
01:18:24
are coping more or less wisely, everything is fine, and
01:18:26
what else I want to say now is the
01:18:36
project, I should have
01:18:39
calculated it in advance so that it would be easier to navigate in
01:18:42
it so that I could spend less time, but
01:18:44
these are the memories with on the other hand,
01:18:46
this is picking, this is
01:18:49
nitpicking, and my well, who is this anyway,
01:18:52
what is this attribute, this is important
01:18:54
to understand, because otherwise these
01:18:57
stupid names
01:18:58
they don’t etch out, you will think
01:19:00
the spirit is why not naming what not to name t1
01:19:04
a.n .
01:19:05
something about nothing at all, f2 power of
01:19:09
2, it’s absolutely terrible, it’s impossible to
01:19:12
write like that, the way it’s
01:19:14
organized now, I still really don’t
01:19:16
like the code, the explicitness of such a smell
01:19:19
needs to be highlighted and isolated from, and it’s
01:19:22
unreadable in many places,
01:19:24
having no I completely understand the network, I
01:19:27
don’t have a clue about how
01:19:29
the mode is switched, pressed the
01:19:31
mouse, released the mouse, again I don’t
01:19:34
like it yet, how I did it, it
01:19:38
needs to be isolated, makes it more readable,
01:19:41
okay, look, I’m finished with this
01:19:46
matter now, in any case, I’ll do it commit
01:19:51
your task will be to
01:19:55
do a good modular refactoring, that is, to
01:20:00
tear off the physics of the ongoing process, the
01:20:03
physics class associated, for example, with
01:20:08
targets or with targets and a ball, and even
01:20:14
tear off the gun into a separate module,
01:20:18
but as for tkinter,
01:20:22
let you separate these things into a separate module there will be a
01:20:27
model a little independently of
01:20:30
the display so that the
01:20:34
class score is not responsible for its display
01:20:37
so that it is not his responsibility to
01:20:39
pull the colors so that he knows about the
01:20:43
canvas in general so that he does not know anything
01:20:46
essentially about the volume of the canvas, well,
01:20:49
let him have a tabula identifier there or
01:20:51
stored in yeah, but
01:20:54
somehow get this thing out, think
01:20:58
maybe some other way will come up with how to
01:21:00
divide it into a module, and in fact,
01:21:04
this is the idea of
01:21:05
separating the model from the display, that is, there’s
01:21:10
also a controller on
01:21:12
model-view-controller, this is one of such
01:21:14
fundamental things that allow you to
01:21:16
separate the complexity
01:21:17
of why because very often
01:21:20
the display can be different, that is,
01:21:27
you can display this way or that way, you
01:21:30
can complicate this display as
01:21:32
if it’s getting closer, moving away, and whether
01:21:35
you have a field on which all this flies, like in the
01:21:37
game worms, it’s more than the screen and you can go back and
01:21:40
forth to look at what’s happening, it’s
01:21:44
clear at gunpoint just to
01:21:47
get closer and move away, that’s why, in
01:21:50
principle, this is the idea of ​​​​the gap between
01:21:52
the display and the model, it’s very expensive, the
01:21:55
transition of coordinates is also now there is
01:21:57
absolutely no one killed, I haven’t touched the
01:22:00
coordinate seeds, okay, let’s forget it for
01:22:03
clarity, let’s do it commit for today we
01:22:05
finish with you thank you for your attention
01:22:07
and see you next time

Description:

Практика: http://cs.mipt.ru/python Telegram-группа: https://t.me/tkhirianov_python_2019 Программа курса: https://github.com/tkhirianov/lections_2019/tree/master/semestr_1 Спонсировать: https://www.patreon.com/tkhirianov или https://www.paypal.com/paypalme/tkhirianov или 63900240 9020000598 (карта СБ).

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "Практика программирования на Python 3, лекция №9" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "Практика программирования на Python 3, лекция №9" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "Практика программирования на Python 3, лекция №9" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "Практика программирования на Python 3, лекция №9" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "Практика программирования на Python 3, лекция №9"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "Практика программирования на Python 3, лекция №9"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.