WordSteps
Есть вопросы?
закрыть

第3回 MIT 6.00 コンピュータ科学・プログラミング入門 2008年秋

00:00:00
The following content is provided under a Creative
00:00:02
Commons license.
00:00:03
Your support will help MIT OpenCourseware continue to
00:00:06
offer high-quality educational resources for free.
00:00:10
To make a donation, or view additional materials from
00:00:13
hundreds of MIT courses, visit MIT OpenCourseware
00:00:16
at ocw.mit.edu.
00:00:17
PROFESSOR ERIC GRIMSON: All right, I'm going to start
00:00:22
today by talking about, so what have we been doing?
00:00:26
What have we actually done over the last few lectures?
00:00:28
And I want to suggest that what we've done is, we've outlined a
00:00:32
lot of the basic elements of programming.
00:00:35
A lot of the basic elements we're going to need
00:00:36
to write code.
00:00:37
And I want to just highlight it for you because we're going
00:00:39
to come back and look at it.
00:00:40
So I'm going to suggest that we've looked at three
00:00:43
different kinds of things.
00:00:45
We've talked about data, we've talked about operations,
00:00:51
and we've talked about commands or statements.
00:00:59
All right?
00:01:00
Data's what we expect.
00:01:01
It's our way of representing fundamentally the kinds of
00:01:05
information we want to move around.
00:01:06
And here, I'm going to suggest we've seen numbers, we've seen
00:01:11
strings, and I'm going to add Booleans here as well.
00:01:16
They're a third kind of value that we saw when we started
00:01:19
talking about conditions.
00:01:21
We saw, associated with that primitive data, we have ways of
00:01:24
taking data in and creating new kinds of data out, or new
00:01:27
versions of data out, so we have operations.
00:01:31
Things like addition and multiplication, which we saw
00:01:33
not only apply to numbers, but we can use them on things like
00:01:36
strings and we're going to come back to them again.
00:01:38
Can't use them on Booleans, they have a different
00:01:40
set of things.
00:01:41
They do things like AND, and OR.
00:01:45
And of course there's a bunch of other ones in there, I'm not
00:01:47
going to put them all up, but we're building up a little
00:01:49
collection, if you like, of those operations.
00:01:52
And then the main thing we've done is, we've
00:01:53
talked about commands.
00:01:54
So I'm going to suggest we've seen now four different things.
00:01:57
We've seen assignment, how to bind a name to a value.
00:02:04
We've seen input and output.
00:02:10
Print for output, for example, and raw input for input.
00:02:15
We've seen conditionals, or said another way, branches,
00:02:23
ways of changing the flow of control through that
00:02:26
sequence of instructions we're building up.
00:02:28
And the last thing we added were loop mechanisms.
показать еще
свой перевод
Работаем...
нет перевода