Placeholder Image

字幕表 動画を再生する

  • >> [MUSIC PLAYING]

    >> [音楽再生]

  • >> -Alright!

    >> -Alright!

  • >> -This is CS50.

    >> - これはCS50である。

  • >> -This is CS50.

    >> - これはCS50である。

  • >> -This is CS50.

    >> - これはCS50である。

  • [MUSIC -- IGGY AZALEA, "FANCY"]

    [ミュージック - IGGY AZALEA、「ファンシー」]

  • >> -My favorite memory from CS50 was when I went to Puzzle Day.

    >> CS50から - 私の好きな​​メモリ 私はデイパズルに行ったときだった。

  • >> -Probably just the time spent working on problem sets

    >> -Probablyちょうど時間 問題のあるセットでの作業に費やした

  • with my friends and people who wold eventually become my blockmates.

    ウォールド私の友人や人々と 最終的には私のblockmatesになる。

  • >> -My best memory from CS50 is the Hackathon.

    >> から - 私の一番の思い出 CS50はハッカソンである。

  • -The CS50 Hackathon.

    -The CS50ハッカソン。

  • >> -Hackathon.

    >> -Hackathon。

  • >> -Hackathon.

    >> -Hackathon。

  • -Hackathon.

    -Hackathon。

  • -The Hackathon

    -Theハッカソン

  • -Rob Bowden.

    -Robボーデン。

  • Just everything about him.

    彼についてちょうどすべて。

  • >> [MUSIC -- IGGY AZALEA, "FANCY"]

    >> [ミュージック - IGGY AZALEA、「ファンシー」]

  • >> -My favorite memory is when I was on stage and I played the prestigious role

    >> 私がいた時 - 私の好きな​​メモリである ステージと私は権威ある役割を果たした

  • of a node [? in the Linked ?] [? List. ?]

    ノード[の?リンクされた中?] [?リスト。 ?]

  • >> -When we all got free Dropbox space and David was like, look under your seats.

    >> 私達はすべて自由Dropboxの容量を持って毎期と ダビデはあなたの席の下に見える、のようだった。

  • And it was like, space for everyone!

    そして、それはすべての人のためのスペース、のようだった!

  • >> [MUSIC -- IGGY AZALEA, "FANCY"]

    >> [ミュージック - IGGY AZALEA、「ファンシー」]

  • >> -My advice for any incoming student would

    >> いずれについて - 私のアドバイス 入ってくる生徒だろう

  • be to really work on P-sets with friends.

    本当に作業すること 友人とP-セット。

  • >> -Office hours is very much your friend.

    >> -Office時間は非常にあなたの友達です。

  • >> -Make the most of your experience and meet as many people as you can.

    >> あなたの経験の中で最も-make することができますようにと多くの人を満たしています。

  • >> -Don't be afraid to ask for help.

    >> 助けを求めることを恐れてはいけ-Don't。

  • -Start the P-sets early in the week.

    初期の週におけるPセットを-start。

  • -I think the biggest thing is to take advantage of all the resources

    最大のものは、にあると思い-I すべてのリソースを活用する

  • that CS50 has.

    そのCS50があります。

  • >> -Go to office hours early in the week.

    >> 初期の週の営業時間に-go。

  • >> -Definitely watch the shorts.

    >> -Definitelyショートパンツを見る。

  • >> -Don't procrastinate on your P-sets.

    >> あなたのP-セットに先延ばし-Don't。

  • -Make sure you find a great group of people to work on P-sets with.

    あなたは素晴らしいグループを検索してください-make とP-セットで動作するように人々の。

  • You can have a lot of fun and get work done together.

    あなたは多くの楽しみを持つことができます と仕事を一緒に片付ける。

  • >> -Don't be afraid to push yourself.

    >> 自分自身をプッシュすることを恐れ-Don't。

  • Go for the hacker edition sometimes.

    時にはハッカー版のために行く。

  • >> -Write things on paper before you ever touch your computer.

    >> 紙の上-Write物事の前に あなたは今までお使いのコンピュータに触れる。

  • >> -CS50 is really great at providing ways to get help.

    >> -CS50は、本当に素晴らしいです 助けを得るための方法を提供する。

  • >> -My one piece of advice is sleep.

    >> アドバイスの-My一枚は、睡眠です。

  • Has anybody said that?

    誰がそれを言っていますか?

  • Sleep, for sure.

    確かにスリープ、。

  • It's easy not to do, but you've got to do it, I think.

    それを行うのは容易ではないですが、 あなたがそれを行うために持っていると思います。

  • >> -I would say really be mentally prepared because you're going to love it.

    >> -Iは本当に精神的に調製することだと思います あなたがそれを好きになるだろうからである。

  • [MUSIC -- IGGY AZALEA, "FANCY"]

    [ミュージック - IGGY AZALEA、「ファンシー」]

  • >> -This is CS50.

    >> - これはCS50である。

  • >> -This is CS50.

    >> - これはCS50である。

  • >> -This is CS50.

    >> - これはCS50である。

  • [MUSIC -- IGGY AZALEA, "FANCY"]

    [ミュージック - IGGY AZALEA、「ファンシー」]

  • >> -This is CS50.

    >> - これはCS50である。

  • >> [APPLAUSE]

    >> [拍手]

  • >> DAVID J. MALAN: So this is CS50 and this is the end of Week 0.

    >> DAVID J.マラン:これはCS50である これは0週目の終わりです。

  • And that was just some of CS50's staff who

    そして、それはほんの一部だった CS50のスタッフの方

  • await you not only in sections and office hours, but,

    あなただけではなくセクションで待つ と営業時間、しかし、

  • also, this coming weekend at CS50 Puzzle Day.

    また、今度の週末 CS50パズルの日で。

  • Which, again, is not all about programming.

    どの、再び、ではない すべてのプログラミングについて。

  • Indeed, it's expected that you won't have to program anything,

    実際に、あなたと期待だ 何をプログラムする必要はありません、

  • but rather solve problems using wits and friends alongside you.

    むしろ使用して問題を解決 あなたと一緒に知恵と友人。

  • >> We will be joined by some of our friends at Facebook--

    >> 私たちは、いくつかによって結合されます Facebook--での私たちの友人の

  • if you register here-- who for the past several years,

    あなたはhere--を登録する人 過去数年間、

  • have actually been writing these challenges with us.

    実際に書いている 私達とこれらの課題。

  • And so, they will be the ones ultimately running Puzzle Day.

    だから、彼らはものになります 最終的にパズルの日実行されている。

  • And so, you will be challenged with precisely the kinds of things

    だから、あなたは挑戦されます 物事の正確な種類を持つ

  • and problems that folks at Facebook like to think about.

    問題の人で Facebookは考えるのが好きです。

  • So that is tomorrow.

    だから明日です。

  • Register at cs50.harvard.edu/register.

    cs50.harvard.edu/registerで登録します。

  • >> Now a word on a couple of staff in particular.

    >> カップルでの今の単語 特にスタッフの。

  • This here is Ansel Duff, who is actually one

    これは、ここで、アンセル·ダフです 実際に1人である

  • of the co-authors of these binary bulbs that we saw on Wednesday,

    これらのバイナリの共著者の 私たちは水曜日に見た球根、

  • in addition to CS50's own Dan Bradley.

    CS50自身のダン·ブラッドリーに加えて。

  • Ansel Duff was also a former freshman advisee of mine 3 years ago

    アンセル·ダフも、前者だった 3年前に私の新入生助言を受ける人

  • and he actually even built this lectern.

    そして彼は、実際にあっても、この書見台を建てた。

  • He's gone on to do engineering sciences and more.

    彼が行うに逝ってしまった エンジニアリング科学など。

  • Now, his picture here is actually Ansel 3 years ago at the CS50 Hackathon

    さて、ここで彼の写真は実際にある CS50ハッカソンで3年前アンセル

  • when he borrowed one of our balloons, stuck it to his laptop,

    彼は私たちのいずれかを借りたとき バルーンは、彼のラップトップにそれを貼り付け、

  • and, for the next 12 some odd hours, focused on his final project,

    そして、次の12いくつかの奇妙なため 彼の最終的なプロジェクトに焦点を当てた時間、

  • taking breaks only to open bags of candy at the Hackathon.

    のみ開くように休憩を取って ハッカソンでお菓子の袋。

  • >> But he went on more recently to spend this past summer with us,

    >> しかし、彼は最近になって上に行きました 私たちと一緒にこの過去の夏を過ごす、

  • since CS50 for its staff, and now students this semester,

    そのスタッフのCS50、それ以来 今の学生は学期、

  • has its own 3D printer.

    独自の3Dプリンタを持っています。

  • And in a nutshell a 3D printers is a device that looks quite like this.

    そして、一言で言えば3Dプリンタである 非常にこのようになりますデバイス。

  • You fill it with a plastic spool that is melted down by the device

    あなたは、プラスチック製のスプールでそれを埋める そのデバイスによって溶かされている

  • and you build things literally from nothing.

    あなたが物事を構築 文字通り何もないから。

  • Much like an inkjet printer, you start spitting out little dots of plastic

    インクジェットプリンタのように多くは、あなたが開始 プラスチックの小さなドットを吐き出す

  • that form together to form whole objects.

    そのフォームは一緒に オブジェクト全体を形成している。

  • And so Ansel for instance, earlier this summer, has an iPhone 5

    例えばだからアンセル、以前 この夏は、iPhone 5を有している

  • and decided he really wanted to prop it up on his desk.

    そして彼は本当に決めました 彼の机の上にを下支えする。

  • But he didn't want to go out and buy something

    しかし、彼はしたくなかった 外に出て何かを購入

  • from the Apple store or the like, so he sat down and started drawing something.

    アップルストア等から、彼 座って何かを描き始めました。

  • He took a few measurements as to how thick

    彼はいくつかの測定値を取った どのように厚いに関して

  • and how wide his iPhone was, he drew this image here,

    と彼のiPhoneはどのように広がっていた、 彼は、ここでこのイメージを描きました

  • he decided that he wanted to have a 75 degree tilt

    彼は彼が望むことを決定 75度の傾斜を持っている

  • as it was staring at him on his desk there.

    それは凝視したとして そこに彼の机の上に彼。

  • He then turned this, using software, into a 3D CAD model

    彼はそれを用いて、これをオンに 3D CADモデルにソフトウェア、

  • that looked a little something like this.

    それが少し見えた このようなもの。

  • And then he proceeded, ultimately, to actually create it.

    そして彼は進行し、 最終的には、実際にそれを作成します。

  • So in fact, if any of you here, perhaps in a row that I can throw to, have

    だから実際には、ここでの、もしあれば、おそらく 私は投げることができるの行に、持っている

  • an-- there we have folks with iPhone 5 , and here we have two more.

    私たちはiPhoneで人々を持ってそこにan-- 5、そしてここでは、さらに2つを持っている。

  • >> Now, not to be outdone, CS50's own Cheng Gong also set out this summer

    >> 今、負けじとしないように、CS50自身の チェンゴングもこの夏着手

  • to build quite a few things and, in fact, for reasons that are still

    かなりの数のものを構築すると、 実際には、まだ理由のために

  • unclear, has been slowly printing an army of elephants

    不明で、ゆっくりとしている 象の軍隊を印刷

  • with articulating arms and trunks.

    腕やトランクを連接した。

  • A couple of which are actually here if anyone would now like-- an elephant.

    のカップルがここにあれば実際に 誰もが今象をlike--だろう。

  • All right, . but what Cheng also did for us is he very kindly set up a camera

    すべての権利、。しかしチェンはまた、何をしたか 私たちのために彼は非常に親切にカメラを設置されている

  • because that elephant, believe it or not,

    その象ので、 それを信じるかどうか、

  • takes some two and a half hours to print.

    取り、いくつかの2と 印刷に時間半。

  • Even the iPhone stand took an hour and a half to print.

    でも、iPhoneのスタンドがかかった 印刷に時間半。

  • And what Cheng went ahead and did was set up a nice camera in front

    そして、チェンは先に行って、何をしたか フロントでの素敵なカメラを設置した

  • of this 3D printer, filmed for an hour and a half as Ansel's design printed.

    この3Dプリンタで、時間の撮影 そしてアンセルのデザインなどの半分が印刷された。

  • We overlaid some sexy music to it in order

    私たちは、いくつかのセクシーを重ねて 順番にそれへの音楽

  • to give you this to look at how 3D printing works.

    あなたにこれを与えることを探したい 3Dプリントがどのように機能するかで。

  • And even though this is actually in plastic,

    そして、これでもかの プラスチックに実際にある、

  • realize that if this is an area of interest to you academically,

    このエリアである場合と認識 学問的に興味を持たれ、

  • there are folks, among them Jennifer Lewis here

    皆さんはの中で、ある ここではそれらジェニファー·ルイス

  • at the School of Engineering, who are actually

    の学校で 実際にエンジニアリング、

  • working on 3D printing of plastic objects.

    3Dプリントに取り組んで プラスチックのオブジェクト。

  • But even, increasingly, biological materials to solve

    しかし、たとえ、ますます、 解決するために生物学的物質

  • physiological problems for humans.

    人間のための生理的な問題。

  • But here is a little something from CS50.

    しかし、ここで少しはある CS50から何か。

  • >> [LOUD MECHANICAL NOISES]

    >> [LOUD機械ノイズ]

  • DAVID J. MALAN: It doesn't sound anything like that in reality,

    DAVID J.マラン:それは鳴りません 現実にはそのようなこと、

  • but it's much cooler to watch it at that speed, and with that sound.

    それはそれを見て非常に涼しいです その速度で、その音で。

  • >> Now, on Wednesday, how did we first get here?

    >> さて、水曜日に、どのように まず、ここで手に入れた?

  • We started talking about computer science and we asked what it was.

    私たちは、コンピュータの話を始めた 科学と私たちはそれが何であったか尋ねた。

  • And it's about a number of things, and there's so many different directions

    そしてそれは、多くのことについてですと 非常に多くの異なる方向があります

  • in which you can head after a course like CS50.

    あなたが向かうことができる CS50のようなコースの後。

  • In fact, if you picked up one of those unofficial guides

    実際には、1を拾った場合 これらの非公式のガイド

  • to CS outside, the booklet that we've provided, whether you're

    CSの外部に、冊子に 私たちは、あなたがしているかどうかを、提供してきました

  • thinking of taking just CS50, or maybe doing a secondary,

    ただCS50を取ることを考えて、 または多分、二次をやって

  • or maybe even concentrating in CS, do flip through that.

    または多分集中 CSで、そのめくっん。

  • And you'll see a diagram toward the end that

    そして、あなたはダイアグラムが表示されます 終わりに向かって、その

  • shows you the many different directions in CS that you can go off in.

    あなたに多くの異なる方向を示している CSにあなたがオフに行くことができます。

  • >> But for today, we'll focus, again, on really one of the fundamental views,

    >> しかし、今日のために、私たちは上に、再び、注目します 本当に基本的なビューのいずれか、

  • perhaps, where you have inputs to problems,

    おそらく、あなたはどこを持っている 問題への入力、

  • you have outputs from problems, and you have

    あなたがからの出力を持っている 問題は、あなたが持っている

  • algorithms with which to create those outputs from those inputs.

    作成したアルゴリズム これらの入力からそれらの出力。

  • And one such example, was of course, this phone book here.

    そしてその一例は、であった もちろん、ここでは、この電話帳。

  • And we used as an example to go through an algorithm that was correct.

    そして、私たちは行くことを例として使用 正しかったアルゴリズムを通して。

  • And then another one was correct, but a little faster.

    そして、もう1だった 修正しますが、少し速く。

  • And then another one that was a little more dramatic, but fundamentally

    ちょっとした後、別の1 より劇的な、しかし根本的に

  • faster.

    速い。

  • >> Right, this phone book we claimed had about 1,000 pages.

    >> そう、この電話帳たち 約1,000ページを持っていたと主張した。

  • And how many times did I have to tear the phone book in half

    そして、どのように何回は、私が持っていた 半分に電話帳を引き裂く

  • to find someone like Mike Smith, maximally, in 1,000 page book?

    マイク·スミスのような人を見つけるために、 最大限に、千ページの本にある?

  • So, 10 give or take.

    だから、10が与えるか、または取る。

  • And so once I tore this thing in half, or simply, more maturely,

    だから私はこの事を引き裂いた後、 半分、あるいは単に、より尚早、

  • divided in half, it's only 10 pages out of 1,000.

    半分に分け、それだけだ 千のうち、10ページ。

  • And if you extrapolate, a little unrealistically for a phone book,

    そして、あなたは、少し外挿する場合は、 非現実的な電話帳のために、

  • but if this phone book had some 4 billion pages in it, so completely

    この電話帳は、いくつかの4があった場合 その中の十億のページなので、完全に

  • unwieldy physically, how many times do you divide a 4 billion

    扱いにくい物理的に、どのように多くの 回あなたが40億を分割でください

  • page phone book in half?

    半分にページの電話帳?

  • So it's actually 32, give or take.

    だから、与えるか、または取る、実際に32です。

  • And so 32 times only, out of 4 billion pages, can

    だから32回のみ、タイムアウト 40億のページの、することができます

  • you find someone like Mike Smith.

    あなたはマイク·スミスのような人を見つける。

  • And that's efficiency.

    そして、それは効率です。

  • That's a good algorithm, daresay.

    それは良いアルゴリズム、あえて言うのです。

  • >> But then we moved from that to try to formalize it.

    >> しかし、その後、私たちはそのから移動 それを形式化しようとする。

  • And I proposed this pseudocode code.

    そして、私は、この擬似コードコードを提案した。

  • Pseudocode code is not anything formal.

    擬似コードのコードでは、正式なものではありません。

  • It's not something you memorize.

    それはあなたが覚えるものではありません。

  • It's just something you express fairly intuitively using English,

    それはちょうどあなたが表現するものだ かなり直感的に英語を使用して、

  • or any language really, that conveys your ideas succinctly.

    または任意の言語は本当に、その 簡潔にあなたのアイデアを伝える。

  • But what's key about pseudocode code is that you

    しかし、何が約鍵だ 擬似コードコードは、ということです

  • try to anticipate all of the possible cases that might happen.

    すべてを予想しよう 起こるかもしれない可能なケース。

  • And indeed, in this pseudocode code, there were really three cases

    そして実際、この擬似コード コー​​ド、本当に3つのケースがありました

  • every time I divided the phone book.

    たびに私は、電話帳を分けた。

  • Mike might be to the left.

    マイクは左にある可能性があります。

  • Mike might be to the right.

    マイクは右にある可能性があります。

  • Or he might be right on the page I'm on.

    それとも彼は私が上だページ上正しいかもしれない。

  • Or a fourth corner case, so to speak.

    または第四コーナーケースは、いわば。

  • A bad scenario might be one which-- what is happening?

    悪いシナリオは1かもしれません which--何が起こっているの?

  • Mike's just not in the phone book at all.

    マイクは中だけではありません 電話帳では、すべての。

  • >> And when programs crash-- when Mac and PC software that you guys run

    >> そして、プログラムは時crash--ときマック 君たちが実行され、PCソフトウェア

  • on your computers sometimes hangs or quits unexpectedly,

    時には、あなたのコンピュータ上の ハングアップしたり予期せず終了する、

  • that generally means that some programmer, some human like you soon,

    それは、一般的にその一部を意味し、 プログラマ、すぐにあなたのようないくつかのヒト、

  • just screwed up and made some mistake.

    ただめちゃくちゃといくつかのミスを犯した。

  • Maybe didn't anticipate that maybe there is no Mike Smith in the phone book.

    多分、多分そこにそれを予想していなかった 電話帳にはマイク·スミスではありません。

  • And if you don't actually write code to handle situations like that,

    そして、あなたが実際に書いていない場合は、 そのような状況を処理するコード、

  • generally unpredictable things can happen.

    一般的には予測できない 事が起こる可能性があります。

  • Your machine can freeze.

    あなたのマシンがフリーズすることができます。

  • It can reboot.

    これは、再起動することができます。

  • The program can quit.

    プログラムが終了することができます。

  • And so all of these stupidities that you may

    だから、これらすべての そのあなたがかもしれstupidities

  • have encountered in your actual life just using computers,

    実際に遭遇した 生命はちょうど、コンピュータを使用

  • will increasingly be just explained away by this intuition

    ますますばかりになります この直感離れ説明

  • and this understanding of what is actually going on underneath the hood.

    とは何のこの理解 実際にボンネットの下に起こっている。

  • >> Now let's try to take a look at a more general problem.

    >> それでは、見てみてみましょう より一般的な問題で。

  • Rather than take attendance in a place like

    取るのではなく のような場所での出席

  • this, which would be quite slow to do one, two, three, four.

    これは、非常に遅くなるであろう 一つ、二つ、三つ、四つを行う。

  • Or maybe two, four, six, eight.

    それとも2つ、4つ、6つ、8。

  • Let's focus, instead, on how we might formalize

    それでは上、その代わりに、焦点を当ててみましょう 私たちは形式化する方法

  • the algorithm of the process by which we could take attendance.

    による処理のアルゴリズム その私たちは出席を取ることができる。

  • And along the way, let's start to apply some nomenclature

    そして道に沿って、のは始めましょう いくつかの命名法を適用する

  • that we'll use today when we actually start programming in a language.

    時実際に私たちは私たちは今日を使うだろうと 言語でプログラミングを開始。

  • So I give you now, a four minute video that we put together with our friends

    だから私は、今4分間のビデオをあなたを与える 私たちは友人と一緒に入れていることを

  • from TED, the organization.

    TED、組織から。

  • Whereby we supplied a script and they brought their animators to bear,

    私たちは、スクリプトを供給することにより、および 彼らは、負担する彼らのアニメーターをもたらした

  • and actually created a 2D animation of what an algorithm is.

    実際に2Dを作成 アルゴリズムは何であるかのアニメーション。

  • If we could dim the lights.

    私たちは照明を暗くことができれば。

  • >> [MUSIC PLAYING]

    >> [音楽再生]

  • NARRATOR: What's an algorithm?

    ナレーター:アルゴリズムは何ですか?

  • In computer science, an algorithm is a set

    コンピュータサイエンスでは、 アルゴリズムはセットです

  • of instructions resolving some problem step-by-step.

    解決命令の いくつかの問題のステップバイステップ。

  • Typically, algorithms are executed by computers,

    一般的に、アルゴリズムは、 コンピュータによって実行される、

  • but we humans have algorithms as well.

    私たち人間も同様のアルゴリズムを持っている。

  • For instance, how would you go about counting

    例えば、どのようにでしょう あなたは、カウントについて行く

  • the number of people in a room?

    部屋の人数?

  • Well, if you're like me, you'd probably point at each person one at a time

    あなたが私に似ている場合にはさて、あなたはおそらくしたい 一度に一人一人1における点

  • and count up from zero.

    ゼロからカウントアップ。

  • One, two, three, four, and so forth.

    一つ、二つ、三つ、四つ、など。

  • Well, that's an algorithm.

    まあ、それはアルゴリズムだ。

  • In fact, let's try to express it a bit more formally in pseudocode code.

    実際には、のはそれ表現してみましょう 擬似コード·コードにより正式にビット。

  • English-like syntax that resembles a programming language.

    英語のような構文こと プログラミング言語に似ている。

  • >> Let n equal 0.

    >> をn 0に等しい。

  • For each person in room, set n equal to n plus 1.

    部屋に一人一人のために、 集合Nに等しいnのプラス1。

  • How to interpret the pseudocode?

    擬似コードを解釈するには?

  • Well line one declares, so to speak, a variable

    さて、ライン1は、宣言してい そう、変数を話す

  • called n and initializes its value to 0 This just

    nおよび初期化と呼ばれる 0ちょうどこの、その値

  • means that at the beginning of our algorithm,

    意味での このアルゴリズムの始まり、

  • the thing with which we're counting has a value of 0.

    私たちがしているどのとの事 カウントは0の値を有する。

  • After all, before we start counting we haven't counted anything yet.

    結局のところ、私たちはカウントを開始する前に 私たちはまだ何もカウントされていません。

  • Calling this variable n is just a convention.

    この変数を呼び出す nは単なる慣習である。

  • I could have called it most anything.

    私はほとんど何もそれを求めている可能性があります。

  • Now line two demarks the start of a loop,

    今2マーク解除を裏打ち ループの開始、

  • a sequence of steps that will repeat some number of times.

    一連のステップ意志 何回か繰り返します。

  • So in our example, the step we're taking is counting people in the room.

    だから私たちの例では、ステップ私たちはしている 撮影は、部屋に人を数えている。

  • Beneath line two is line three which describes

    ライン2の下のラインである 説明します3

  • exactly how we'll go about counting.

    正確にどのように私たちは、カウントについて行くよ。

  • The indentation implies that it's line three that will repeat.

    インデントはことを意味します それが繰り返される行3です。

  • So with the pseudocode code is saying is that after starting at 0

    だから、擬似コードコードである ことわざは、後には0から始まるということです

  • for each person in the room we'll increase n by 1

    それぞれの人のために 部屋私たちは1のnを増やします

  • Now is this algorithm correct?

    今、このアルゴリズムは正しいか?

  • Well let's bang on it a bit.

    さてそれでは、その上に少し強打しましょう​​。

  • >> Does it work if there are two people in the room?

    >> がある場合には機能していますか 部屋に二人?

  • Let's see.

    見てみましょう。

  • In line one we initialize n to 0.

    行1では、0 nに初期化します。

  • For each of these two people, we then increment n by 1.

    これら二人のそれぞれについて、 私達はそれから1によってn個をインクリメント。

  • So in the first trip through the loop, we update n from 0 to 1.

    〜第旅行でそう ループは、0から1までのnを更新します。

  • On the second trip through that same loop, we update n from 1 to 2.

    その介して第旅行で 同じループ、私達は1から2のnを更新します。

  • And so, by this algorithm's end, n is 2, which

    そしてそうすることによって、このアルゴリズムの エンド、nが、2である

  • indeed matches the number of people in the room.

    確かに番号と一致 部屋の中の人。

  • So far, so good.

    これまでのところ、とても良い。

  • >> How about a corner case though?

    >> どのようにもコーナーケースはどうですか?

  • Suppose that there are 0 people in the room-- besides me, who's

    0人がいるとします です私の他にroom--、中

  • doing counting.

    カウントを行う。

  • In line one, we again initialize n to 0.

    行1では、再​​びnを0に初期化します。

  • This time though, line three doesn't execute at all

    しかし今回は、ライン 3は全く実行されない

  • since there isn't a person in the room.

    部屋に人が存在しないからである。

  • And so n remains 0, which indeed matches the number of people in the room.

    だからnは確かに一致する、0のまま 部屋の人数。

  • Pretty simple, right?

    かなりシンプルでしょ?

  • But counting people one at a time is pretty inefficient, too, no?

    しかし、一度人1を数える いや、あまりにも、かなり非効率的なのですか?

  • Surely we can do better.

    確かに私たちはより良い行うことができます。

  • Why not count two people at a time, instead of counting one, two, three,

    なぜ一度に2人をカウントしませ、 代わりに計数する一つ、二つ、三つ、

  • four, five, six, seven, eight, and so forth.

    四つ、5つ、6つ、7つ、 8個など。

  • Why not count two, four, six, eight, and so on?

    なぜカウントしない2つ、4つ、 6個、8個、というように?

  • It even sounds faster.

    それも、より速く鳴ります。

  • And it surely is.

    そして、それは確かにある。

  • >> Let's express this optimization in pseudocode code.

    >> それではこの最適化を表現してみましょう 擬似コードコード中。

  • Let n equal 0.

    をn 0に等しい。

  • For each pair of people in room, set n equal to n plus 2.

    中の人の各ペアについて 部屋、セットnからn +2に等しい。

  • Pretty simple change, right?

    プリティ簡単な変更、右?

  • Rather than count people one at a time, we instead count them two at a time.

    のではなく、人一つずつ数え、 私たちは代わりに一度に2を数える。

  • This algorithm's, thus, twice as fast as the last.

    このアルゴリズムの、したがって、 最後の2倍の速さ。

  • But is it correct?

    しかし、それは正しいか?

  • Let's see.

    見てみましょう。

  • Does it work if there are two people in the room?

    がある場合には機能していますか 部屋に二人?

  • In line one, we initialize n to 0.

    行1では、0 nに初期化します。

  • For that one pair of people, we then increment n by 2.

    人の1組については、 私たちは、その後2でnはインクリメント。

  • And so by this algorithm's end n is 2, which

    だからこのアルゴリズムのことで エンドnが2であり、これ

  • indeed matches the number of people in the room.

    確かに番号と一致 部屋の中の人。

  • >> Suppose next that there are zero people in the room.

    >> があることを次の仮定 客室内にゼロ人。

  • In line one we initialize n to 0.

    行1では、0 nに初期化します。

  • As before, line three doesn't execute it all

    前と同じように、ライン3 それをすべて実行しません

  • since there aren't any pairs of people in the room, and so n remains 0.

    人々のいずれかのペアが存在しないので、 客室内に、などnは0のままです。

  • Which indeed matches the number of people in the room.

    どの確かに一致する 部屋の人数。

  • But what if there are three people in the room?

    しかし、何がある場合 部屋に3人?

  • How does this algorithm fare?

    どのようにこのアルゴリズム運賃のですか?

  • Let's see, in line one, we initialize n to 0.

    ライン1に、見てみましょう、 私たちは0 nに初期化します。

  • For a pair of those people, we then increment n by 2.

    それらの人々の対に対して、 私たちは、その後2でnはインクリメント。

  • But then what?

    しかし、その後、何?

  • There isn't another full pair of people in the room,

    別の完全ではありません 部屋の中の人のペア、

  • so line two no longer applies.

    そうライン2は適用されなくなりました。

  • And so by this algorithm's end, n is still 2 which isn't correct.

    だから、このアルゴリズムの終わりまでに、 nが正しくありませんこれはまだ2である。

  • Indeed this algorithm's said to be buggy because it has a mistake.

    実際、このアルゴリズムのはに言った それは間違いがあるため、バグが。

  • >> Let's redress with some new pseudocode code.

    >> いくつかにレッツ救済 新しい擬似コードコード。

  • Let n equal 0.

    をn 0に等しい。

  • For each pair of people in room, set N equal to n plus 2.

    中の人の各ペアについて 部屋に等しいN +2 Nを設定してください。

  • If one person remains unpaired, set N equal to n plus 1.

    一人が対になっていないままである場合、 1からnプラスとNが等しくなるように設定。

  • To solve this particular problem, we've introduced in line four a condition,

    この特定の問題を解決するために、き 直列4条件で導入され、

  • otherwise known as a branch, that only executes

    そうでないとして知られている ブランチ、のみ実行

  • if there's one person we could not pair with another.

    1人があるかどうか、私たち 別のとペアリングできませんでした。

  • And so now, whether there's one, or three,

    それで今、どうか 1、または3があります、

  • or any odd number of people in the room, this algorithm will now count them.

    あるいは部屋の中の人のいずれかの奇数、 このアルゴリズムは、ここでそれらをカウントします。

  • Can we do even better?

    私たちはより良い行うことができますか?

  • Well, we could count in threes, or fours, or even fives and tens,

    さて、私たちは3つずつ数えることができる、 または四つんばい、あるいはファイブと数十、

  • but beyond that, it's going to get a little bit difficult to point.

    それを超えて、それを得るために起こっている ポイントに難しい少し。

  • >> At the end of the day, whether executed by computers or humans,

    >> 一日の終わりには、どうか コンピュータまたは人間によって実行される、

  • algorithms are just a set of instructions

    アルゴリズムはちょうどです 命令のセット

  • with which to solve problems.

    これの問題を解決する。

  • These were just three.

    これらはわずか3だった。

  • What problem would you solve with an algorithm?

    どのような問題、あなたでしょう アルゴリズムで解く?

  • >> DAVID J. MALAN: So deliberately, a very simple program,

    >> DAVID J.マラン:だから意図的に、 非常に簡単なプログラム、

  • a very simple algorithm, for achieving something

    非常に単純なアルゴリズム、 何かを達成するための

  • very simple, counting the number of people in the room.

    非常に単純な、数え 部屋の人数。

  • >> But let's tease apart some of the representative

    >> しかし、ここで離れていじめるしましょう 代表者の一部

  • features here that are actually going to be useful even when

    実際にそのここにあります 場合にも便利になるだろう

  • implementing the most complex of software.

    ほとんどの実装 ソフトウェアの複雑な。

  • So for instance, in this first line, we have what we call the variable,

    だから例えば、この最初の行に、 私たちは、変数と呼んでいるものがあり、

  • and from algebra, you're generally familiar using x and y

    と代数から、あなたがしている 一般的に馴染みのxとyを使用して、

  • and z sometimes, and so forth.

    およびz時には、など。

  • But in programming, variables are still, at the end of the day,

    しかし、プログラミングにおいて、変数 一日の終わりに、まだ、

  • very similar to that.

    と非常に似。

  • But it's perhaps simpler to think of a variable as just a container.

    しかし、それは考えて、おそらく簡単です ちょうどコンテナとして変数の。

  • And, in fact, it's some number of bits implemented somehow in your hard disk

    そして、実際には、いくつかのビット数の あなたのハードディスクに何らかの形で実装さ

  • or in your computer's memory, but more on that in the future.

    または、コンピュータのメモリ内に、 将来的にはその上で、より多くの。

  • It's just a container.

    それはちょうどコンテナです。

  • And if you say something like let n equal 0,

    そして、あなたが何かを言うなら 様ましょnは0に等しい、

  • well that's like calling this glass bowl here n, just an arbitrary name,

    よくそれはこのガラスを呼ぶようなものだ ボウルここでnは、単に任意の名前、

  • and putting nothing in it initially.

    そして、最初はその中に何も入れていない。

  • So the value of this bowl right now is zero.

    この値だから 今のボウルはゼロです。

  • And of course if you perceive in a subsequent line,

    そしてもちろん、あなたが感じる場合は、 その後の行に、

  • to actually increment some line of code, as in this third line here,

    実際にいくつかの行をインクリメントする ここで、この3行目のようなコード、

  • by 1, that's like saying what's the current value of n, it's 0, plus 1,

    1で、それは何と言ってようなものだ n個の電流値は、それが、0、1を加えただ

  • put something like a ping pong ball in here.

    のようなものを置く ここでボールをピンポンピンポン。

  • Now the value of this variable is quite simply 1.

    これの今価値 変数には、非常に単純に1である。

  • And you could very quickly extrapolate, but now it's 2, now it's 3, and so on.

    そして、あなたは非常に迅速に外挿することができ、 今ではのように、今では3ですが、2だ、と。

  • So that's all a variable is.

    だから、すべての変数があるのです。

  • It's a piece of storage to actually store some data.

    これは、ストレージの一部だ 実際にいくつかのデータを格納します。

  • For now it's a ping pong ball.

    今のところそれはピンポン玉だ。

  • There it's a number.

    があり、それは数だ。

  • But it could be words in a dictionary, like the spell checker

    しかし、それは内の単語かもしれない スペルチェッカーのような辞書、

  • I alluded to on Wednesday for one of last year's problem sets.

    私はのために水曜日に示唆した 昨年の問題セットのいずれか。

  • >> Now another key idea, that similarly is pretty intuitive I would claim,

    >> 今別のキーアイデア、同様にその 、私が主張するだろう、かなり直感的です

  • is that of a loop.

    ループのものである。

  • And the loop in the process of counting everyone

    その過程でループ 皆を数える

  • is, of course, doing the same thing again and again-- either one

    もちろん、同じことをしている 再び実物とagain--いずれか1

  • at a time or two at a time.

    当時の時刻または2で。

  • And you can express this in English, or pseudocode code, in any number of ways,

    そして、あなたは英語でこれを表現するか、することができます 擬似コードコード、任意の数の方法で、

  • but using this preposition "for" is a very common way of doing that.

    しかし」を「この前置詞を使用した それを行うのは非常に一般的な方法です。

  • For each person in the room, do this.

    部屋に一人一人のために、これを行う。

  • Again and again.

    何度も何度も。

  • And the fact that it's indented, line three,

    そして、実際にはそれがだと インデント、行3、

  • just means that what you're supposed to do

    ただ何をすることを意味 あなたが行うことになっている

  • is the stuff that's indented below the line two itself.

    インデントのものがある ライン2自体を以下。

  • Just a human convention, but a common one

    ちょうど人間の慣習、 しかし一般的なもの

  • as we'll see in actual higher level programming languages.

    私たちは、実際より高いに表示されますように レベルプログラミング言語。

  • >> Now little more interesting is when you get in a corner case.

    >> さて、もう少し面白いです あなたはコーナーケースで取得するとき。

  • For instance, a corner case was when there

    例えば、コーナー ケースがあった場合はそこに

  • were three people, or five, or seven, or any odd number of people in the room,

    三人、または5、または7であった、 あるいは部屋の中の人のいずれかの奇数、

  • because doing that by twos brakes eventually because your going

    補数ブレーキによってそれを行う理由 最終的にはあなたが行くので、

  • to miss someone, either at the very beginning or the very end

    のいずれかで、誰かを欠場する 非常に最初または最後の最後

  • depending on how you do it.

    あなたがそれを行う方法に応じて。

  • And so, now, I have this branch, or condition, if one person remains,

    だから、今、私はこの分岐を有していて、または 条件、一人が残っている場合、

  • then go ahead and handle that one lonesome person who didn't get

    先に行くと、そのいずれかを取り扱う 取得していない寂しい人

  • paired with someone else.

    誰か他の人とペアに。

  • So that's what we would call a condition, or a branch.

    だから、私たちが呼ぶものだ 条件、またはブランチ。

  • >> Now pseudocode code more generally can be

    >> 今擬似コードコード より一般的にすることができ

  • written to solve any number of problems.

    問題は、任意の数を解決するために書かれた。

  • And what I thought we'd do here is take a moment

    そして、私たちは何をしようと思いました ここで行う時間を割いている

  • to invite shall we say CS50's own Rob Bowden on stage

    招待し、私たちは、CS50年代言わなければならない ステージ上で自身のロブ·ボーデン

  • to be joined by two volunteers, who have no idea what awaits.

    2人のボランティアが参加するためには、 誰が待っていますか全くわかりません。

  • A hand went down as soon as I said that.

    私はそれを言ったように、手とすぐにダウンしました。

  • How about you on the end here, come on up.

    あなたはどう上 アップ時に来て、ここで終わり。

  • And how about from farther away, how about way in the back.

    そして、どのように遠くから約 離れて、どのように後ろに道に関する。

  • Back row, come on up with your hands up.

    後列は、あなたの手を上にしてまで来る。

  • Alright, and what's your name?

    さてさて、あなたの名前は何ですか?

  • >> ANITA: Anita.

    >> ANITA:アニタ。

  • >> DAVID J. MALAN: Anita.

    >> DAVID J.マラン:アニータ。

  • Okay, nice to meet you.

    さて、はじめまして。

  • Let me introduce you to Rob Bowden.

    私はロブボーデンをご紹介しましょう​​。

  • This is Anita.

    これはアニタです。

  • And what is your name?

    そして、あなたの名前は何ですか?

  • >> KIERSTEN: Kiersten

    >> KIERSTEN:Kiersten

  • >> DAVID J. MALAN: Kiersten.

    >> DAVID J.マラン:Kiersten。

  • Kiersten, come on up and meet Rob Bowden and Anita.

    Kierstenは、アップ時に来て、 ロブボーデンとアニタを満たしています。

  • Nice to meet you.

    よろしくね。

  • KIERSTEN: Nice to meet you.

    KIERSTEN:はじめまして。

  • DAVID J. MALAN: Alright, Rob.

    DAVID J.マラン:さてさて、ロブ。

  • ROB BOWDEN: Nice to meet you.

    ROBボーデン:はじめまして。

  • DAVID J. MALAN: Anita.

    DAVID J.マラン:アニータ。

  • KIERSTEN: Hi Anita.

    KIERSTEN:こんにちはアニタ。

  • DAVID J. MALAN: And your several hundred classmates.

    DAVID J.マラン:あなた 数百のクラスメート。

  • So, now let me go ahead and pull up just a simple program here

    だから、今私が先に行くとプルましょう ここだけの簡単なプログラムアップ

  • on Mac OS that'll let me actually jot some notes down.

    Mac OSでは、それは私をもらおう 実際にいくつかのメモを書き留める。

  • And if you guys want to each take a position at one of those schools there,

    そして、皆さんがそれぞれにしたい場合取る そこにこれらの学校の一つの位置、

  • let me go ahead and starts a list of pseudocode code, if you will.

    私が先に行くとリストを開始しましょう 可能ならば、擬似コードのコード。

  • And what I want to do here, ultimately is type for you

    そして、私はここに何をしたいのか、 最終的にあなたのためのタイプです

  • some instructions that our audience members are actually

    その私たちのいくつかの命令 聴衆のメンバーが実際に

  • going to recite for us.

    私たちのために暗唱する予定。

  • Let me go ahead and just change this to a numbered list

    私は先にだけ行ってみよう 番号付きリストに変更する

  • to match what we were doing up there.

    私たちはそこに何をしていたかにマッチする。

  • And what I'm going to do with your help, is write a program

    そして、私はをどうするつもりだ何を あなたの助けは、プログラムを書くです

  • in pseudocode, with which these guys are going

    擬似コードでは、これと これらの人は行く

  • to implement a peanut butter and jelly sandwich.

    ピーナッツを実装する バターとゼリーのサンドイッチ。

  • So it's perhaps apropos to show something some of you

    だから、おそらくaproposのです あなた方のうちの何人か何かを表示

  • might have seen on the internet for just a brief annoying moment.

    インターネット上で見ているかもしれません ただ簡単に迷惑な一瞬。

  • >> [MUSIC BUCKEWHEAT BOYS, "PEANUT BUTTER JELLY TIME"]

    >> [MUSIC BUCKEWHEAT·ボーイズ、「ピーナッツバター  JELLY TIME "]

  • DAVID J. MALAN: OK.

    DAVID J.マラン:わかりました。

  • That's enough of that.

    それはそれの十分です。

  • So here meanwhile, I have a pair of Google Glasses which

    だからここその間、私が持っている グーグル眼鏡れる

  • we'll put on CS50's own Rob Bowden to see the world through his eyes.

    私たちはCS50自身のロブ·ボーデンに出してあげる 彼の目を通して世界を見ることができます。

  • And we'll do our best in post production to actually weave

    そして、私たちはポストに最善を尽くします 実際に織るために生産

  • the footage of what Rob is seeing now, into this actual lecture

    ロブが見ているものの映像 今、この実際の講義に

  • video with our two volunteers beside him.

    両国でビデオ 彼の横にボランティア。

  • So what I'm going to do is, I'll be the typist.

    だから、私はするつもりです ですが、私はタイピストになるでしょう。

  • We have the goal here of actually writing a program

    私たちはここの目標を持っている 実際にプログラムを書く

  • with which to make, ultimately, a peanut butter and jelly sandwich,

    これでできるようにするには、最終的には、 ピーナッツバターとジャムのサンドイッチ、

  • but these three are going to behave as though they are computers.

    これらの3つが動作するようにしようとしている 彼らはコンピュータであるかのように。

  • And computers, at the end of the day, are actually pretty dumb devices.

    そして、一日の終わりにコンピュータ、、 実際にはかなりダムデバイスです。

  • They're super fast, but they can only do, literally, what they are told.

    彼らは超高速だが、彼らは唯一の缶 行うには、文字通り、彼らは何と言われている。

  • You can't just say make a peanut butter and jelly sandwich.

    あなただけのピーナッツをすると言うことはできません バターとゼリーのサンドイッチ。

  • You have to program them to do that.

    あなたはそれを行うためにそれらをプログラムする必要があります。

  • You have to tell them with precision what to do,

    あなたはそれらを指示する必要があります 精度で何をすべきか、

  • less things go horribly and, hopefully, amusingly awry.

    あまり物事が恐ろしく行くと、 うまくいけば、面白おかしくゆがんで。

  • >> So with that said, we need one call-out from the audience

    >> そうは言ってそう、私たちは必要 聴衆からのコールアウト

  • for what should step one be, if the goal here

    ステップべきもののために 1としては、ここでの目標は、if

  • is to make a peanut butter and jelly sandwich.

    ピーナッツを作ることです バターとゼリーのサンドイッチ。

  • Yes?

    はい?

  • >> AUDIENCE: [INAUDIBLE] the bag of bread.

    >> 聴衆:パンの[聞き取れない]のバッグ。

  • DAVID J. MALAN: Open the bag of bread.

    DAVID J.マラン:パンの袋を開きます。

  • So if the three contestants would like to proceed to do that literally.

    3競技者がもしそう 文字通りそれを行うに進みたい。

  • Open the bag of bread.

    パンの袋を開け。

  • >> [AUDIENCE LAUGHING]

    >> [聴衆は笑い]

  • DAVID J. MALAN: So let's work on that.

    DAVID J.マラン:それでは、そのようになったはずです。

  • All right.

    かしこまりました。

  • So step two, how-- let's take this further.

    だから、2ステップ、how-- それではこれをさらにましょう。

  • Yeah, in the front.

    うん、前で。

  • >> AUDIENCE: [INAUDIBLE] the bread.

    >> 聴衆:[聞こえない]パン。

  • >> DAVID J. MALAN: What's that?

    >> DAVID J.マラン:それは何ですか?

  • >> AUDIENCE:Remove the bread.

    >> 聴衆:パンを削除してください。

  • DAVID J. MALAN: Remove the bread.

    DAVID J.マラン:パンを削除してください。

  • Similarly succinct.

    同様に簡潔。

  • Thank you.

    ありがとう。

  • >> [APPLAUSE]

    >> [拍手]

  • DAVID J. MALAN: That's it?

    DAVID J.マラン:それは?

  • OK, so step two is going to be remove the bread.

    [OK]を、ので、ステップ2が起こっている パンを削除することができます。

  • Alright, someone want to write us a longer sentence?

    さてさて、誰かがしたい 私たちに長い文章を書くのか?

  • Someone else?

    他の誰か?

  • A little more [INAUDIBLE].

    もう少し[聞き取れない]。

  • No, nothing now.

    いや、今は何も。

  • Yes?

    はい?

  • >> AUDIENCE: Place two slices next to each other.

    >> 聴衆:場所2 隣同士にスライス。

  • >> DAVID J. MALAN: Place two slices next to each other.

    >> DAVID J.マラン:場所2 隣同士にスライス。

  • >> [AUDIENCE LAUGHING]

    >> [聴衆は笑い]

  • >> DAVID J. MALAN: Place two slices next to each other.

    >> DAVID J.マラン:場所2 隣同士にスライス。

  • Step four.

    ステップ4。

  • Yes?

    はい?

  • >> AUDIENCE: Take your hand and set it lightly

    >> 聴衆:あなたを取る 手は軽くそれを設定

  • on top of the peanut butter lid.

    ピーナッツバターのふたの上に。

  • >> [AUDIENCE LAUGHING]

    >> [聴衆は笑い]

  • AUDIENCE: [INAUDIBLE] next to the peanut butter.

    聴衆:[聞き取れない] ピーナッツバターの隣にあります。

  • DAVID J. MALAN: What?

    DAVID J.マラン:何?

  • Say that again.

    もう一度言う。

  • >> AUDIENCE: Unscrew the lid and put it gently next to the peanut butter.

    >> 聴衆:ふたを外し、置く それピーナッツバターの隣にそっと。

  • >> DAVID J. MALAN: Put it gently next to the peanut butter.

    >> DAVID J.マラン:そっと置く ピーナッツバターの隣にあります。

  • OK, progress.

    [OK]を、進歩。

  • Step five.

    ステップ5。

  • Excellent.

    優秀。

  • Yes?

    はい?

  • >> Pick up knife.

    >> ナイフを拾う。

  • DAVID J. MALAN: Pick up knife.

    DAVID J.マラン:ナイフを拾う。

  • OK, step six.

    [OK]を、ステップ6。

  • Yeah?

    うん?

  • >> AUDIENCE: Hold knife by the handle.

    >> 聴衆:ハンドルナイフを持ってください。

  • DAVID J. MALAN: Hold knife by the handle.

    DAVID J.マラン:ホールド ハンドルによるナイフ。

  • Hold knife by the handle.

    ハンドルでナイフを持ってください。

  • Step seven.

    ステップ7。

  • Yes?

    はい?

  • >> AUDIENCE: [INAUDIBLE] knife in peanut butter and as little out [INAUDIBLE].

    >> 聴衆:ピーナッツ中[聞き取れない]ナイフ バターとわずかアウト[聞き取れない]。

  • >> DAVID J. MALAN: Put knife in-- I heard "put knife in peanut butter

    >> DAVID J.マラン:私in--ナイフを入れて 「ピーナッツバターにナイフを入れて聞いた

  • and take as little out as possible."

    そしてできるだけを取り出します。 "

  • By the way, remove the paper first.

    ちなみに、最初の用紙を取り除きます。

  • All right, step nine.

    すべての権利、ステップ9。

  • Step nine.

    ステップ9。

  • Step nine.

    ステップ9。

  • We haven't actually made a sandwich yet.

    私たちは、実際にはまだサンドイッチを行っていない。

  • Yes?

    はい?

  • AUDIENCE: Using knife in peanut butter, apply peanut butter on said bread.

    聴衆:ピーナッツバターナイフを使用して、 言ったパ​​ンにピーナッツバターを適用します。

  • >> DAVID J. MALAN: Using knife in peanut butter, apply peanut butter on

    >> DAVID J.マラン:ナイフの使い方 ピーナッツバターは、上にピーナッツバターを適用

  • said bread.

    パンは言った。

  • >> [AUDIENCE LAUGHING]

    >> [聴衆は笑い]

  • DAVID J. MALAN: All right step 10.

    DAVID J.マラン:すべての権利のステップ10。

  • Step 10.

    ステップ10。

  • Yes?

    はい?

  • >> AUDIENCE: Taste peanut butter to ensure quality.

    >> 聴衆:味ピーナッツ バターは、品質を確保する。

  • >> [AUDIENCE LAUGHING]

    >> [聴衆は笑い]

  • DAVID J. MALAN: Step 11.

    DAVID J.マラン:ステップ11。

  • Step 11.

    ステップ11。

  • Step 11.

    ステップ11。

  • Come on.

    さあ。

  • Yeah?

    うん?

  • Right there.

    すぐそこ。

  • >> AUDIENCE: Carefully pick up jelly.

    >> 聴衆:慎重にゼリーを拾う。

  • >> DAVID J. MALAN: Carefully pick up jelly.

    >> DAVID J.マラン:慎重にゼリーを拾う。

  • OK, and then another hand was up.

    [OK]をクリックして、別の手がアップした。

  • Right behind you.

    あなたの後ろに右。

  • Yeah, in blue.

    うん、青。

  • >> AUDIENCE: All right, remove lid from [INAUDIBLE], yeah,

    >> 聴衆:すべての権利、削除 [聞き取れない]から蓋、ええ、

  • remove lid from the jelly.

    ゼリーから蓋を取り外します。

  • >> [AUDIENCE LAUGHING]

    >> [聴衆は笑い]

  • >> DAVID J. MALAN: From jelly.

    >> DAVID J.マラン:ゼリーから。

  • Ha ha.

    ハハ。

  • >> [AUDIENCE LAUGHING]

    >> [聴衆は笑い]

  • DAVID J. MALAN: And?

    DAVID J.マラン:そして?

  • AUDIENCE: And barely sweep any [INAUDIBLE].

    聴衆:そしてやっと いずれかの[聞き取れない]スイープ。

  • [AUDIENCE LAUGHING]

    [聴衆は笑い]

  • AUDIENCE: Of course, before [INAUDIBLE], remove the paper from jelly.

    聴衆:もちろん、[聞こえない]の前に、 ゼリーから用紙を取り除いてください。

  • DAVID J. MALAN: Remove paper from jelly.

    DAVID J.マラン:ゼリーから用紙を取り除きます。

  • Step 14.

    ステップ14。

  • We're almost there.

    私たちはほとんどがしています。

  • Yes?

    はい?

  • >> AUDIENCE: Invert jelly bottle before everything falls out.

    >> 聴衆:反転ゼリーボトル すべてが抜ける前に。

  • >> DAVID J. MALAN: Invert jelly bottle before jelly falls out.

    >> DAVID J.マラン:反転ゼリー ゼリーの前にボトルが脱落。

  • Step 15.

    ステップ15。

  • >> AUDIENCE: Replace the cap.

    >> 聴衆:キャップを交換してください。

  • >> DAVID J. MALAN: Replace the cap.

    >> DAVID J.マラン:キャップを交換してください。

  • Step 16.

    ステップ16。

  • Yeah?

    うん?

  • >> AUDIENCE: [INAUDIBLE]

    >> 聴衆:[聞き取れない]

  • DAVID J. MALAN: Say that again.

    DAVID J.マランは:もう一度言う。

  • AUDIENCE: Take cap off of your jelly.

    聴衆:あなたのゼリーのオフにキャップを取る。

  • DAVID J. MALAN: Off your jelly.

    DAVID J.マラン:あなたのゼリーオフ。

  • So really-- Oops.

    だからおっとreally--。

  • Come on.

    さあ。

  • Replace the cap.

    キャップを交換してください。

  • Put cap-- You said remove cap from jelly.

    あなたが言ったcap--入れ ゼリーからキャップを取り外します。

  • Feel like we're in a bit of a loop.

    私たちは、ループのビットにいるように感じる。

  • Step 17.

    ステップ17。

  • Yes?

    はい?

  • >> AUDIENCE: [INAUDIBLE]

    >> 聴衆:[聞き取れない]

  • DAVID J. MALAN: Say that again.

    DAVID J.マランは:もう一度言う。

  • AUDIENCE: [INAUDIBLE]

    聴衆:[聞き取れない]

  • DAVID J. MALAN: Go back to step--

    DAVID J.マランは:step--に戻る

  • AUDIENCE: [INAUDIBLE]

    聴衆:[聞き取れない]

  • DAVID J. MALAN: Remove cap from peanut butter.

    DAVID J.マラン:取り外し ピーナッツバターからキャップ。

  • Yes?

    はい?

  • >> AUDIENCE: Drop all the jelly on the bread.

    >> 聴衆:すべてのドロップ パン上のゼリー。

  • >> DAVID J. MALAN: Drop all the jelly on the bread.

    >> DAVID J.マラン:ドロップすべて パン上のゼリー。

  • DAVID J. MALAN: We're almost there.

    DAVID J.マラン:私たちはほとんどがしています。

  • Step 19.

    ステップ19。

  • >> AUDIENCE: Remove excess jelly.

    >> 聴衆:過剰ゼリーを削除してください。

  • >> DAVID J. MALAN: Haha, jelly.

    >> DAVID J.マラン:ハハ、ゼリー。

  • >> [APPLAUSE]

    >> [拍手]

  • DAVID J. MALAN: Why don't we-- one more step to take this home.

    DAVID J.マラン:なぜwe--はありません この家を取るために一歩。

  • One more step and then we'll serve sandwiches.

    もう一段階、その後 私たちはサンドイッチを提供します。

  • Yes?

    はい?

  • >> AUDIENCE: [INAUDIBLE]

    >> 聴衆:[聞き取れない]

  • >> DAVID J. MALAN: While any sandwich remains-- let's indent this-- eat.

    >> DAVID J.マラン:どんなサンドイッチながら 食べt​​his-- remains--レッツインデント。

  • >> [AUDIENCE LAUGHTER]

    >> [観客の笑い]

  • >> DAVID J. MALAN: All right, thank you to our volunteers here.

    >> DAVID J.マラン:すべての権利、ありがとうございました ここに私たちのボランティアにお。

  • >> [APPLAUSE}

    >> [拍手}

  • >> DAVID J. MALAN: We have some nice parting gifts for each of you.

    >> DAVID J.マラン:私たちはいくつかの素晴らしいを持っている あなたのそれぞれにプレゼントを別れ。

  • Your own peanut butter, jelly, and bread to bring back home.

    あなた自身のピーナッツバター、ゼリー、 そして家に持ち帰るためにパン。

  • Thank you.

    ありがとう。

  • >> KIERSTEN: Thank you.

    >> KIERSTEN:ありがとうございます。

  • DAVID J. MALAN: [INAUDIBLE] welcome.

    DAVID J.マラン:[聞こえない]歓迎します。

  • [APPLAUSE]

    [拍手]

  • DAVID J. MALAN: So, this is, of course, a ridiculous example.

    DAVID J.マラン:だから、これは、の もちろん、とんでもない例。

  • Right?

    右?

  • But it does kind of reveal how we humans just take clarity for granted.

    しかし、それは一種のどのように明らかにしない 人間はただ当たり前の明瞭さを取る。

  • And the fact I've been talking to another human,

    そして、実際には、私がしてきた 別の人間に話して、

  • he or she just knows what you mean.

    彼または彼女はちょうどあなたが何を意味するか知っています。

  • >> Computers are not going to know what you mean,

    >> コンピュータが進んでいない あなたが何を意味するか知っている、

  • even when using, as we're about to do today,

    として使用した場合であっても 今日は何しようとしている、

  • programming something in Scratch, a drag and drop, puzzle piece style language.

    スクラッチで何かをプログラムにドラッグ と、パズルピーススタイル言語をドロップします。

  • Even designed for young children, you have

    でも、若いのために設計され 子どもたちは、あなたが持っている

  • to be so explicit and so literal with what you want your program to do.

    とても明示的およびにとてもリテラルであることが あなたがあなたのプログラムが何をしたい。

  • Now ultimately, we're going to be programming

    さて、最終的に、私たちはしている プログラミングをする予定

  • not in pseudocode code, English like syntax,

    しない擬似コードコード内の、 構文のような英語、

  • but code or, more properly, source code.

    しかし、コードまたは、より適切に、ソースコード。

  • Source code is just the fancy way for describing code you actually

    ソースコードは変わった方法である あなたが実際にコードを記述するための

  • write with a keyboard that's not in English per se.

    のキーボードで書く ていない英語のそれ自体において。

  • It's in C or Java or C++ or something like that, as we'll soon see.

    これは、CやJavaやC + +や何かだ そのように、私たちはすぐに表示されますように。

  • >> And in fact, just to scare a few of you, at first glance,

    >> そして実際には、単に怖がらせるために 一見、あなたのいくつかの、

  • this is a program written in a language called C. But to un-scare a few of you,

    これは言語で記述されたプログラムである C.しかし、あなたのいくつかの非怖がらせるために呼ばれ、

  • you will completely understand what's going

    あなたが完全になります 何が起こっているかを理解する

  • on come next Monday when it comes to something like this.

    来る次の月曜日上のときにそれを このようなものになる。

  • Frankly, this is an older language.

    率直に言って、これは古い言語です。

  • It's fairly arcane, but it's representative

    これはかなり難解ですが、 それが代表だ

  • of a lot of languages these days that have lots of parentheses and curly

    これらの日多くの言語のこと 括弧と中括弧がたくさんある

  • braces and quote marks and semicolons.

    ブレースと引用符とセミコロン。

  • And a lot of this syntactic stuff that is not

    そして、このたくさんの ではない統語もの

  • at all intellectually interesting.

    すべての知的面白いで。

  • Indeed, it's an utter distraction from the very simple ideas

    確かに、それは全くの気晴らしだ 非常にシンプルなアイデアから

  • that are staring us in the face.

    それは顔で私たちを見つめている。

  • This program, as you might just guess, prints to someone's computer screen

    このプログラム、あなただけの想像のように、 誰かのコンピュータ画面に出力し

  • the words "Hello comma world."

    言葉「こんにちはコンマの世界。 "

  • That's it.

    それだけです。

  • So clearly, there's a lot of stuff that's

    だから、明らかに、あります だ多くのもの

  • getting in the way of some obviousness there,

    の邪魔になって そこにいくつかの自明性、

  • but it's going to very quickly slip away and be completely intuitive.

    それは非常に迅速に滑るために起こっている 離れて、完全に直感的であること。

  • >> Indeed, what we're going to do today is distill this fairly complex

    >> 確かに、私たちがやろうとしている 今日、これはかなり複雑な蒸留されている

  • looking program, which again you'll come to understand quickly, but to something

    もう一度あなたが来る見てプログラム、 すぐに理解することが、何かに

  • much simpler.

    はるかに簡単。

  • Let's just say what we mean.

    ちょうど私たちが何を意味するか言ってみましょう。

  • Let's draw a picture of what we mean, by way of these puzzle pieces here.

    それでは私たちが何を意味するかの絵を描いてみ、 ここでは、これらのパズルのピースを経由して。

  • >> So this is a programming language known as Scratch.

    >> だから、これはプログラミングです スクラッチとして知られている言語。

  • It was developed by MIT's Media Lab.

    それは、MITのメディアラボで開発されました。

  • And what you'll see in problem set zero, which will be released later tonight,

    そして、あなたが問題に表示されます何が、ゼロに設定 これは、後で今夜発表される

  • we'll have you go to this URL here scratch.mit.edu.

    私たちは、あなたがこのに行く必要があります ここscratch.mit.edu URL。

  • And they have a web based interface via which

    そして、彼らはウェブを持っている 経由ベースのインターフェイス

  • you will write your first program.

    あなたの最初のプログラムを書きます。

  • Or those of you with prior experience, your second programs,

    またはその前であなたのそれらの 経験、2番目のプログラム、

  • but in an environment that's probably a little unfamiliar and that

    しかしだ環境で、 おそらく少し不慣れとその

  • will push you to create something using this very visual environment.

    何かを作成することをプッシュします この非常にビジュアル環境を使用して。

  • >> Now, what I'm going to do here is open up the program itself.

    >> 今、私はここでやろうとしているもの プログラム自体を開いている。

  • It exists not only as a web browser, but also as a downloadable program

    これは、Webブラウザとしてだけでなく、存在している、 だけでなく、ダウンロード可能なプログラムとして

  • so that you can actually use it if you don't have internet access.

    あなたが実際にそれを使用できるように、 あなたはインターネット回線を持っていない場合。

  • And I'm going to do that in here, in Sanders, just

    そして、私はそれをするつもりだ ここにおいて、サンダースは、ちょうど

  • in case the Wi-Fi doesn't cooperate super well.

    場合には、Wi-Fiがない スーパーうまく協力する。

  • And what I'm going to do is point out a few features of this program.

    そして、私がやろうとしてたんだけどポイントです このプログラムのいくつかの機能が不足しています。

  • So, to be clear, I have just double clicked the icon on my desktop,

    だから、明確にするために、私はちょうど二重持っている 私のデスクトップ上のアイコンをクリックし、

  • or equivalently gone to scratch.mit.edu, and it's pulled up this window.

    または同等に、scratch.mit.eduに行って そしてそれはこのウィンドウをプルアップだ。

  • This is a programming environment.

    これは、プログラミング環境です。

  • It's a piece of software that some of our friends at MIT

    それは、そのソフトウェアの一部です MITの私たちの友人の何人か

  • wrote that let's us and you write programs in a language called Scratch.

    みましょう、私たちとあなたが書くことを書きました スクラッチと呼ばれる言語でプログラム。

  • >> Now this happens to be a cat who's also named Scratch

    >> さて、これはあることを起こる また、スクラッチという名前の猫

  • and this is his world in which he lives.

    これは彼が住んでいる彼の世界である。

  • This is the stage, so to speak, that rectangle on the top left hand corner.

    これはステージであり、いわば、その 左上隅に四角形。

  • And he doesn't have to look like a cat.

    そして、彼は猫のように見える必要はありません。

  • You can make him look like anything and you

    あなたは彼が見えるようにすることができます 何でも、あなたのような

  • can have many such sprites, or characters, in a program.

    このような多くのスプライトを持つことができ、 またはプログラム内の文字、。

  • Meanwhile, over here on the far right, is a big blank slate.

    一方、こっち遠い上 右、大きな白紙状態である。

  • And this is where, in a moment, we are going to start programming

    そして、これは、瞬間に、どこにあるの 私たちはプログラミングを開始しようとしている

  • by dragging and dropping these graphical puzzle

    ドラッグ&ドロップによる これらのグラフィカルなパズル

  • pieces that are right here in the middle.

    正しいピース ここに真ん中に。

  • And there's way more of them than we'll spend time on here in class

    そして、より彼らのやり方それだけではありません ここではクラス内に時間を費やす

  • because you'll find that they're all fairly intuitive.

    あなたはそれを見つけることができますので、 それらはすべて、かなり直感的だ。

  • Again, it's designed for children, but we

    ここでも、設計されています 子どもたちが、私たちのために

  • use it to tease apart some of those fundamental ideas of variables, loops,

    それらのいくつかを離れていじめるためにそれを使用 変数、ループの基本的なアイデア、

  • conditions, and, soon, things like functions and events

    条件、および、すぐに、物事 関数とイベントのような

  • and threads and other fancy things we'll get to before long to actually create

    スレッド、私たちはよ、他の空想のもの 実際に作成する前に長いに行く

  • something from Scratch.

    スクラッチから何か。

  • Pun intended.

    しゃれが意図した。

  • >> Now, what I'm going to do here is click on not motion, but control.

    >> 今、私はここで行うつもりだことはある しない運動が、コントロールをクリックしてください。

  • And this is just a categorization of here--

    そして、これはただである here--の分類

  • and I see a different color set of blocks.

    と私は別のを参照してください ブロックで設定した色。

  • But notice a few familiar words.

    しかし、いくつかおなじみの言葉に注目してください。

  • "If" and "else if" and "repeat."

    そして「もし、他の ""もし "と"リピート "

  • And you can probably guess that's reminiscent of the branch,

    そして、あなたはおそらく推測することができます それは、ブランチを彷彿とさせるだ

  • or the conditions we saw, and even the looping construct.

    または私達が見た状況、 でも、ループ構造。

  • So we have similar blocks here.

    そこで、ここでは同じようなブロックを持っています。

  • But the most interesting one is this one here.

    しかし、最も興味深いの 1は、ここで、この一つです。

  • When this green flag is clicked, this, for those with prior programing

    このグリーンフラッグがクリックされると、 この前プログラミングとのそれらのため

  • experience, is equivalent to a main function.

    経験は、等価です 主な機能に。

  • But for those unfamiliar, this is the puzzle piece

    しかし、慣れていない人のために、 これは、パズルのピースである

  • that will kick start our entire program.

    それは私達の全体のプログラムを起動キックされます。

  • It literally means when I go, in this program, and click a green flag--

    私が行くときには、文字通り、この中で、意味 プログラム、グリーンflag--をクリックします

  • which you can see up here in the top left hand corner of the UI,

    あなたがここまで見ることができる UIの左上隅、

  • so see the green flag next to the red stop sign?

    そうグリーンフラッグを参照してください 赤いストップサインの横に?

  • When I click that, my program is going to run.

    私はそれをクリックすると、私の プログラムを実行しようとしている。

  • Now, I'm going to do something super simple with Scratch.

    今、私は何かをするつもりだ スクラッチで超簡単。

  • I'm going to go ahead and go to the looks panel

    私が先に行くつもりです そしてルックスパネルに移動

  • here, where I have a bunch of purple puzzle pieces,

    ここで、私が抱えている場合、 紫色のパズルのピースの、

  • and I'm going to go ahead and do something super simple like, say.

    と私は先に行くとするつもりです 何かが超簡単のように、言う。

  • And then-- notice this text in the white box

    そして、これに気付くthen-- 白いボックス内のテキスト

  • is editable-- I'm going to say "Hello world," just like we

    私が言うつもりeditable--です ちょうど私達のような「こんにちは、」

  • did in that textual version a moment ago.

    そのテキストの中でやった 先ほどバージョン。

  • And now if I go and click this green flag, I have now programmed.

    そして今、私は行くと、これをクリックすると グリーンフラッグ、私は今プログラムした。

  • It's not a particularly interesting program,

    それは特にありません 興味深いプログラム、

  • but I made the computer do something.

    しかし、私は、コンピュータが何かを作った。

  • I started a program and it did what I told it to do.

    私がプログラムを開始し、それ 私はそれが何を言ったことでした。

  • Now, I can continue to drag and drop more and more of these puzzle pieces

    今、私はドラッグ&ドロップし続けることができます これらのパズルピースのますます

  • and they're going to interlock, but let's slap some terminology on here

    彼らは連動するつもりが、だ それではここで、いくつかの用語を平手打ちしましょう

  • that we'll see recurring throughout the course,

    私たちは定期的な表示されますことを コー​​スを通して、

  • and really throughout computer science and programming more generally.

    本当にコンピュータサイエンスを通して より一般的にプログラミングする。

  • >> This "say" block, in purple, let's just start calling a statement.

    >> これは、ブロック、紫で、してみましょう」と言う」 ただ文を呼び出しを開始。

  • It's like a statement of fact.

    それは事実の声明のようなものだ。

  • Do this.

    これを行います。

  • So, it's a category of instructions that you

    だから、それはの範疇だ 説明書あなた

  • might feed a computer as part of a program or an algorithm.

    一部としてコンピュータを養うことがあります プログラムまたはアルゴリズム。

  • And to be clear, you've probably taken for granted

    そして、明確にするには、次のようにしました おそらく当たり前の

  • that you have programs on your computer.

    お使いのコンピュータ上のプログラムを持っている。

  • And they're kind of algorithms, but a program is really a bunch of algorithms

    そして、彼らは一種のアルゴリズムのだが、 プログラムは、実際にアルゴリズムの束です

  • that some humans wrote.

    一部の人間が書いた。

  • They packaged it up and they sold it so you,

    彼らはそれをパッケージ化し、 彼らはあなたに、それを販売し、

  • or they posted on a website for you to download.

    またはそれらはウェブサイトに掲載 あなたがダウンロードするため。

  • So, a program is just a whole bunch of zeros and ones

    だから、プログラムはただです 0と1の全体の束

  • that, somehow, humans created.

    それは、どういうわけか、人間が作成しました。

  • And those patterns of zeros and ones represent things, ultimately,

    とゼロのこれらのパターンと ものは、最終的に、物事を表し、

  • like "say hello world" or "play this music" or "play this video"

    「挨拶の世界」や「遊びのような この音楽」や「このビデオを再生する」

  • or "send an email."

    または「Eメールを送信します。 "

  • But we'll come back in way more detail what

    しかし、私たちは中に戻ってくる 道より詳しく何

  • a program is when you, yourself, write them.

    ときにプログラムである、 自分自身、それらを書く。

  • >> Here's another statement-- "Wait for one second."

    >> ここで別のステートメント - です 「1秒間待ってください。 "

  • I didn't use this yet, but if I want my program to pause for a moment

    私はまだこれを使用しませんでしたが、私はしたい場合 一瞬一時停止する私のプログラム

  • to do something, I can tell it to do so.

    何かをする、私はそうするように、それを伝えることができます。

  • Wait one second.

    1秒待ちます。

  • Now another one might be "play sound."

    今、もう一方は "サウンドを再生。」かもしれない

  • So, this is unique to Scratch, it has the ability to play sounds.

    だから、これは、それスクラッチに固有のものである サウンドを再生する能力を持っています。

  • So, a statement I might use is, here, "play sound."

    だから、文は私がかもしれない 使用は「サウンドを再生」、ここでは、ある

  • Meanwhile, Boolean expression, so this is a fancier word

    一方、ブール式、 これは愛好家の言葉です

  • named after just a guy named Mr. Bool, and this is all about a question.

    氏ブールというただの男にちなんで名付けられた、 これは、すべての質問についてです。

  • True or false-- is the mouse down?

    Trueまたはfalse--マウスがダウンしている?

  • A Boolean expression is just some expression in English

    ブール式はただである 英語でいくつかの表現

  • that is either true or false.

    それはtrueまたはfalseのいずれかです。

  • Either on or off.

    オンまたはオフ。

  • Either one or zero.

    1か0のどちらか。

  • You can think of it in any number of ways,

    あなたはそれを考えることができます 任意の数の方法において、

  • but it's either true or this false, ultimately.

    それはどちらか本当だか 最終的には、この誤った。

  • So "mouse down question mark," that would be a Boolean expression.

    だから、「マウスダウン疑問符、 " それはブール式になります。

  • And you can think of others, perhaps.

    そして、あなたはおそらく、他のものと考えることができます。

  • For instance, "is the left number less than the right number?"

    例えば、「左の数である 右の数より少ない? "

  • That, too, would be a Boolean expression.

    それは、あまりにも、となる ブール式。

  • "Less than" is a Boolean expression.

    「より小さい」ブール式です。

  • >> This one, too, "touching mouse pointer."

    >> 「マウスポインタに触れる。 "あまりにもこの1、

  • I'm not sure why they called it mouse pointer.

    私は、なぜ彼らはよく分からない マウスポインタと呼んだ。

  • It just means, is the cursor, is the arrow on the screen, touching the cat,

    それはちょうどで、カーソルがあることを意味 猫に触れると、画面上の矢印、

  • for instance.

    たとえば。

  • Or some other aspect of the screen.

    または画面のいくつかの他の側面。

  • And it's a question, again, and that denotes a Boolean expression.

    そしてそれは、再び、質問だと それはブール式を表す。

  • Something that you might want to use in a condition.

    そのあなたがかもしれない何か 条件で使用したい。

  • So we'll come to that in just a moment.

    だから私たちは一瞬のものに来る。

  • You can "and" things together.

    あなたが一緒にできます "と"もの。

  • So, if you want to check if this is the case AND that is the case,

    だから、あなたはこのかどうかを確認したい場合は ケースであり、そうではあり、

  • you can use an "and" block like this.

    あなたはこのような "と"ブロックを使用することができます。

  • And here's that condition.

    そして、ここでその条件です。

  • Notice the shape of the little opening in the top of this yellow puzzle piece,

    小さな開口部の形状に注目してください この黄色のパズルピースの上部にある、

  • it's reminiscent of the shape that we just saw a moment ago.

    それは、形状を連想させるだ 私たちはちょっと前に見たこと。

  • Each of these Boolean expressions have these pointed edges

    これらのブール式はそれぞれ これらの尖ったエッジを有する

  • on the left and right.

    左右に。

  • And that's because MIT folks decided that by visually conveying shapes,

    MITの人たちが決めたので、それはだ 視覚的な形状を伝えることで、その、

  • you can kind of help people, students and children alike,

    あなたはこの種の人々を助けることができる、 同様に、学生や子供、

  • to kind of fill in the blanks literally.

    種類の文字通り空白を埋めるために。

  • >> Now that puzzle-- that opening is a little small,

    >> 今ではことpuzzle-- 開口部は、少し小さいです

  • and as we'll see in the program, in Scratch, it will grow to fit.

    私たちは、プログラムで表示されますように、 スクラッチでは、フィットするように成長します。

  • It will maintain its shape, ultimately.

    これは、最終的に、その形状を維持する。

  • So a condition let's you decide "should I do something or not?"

    だから、条件はあなたが決めるましょう 「私が何かをするべきではありませんか? "

  • A Boolean expression is the actual question

    論理式 実際の質問です

  • you're using to decide do I go to the left OR do I go to the right

    私はに行くかを決定するために使用している 左または私は右に行くのですか

  • when I encounter this so-called fork in the road?

    私はこれが発生したとき 道路の分岐点、いわゆる?

  • You can have two branches.

    次の2つの支店を持つことができます。

  • IF something is true, do this, else go that way,

    何かが真であれば、何 これは、他には、その道を行く

  • or you can just do nothing at all, as this block implied.

    またはあなただけの時に何もできない すべて、このブロックは、暗黙として。

  • Similarly, we can nest these things.

    同様に、私たちは巣これらのことをすることができます。

  • So if you want to triple fork in the road, either do this or this or that,

    だから、中にフォークを3倍にしたい場合は、 道は、これかこれかそれを行うのどちらか、

  • you can just nest these things together.

    あなただけの巣これらの事を一緒にすることができます。

  • And it starts to get a little ugly, eventually, for sure,

    そして、それは少しを得るために開始します 醜い、最終的には、確かに、

  • but the logic is still the same.

    が、ロジックは同じです。

  • You can literally read this top to bottom

    文字通り読むことができます 下へこのトップ

  • and it says what it means-- if this is true, do this, else if else.

    そしてそれはこの場合means--何と言う trueの場合、これを行うには、他の他の場合。

  • >> A loop doesn't get simpler in Scratch.

    >> ループは、スクラッチが簡単取得していません。

  • Forever do the following.

    フォーエバー次の操作を行います。

  • Now you might not think you can do much because there's not

    今、あなたはあなたを思うない可能性があります そこではないので多くを行うことができます

  • much space between the top and the bottom of this puzzle piece opening.

    トップとの間に多くのスペース このパズルピース開口部の底。

  • But you'll see Scratch is going to grow to fit as many puzzle pieces

    しかし、あなたはスクラッチをしようとしている表示されます などの多くのパズルのピースに合わせて成長する

  • as you want to cram in there.

    あなたはそこに詰め込むしたいよう。

  • Another loop might be expressed with repeats.

    もう一つのループは次のようになります。 リピートで表現。

  • If you know in advance, "I want to do something 10 times,"

    あなたが事前にわかっている場合は、「私 何かを10回やってみたい」

  • you can just tell Scratch to do something 10 times.

    あなただけのスクラッチを伝えることができます 何かを10回行う。

  • And, meanwhile, we can have variables.

    そして、その間、私たちは、変数を持つことができます。

  • So here's an arbitrary one, it's orange in this case,

    だからここに任意のものです、 それは、この場合、オレンジ色の

  • and this is a whirlwind tour.

    これは旋風のツアーです。

  • Again, you'll find this very accessible once you start pointing and clicking.

    繰り返しますが、これは非常にアクセスできます あなたがポイントしクリック起動一回。

  • I've named my variable n, but I could have named it anything I want,

    私は私の変数nと名付けたが、私だ それを私が欲しいものを名付けたかもしれない、

  • and I'm setting it here, in this arbitrary example, to zero.

    と私はで、それをここに設定してい この任意の例はゼロに。

  • >> Now seeing a program like hello world is not all that compelling,

    >> 今ハローのようなプログラムを見て 世界は、すべてのこと説得力はありません

  • so let's actually open up something that a former student made.

    それでは、実際に何かを開いてみましょう 元学生が作った。

  • Let me go ahead and open up, for instance, this one here,

    私が先に行くと開いてみましょう、 例えば、これは、ここで、

  • for which I would love to have a volunteer.

    そのために私は大好きだ ボランティアを持っている。

  • All right, how about-- let's go farther.

    すべての権利、どのようにの遠く行きましょうabout--。

  • Yes, come on up.

    はい、アップ時に来る。

  • What's your name?

    あなたの名前は?

  • >> ABBY: Abby.

    >> ABBY:アビー。

  • DAVID J. MALAN: Abby, come on up.

    DAVID J.マラン:アビーは、アップ時に来る。

  • So have you ever played this game before?

    だから、あなたは今まで演じてきた 前にこのゲーム?

  • ABBY: No.

    ABBY:いいえ

  • DAVID J. MALAN: All right.

    DAVID J.マラン:すべての権利。

  • David, nice to meet you.

    デビッド、はじめまして。

  • Come on over.

    オーバーさあ。

  • And what is your programming background, if any.

    そして、あなたのプログラミングは何ですか 背景があれば。

  • >> ABBY: I've learned some C++.

    >> ABBY:私はいくつかのC + +のことを学びました。

  • DAVID J. MALAN: You've learned some C++.

    DAVID J.マラン:あなたはいくつかのC + +のことを学びました。

  • And what is your game playing background?

    そして、あなたのゲームは何ですか 背景をプレイ?

  • >> ABBY: Not a lot.

    >> ABBY:ないたくさん。

  • DAVID J. MALAN: OK, so we'll take that.

    DAVID J.マラン:OK、私たちはそれを取るよ。

  • So here's how the game is going to work.

    だからここにゲームが動作するように起こっている方法です。

  • I'm going to go ahead and click the green flag, which

    私が先に行くつもりだと これ、グリーンフラッグをクリック

  • is up here at the top right.

    ここで右上のアップです。

  • Now your predecessor in the class has given you some instructions here.

    クラスで今すぐあなたの前任者 ここにあなたにいくつかの指示を与えている。

  • And in just a moment, it says "space to begin."

    そして、ちょうど瞬間に、それを 「スペースを開始します。」と言う

  • So go ahead and hit the spacebar.

    だから先に行くと、スペースキーを押してください。

  • >> COMPUTER GAME: Pikachu.

    >> コンピュータゲーム:ピカチュウ。

  • DAVID J. MALAN: And the goal is to catch the food, as depicted there

    DAVID J.マラン:そして目標は、であることが そこに描かれているように、食べ物をキャッチ

  • on the left.

    左の。

  • And to [INAUDIBLE]

    そして、[聞こえない]へ

  • >> [GAME MUSIC PLAYING]

    >> [ゲーム音楽の再生]

  • >> DAVID J. MALAN: Aww, well, thank you for playing.

    >> DAVID J.マラン:awwは、よく、 演奏していただきありがとうございます。

  • We have here a little parting gift for you.

    ここではほとんどない あなたのための贈り物を別れ。

  • We have CS50 stress ball, if you'd like to choose.

    私たちは、CS50ストレスボールを持っている あなたが選ぶしたい場合。

  • All right, good to meet you.

    良いすべての権利、あなたを満たすことができます。

  • Thank you for coming and challenging.

    来て挑戦していただきありがとうございます。

  • So we have more stress balls, so let's do one more example to motivate.

    だから私たちはそのように、より多くのストレスボールを持っている それではやる気にさせるもう一つの例を実行してみましょう。

  • A volunteer?

    ボランティア?

  • All right, how about right here in front.

    方法についてのすべての権利、 右ここ正面に。

  • What's your name?

    あなたの名前は?

  • >> PHILLIP: Phillip.

    >> PHILLIP:フィリップ。

  • >> DAVID J. MALAN: Phillip.

    >> DAVID J.マラン:フィリップ。

  • Come on up, Phillip.

    、フィリップをご利用下さい。

  • So, Phillip is going to be challenged with another game

    だから、フィリップがあることを行っている 別のゲームでチャレンジ

  • that one of your predecessors wrote as part of problem set zero,

    あなたの前任者の1 問題の一部がゼロに設定され、書いた

  • called Ivy's Hardest Game.

    アイビーの難しいゲームと呼ばれる。

  • And we'll see in just a moment what's meant by this.

    そして、私たちはただで表示されます これで意味ているものの瞬間。

  • Phillip, nice to meet you.

    フィリップ、はじめまして。

  • What is your background?

    あなたの背景は何ですか?

  • PHILLIP: Done a lot of coding.

    PHILLIP:コーディングの多くを完了。

  • Done a little gaming, too.

    あまりにも、ちょっとゲームを完了。

  • >> DAVID J. MALAN: OK.

    >> DAVID J.マラン:わかりました。

  • Got a lot of gaming, too.

    あまりにも、ゲームの多くを得た。

  • And have you played this game before?

    そして、あなたは前に、このゲームをプレイしている?

  • >> PHILLIP: No

    >> PHILLIP:いいえ

  • DAVID J. MALAN: All right, so here we go.

    DAVID J.マラン:すべて 右ので、ここで私達は行く。

  • I'm going to go ahead and click the green flag.

    私が先に行くつもりです と緑の旗をクリックします。

  • >> [GAME MUSIC]

    >> [ゲームミュージック]

  • >> [MUSIC MC HAMMER, "U CAN'T TOUCH THIS"]

    >> [MUSIC MCハマー、「Uはこれを触れることができない "]

  • >> PHILLIP: [INAUDIBLE]

    >> PHILLIP:[聞き取れない]

  • DAVID J. MALAN: [INAUDIBLE]

    DAVID J.マラン:[聞き取れない]

  • PHILLIP: [INAUDIBLE]

    PHILLIP:[聞き取れない]

  • [LAUGHING]

    [笑い]

  • [MUSIC MC HAMMER, "U CAN'T TOUCH THIS"]

    [MUSIC MCハマー、「Uはこれを触れることができない "]

  • DAVID J. MALAN: [INAUDIBLE] Plow through it.

    DAVID J.マラン:[聞き取れない] それを耕す。

  • PHILLIP: [INAUDIBLE]

    PHILLIP:[聞き取れない]

  • DAVID J. MALAN: Go ahead.

    DAVID J.マラン:さあ、どうぞ。

  • [MUSIC MC HAMMER, "U CAN'T TOUCH THIS"]

    [MUSIC MCハマー、「Uはこれを触れることができない "]

  • DAVID J. MALAN: All right.

    DAVID J.マラン:すべての権利。

  • Congratulations.

    おめでとうございます。

  • >> [APPLAUSE]

    >> [拍手]

  • >> DAVID J. MALAN: We will post that online later so

    >> DAVID J.マラン:私たちは意志 ポスト、オンライン後でので、

  • that you can procrastinate with it as well.

    あなたが先延ばしにできること それにも同様。

  • Princeton comes up next, after that.

    プリンストンは、その後、次回来る。

  • >> So now let's actually proceed to start from scratch,

    >> だから今のは、実際に進んでみましょう ゼロからスタートして、

  • so to speak, and actually build up until we can tease apart some of these ideas

    いわば、実際にまで構築 私たちは、これらのアイデアのいくつかを離れていじめることができます

  • and get to something even more complex by the end.

    さらには、何かに到達 年末までに、より複雑。

  • I'm going to go over here and I'm going to go ahead and create a new file.

    私はこちらに行くつもりだと私は行くよ 先に行くと、新しいファイルを作成します。

  • So again, the problem set will walk you through some of these steps.

    だからもう一度、問題セットが歩いていく これらのステップのいくつかを経て、あなた。

  • But, all I did was go to the File menu and I

    しかし、私がしたすべては、外出先であった [ファイル]メニューにと私

  • said "new," so much like Microsoft Word, or any program like that.

    そんなにマイクロソフトのように、「新しい」と述べ Word、またはそのような任意のプログラム。

  • >> And let's go ahead now-- and we implemented "Hello world" a moment ago,

    >> そして、それではnow--先に行かせ、私たち 先ほどの「Hello World」を実施し、

  • but let's do something a little cuter.

    しかしそれでは少し可愛い何かをやらせる。

  • I'm going to go up to events.

    私はイベントにまで行くつもりです。

  • And I'm going to do "when green flag clicked."

    そして、私は時、「するつもりです 緑色のフラグがクリックしました。 "

  • And then I'm going to use, shall we say, a branch.

    そして私は、使用するつもりです 私たちは、枝を言わなければならない。

  • So I'm going to use an "if" condition.

    だから私は「IF」条件を使用するつもりです。

  • And notice how as soon as I get close to it, it wants to snap together.

    そして、どのようにすぐに私は近づくように注意してください それには、一緒にスナップしたいと考えています。

  • So I let go and it snaps together.

    だから私は行かせ、それが一緒にスナップします。

  • And now I can do something interesting.

    そして今、私は面白い何かを行うことができます。

  • If I scroll through here, I'm going to see a whole bunch of blocks.

    私がここをスクロールした場合、私は行くよ ブロックの全体の束を見ることができます。

  • If I go to "data"-- let me zoom in-- there is something about variables.

    私は、「データ」に行けば - 私にズームin--ましょう 変数に関するものがある。

  • If I go to "motion," you can apparently turn things around.

    私はに行くと「動き」のことができます 明らかに事態を好転。

  • If I go to "operators"-- oh, this is interesting,

    私は、「事業者」に行けば - ああ、これは面白いです、

  • I can pick a random number.

    私は、乱数を選ぶことができます。

  • So let me do something with only some probability, just because.

    だから私だけで何かをやらせる ある確率、という理由だけで。

  • I'm going to go ahead and drag this puzzle piece,

    私が先に行くつもりだと このパズルピースをドラッグし、

  • this is that less than block, so it's just

    これ未満である ブロック、それだけですので、

  • "is this number less than that one?"

    「それよりも、この数少ない? "

  • But I don't want a hard code a number because that be pretty pointless.

    しかし、私は、ハードコードの番号を望んでいない そのため、かなり無意味である。

  • So I'm going to drag this piece here, and notice how it snaps in,

    だから私はこの作品をドラッグするつもりです ここで、それが中スナップ様子がわかり、

  • and now let me go ahead and say "if the number that's picked randomly

    そして今私が先に行くとあれば "と言ってみましょう 無作為に選んだの番号

  • is less than six, do the following."

    次の操作を行い、6個未満である。 "

  • Now why less than six?

    さて、なぜ6個未満?

  • What probability is this effectively going to give me, just intuitively?

    これは事実上どのような確率である ただ直感的に、私を与えるつもり?

  • About 50%, right?

    約50%、右か?

  • If the number that's guess randomly between 1 and 10 is less than six,

    それでは、ランダムに推測する番号の場合 1と10との間に、6個未満である

  • clearly it's one, two, three, four, or five.

    明らかにそれは、1つ、2つですが、 3つ、4つまたは5つ。

  • And so that's going to give me a 50% probability of what happening?

    そしてそうそれは私を与えるために起こっている 何が起こって50%の確率?

  • >> Well let's do something like this, "play sound meow."

    >> さてそれではようなことをやらせる これは、「音ニャーを果たしている。 "

  • And notice, again, the puzzle piece grows

    そして、再び、気付く パズルのピースが成長する

  • to fit, so long as the shapes match.

    限り形状が一致するように、フィットする。

  • That's what's important.

    それは重要なものだ。

  • Let me go over to Scratch here and click "play."

    私はスクラッチに引き継が行こう ここと「遊び」をクリックします。

  • Nothing happens.

    何も起こりません。

  • Is that a bug?

    そのバグはありますか?

  • No, not necessary.

    いいえ、必要ありません。

  • It could just be that a bigger number was chosen.

    それはちょうど、そのAかもしれない より大きな数を選択した。

  • So let's do it again.

    それでは、もう一度やってみましょう。

  • Nothing.

    何もない。

  • >> [MEOW]

    >> [MEOW]

  • DAVID J. MALAN: There it is.

    DAVID J.マラン:ありそうである。

  • [MEOW]

    [MEOW]

  • DAVID J. MALAN: Again.

    DAVID J.マラン:アゲイン。

  • No.

    いいえ

  • >> [MEOWING]

    >> [鳴き声]

  • DAVID J. MALAN: So if you've ever played a game, of course,

    DAVID J.マラン:あなたがしたのであれば これまでに、もちろん、ゲームをプレイし

  • where stuff is happening randomly, like the bad guys are coming or not

    ものがランダムに起こっている場合には、 悪者のように来たりしていない

  • coming on to the screen, or things are falling or not falling,

    の画面に来るか、 物事は転倒や落下していない、

  • that's just because something super simple like this is happening.

    それはちょうど何かスーパーためだ このような単純なが起こっている。

  • Pick a random number, and if it's less than some value,

    乱数を選び、そうで それは、いくつかの値未満だ

  • maybe do this or maybe do that.

    多分これを行うか、多分それを行う。

  • We can incorporate that into a condition.

    私たちは、組み込むことができます 条件にその。

  • Let's do something different.

    それでは別の何かをやってみましょう。

  • >> Let me throw that away.

    >> 私はそれを捨てるましょう。

  • You can get rid of stuff by just dragging it off to the left

    次の方法でものを取り除くことができます ちょうど左にそれをドラッグする

  • and letting go.

    そして手放す。

  • Let me go ahead and do a forever block and very quickly do something annoying.

    私が先に行くと永遠にブロックをやってみましょう 非常に迅速に迷惑な何かをする。

  • Let me go ahead and say "play sound meow."

    私は先に行ってみようと 「音ニャーを果たしている。」と言う

  • But I don't want this to be too annoying, so let me grab this block,

    しかし、私は、これはあまりにもなりたくない 迷惑なので、私はこのブロックをつかむしましょう

  • "wait one second," and notice there's no more room for it.

    「1秒待って」と予告 それのためのより多くの部屋はありません。

  • But if you go close enough, it wants to go there.

    しかし、あなたは十分に近い行けば、 それはそこに行きたい。

  • So I let go and it will grow to fill the block.

    だから私は行かせ、それが意志 ブロックを埋めるために成長する。

  • So now, this is a loop.

    だから今、これがループです。

  • [MEOWING]

    [鳴き声]

  • DAVID J. MALAN: I'm literally doing this forever.

    DAVID J.マラン:私は 文字通り永遠にこれを行う。

  • Again and again.

    何度も何度も。

  • That is just not natural sounding.

    それはちょうど自然なではありません。

  • Let me go ahead and change this to not one second, to two seconds

    私が先に行くと、これを変更してみましょう しない1秒、2秒に

  • and hit Enter.

    そしてEnterキーを押します。

  • And what's nice about Scratch is that you could program interactively.

    そして、何スクラッチのいいのはです あなたが対話的にプログラムすることができるよう。

  • Make a change, maybe hit Enter or Play again, and it will just keep going.

    変更を行い、多分入力または再生ヒット 再び、それだけで続けるでしょう。

  • Well, now why don't we do something a little cuter?

    さて、今、なぜ行っておりません ちょっと可愛い何か?

  • Rather than do everything from scratch, let me go ahead and open up an advance

    ゼロからすべてを行うのではなく、 私が先に行くと、事前を開いてみましょう

  • made one, that I pre-baked, called "Pet the Cat."

    、私は焼きたての事前という、ひとつになって 「ペットの猫」と呼ばれる

  • And we'll post all of these files online,

    そして、私たちはすべてを投稿します オンラインこれらのファイル、

  • and problem set zero will tell you how to access them and open them up.

    そして、問題が設定され、ゼロを教えてくれます どのようにそれらにアクセスし、それらを開きます。

  • And notice, this is pretty simple.

    そして、通知は、これは非常に単純です。

  • But in advance, I seem to have grabbed a "forever" block, so I've got a loop.

    しかし、事前に、私がつかんでいるように見える 「永遠に」ブロックが、私はループを持っている。

  • And then I've got an "if" condition.

    そして私は「IF」条件を持っている。

  • I've got a Boolean expression.

    私は、ブール式を持っている。

  • >> So in English, just glancing at this, especially if you've never

    >> 英語のように、ただでかすめる あなたが初めてだない場合は特に、この、

  • programmed before, just intuitively, what is this going to do, this program?

    ただ直感的に、前にプログラムされ、 このやろうとして、このプログラムは何ですか?

  • >> [AUDIENCE CHATTER]

    >> [観客のおしゃべり]

  • >> DAVID J. MALAN: If you pet the cat, the cat is going to meow, right?

    >> DAVID J.マラン:あなたは猫をペットする場合は、 猫は右、ニャーに行くのですか?

  • Because "forever unchecking" is the mouse pointer touching the cat.

    で「永遠にチェックを外す」ため、 マウスポインタが猫に触れる。

  • So to be clear, and I didn't say this before, all of these puzzle

    だから、明確にするため、と私は言っていない この前に、これらのパズルのすべて

  • pieces and the script that we have combined them into,

    作品やスクリプト 私達はにそれらを組み合わせている、

  • so to speak, a script is synonymous with program, really, belongs to this cat.

    いわば、スクリプトはと同義で このプログラムは、実際には、この猫に属します。

  • And the reason is-- because notice how this same cat here is highlighted,

    そしてその理由は、予告のでis-- どのようにここでは、この同じ猫が強調表示され、

  • down here you can create a second cat or dog or really

    ダウンここに作成できる 本当に第二猫や犬や

  • anything you want graphically.

    あなたがグラフィカルに何でも。

  • You can import something from Photoshop, or the like,

    あなたが何かをインポートすることができます フォトショップ等から、

  • and integrate something if you want to make it for a project.

    あなたの場合、何かを統合 プロジェクトのためにそれを作りたい。

  • And what you'll find, ultimately, is that you

    そして、あなたは何を見つける、 最終的に、あなたということです

  • can add scripts, add puzzle pieces, to individual characters.

    パズルを追加し、スクリプトを追加することができます 個別の文字の部分、。

  • So these all belong to this particular cat.

    したがって、これらのすべてが所属 この特定の猫。

  • So now if I go ahead and play this program, nothing's happening.

    だから今、私は先に行くと、再生する場合 このプログラムは、何も起こっていないだ。

  • But it is running.

    しかし、それは実行されています。

  • The program is in this forever loop, kind of waiting for what to happen?

    プログラムは、この永遠にループしている、 種類の何が起こるのを待っている?

  • >> [AUDIENCE CHATTER]

    >> [観客のおしゃべり]

  • >> DAVID J. MALAN: To pet the cat.

    >> DAVID J.マラン:猫をペットに。

  • So if I move my mouse toward him--

    だから私はhim--に向かって私のマウスを移動する場合

  • >> [MEOWING]

    >> [鳴き声]

  • >> DAVID J. MALAN: So now I'm petting the cat.

    >> DAVID J.マラン:だから今 私は猫をなでています。

  • Meanwhile, we can have a double branch.

    一方で、私たちは二重のブランチを持つことができます。

  • Let me go ahead and open up don't pet the cat.

    私が先に行くと開いてみましょう アップ猫ペットはありません。

  • We'll post this online as well.

    私たちも、このオンラインを投稿します。

  • This is a little more complex, but without saying

    これはもう少しです 複雑であるが、言わずに

  • you can guess perhaps what's going to happen.

    あなたはおそらく推測することができます 何が起こるだろう。

  • >> [MEOWING]

    >> [鳴き声]

  • >> DAVID J. MALAN: Cat is meowing, grand old time.

    >> DAVID J.マラン:猫です 鳴き声、壮大な昔。

  • But this program is of course called "Don't Pet the Cat,"

    しかし、このプログラムは勿論である いわゆる「猫のペットしないでください」

  • so clearly, I want to pet the cat.

    そうはっきりと、私は猫をペットにする。

  • >> [ROARING]

    >> [轟音]

  • >> DAVID J. MALAN: Don't pet the cat.

    >> DAVID J.マラン:猫をペットしないでください。

  • Now, let's take a look at another example here.

    それでは、見てみましょう ここにもう一つの例で。

  • This one will be called "Hi, Hi, Hi," for reasons

    この1が呼び出されます 「やあ、やあ、こんにちは、 "理由のために

  • that will be clear, because as soon as I run this thing--

    それがあるため、明らかであろう とすぐに私はこのthing--を実行すると

  • >> [SEAL BARKING]

    >> [SEALの吠える]

  • DAVID J. MALAN: Very easy to write annoying Scratch programs.

    DAVID J.マランさんへの非常に簡単 迷惑なスクラッチプログラムを書く。

  • [SEAL BARKING]

    [SEALの吠える]

  • DAVID J. MALAN: Now we won't go into great detail with all of these,

    DAVID J.マラン:今、私たちは行くことはありません これらのすべてと非常に詳細に、

  • but notice there is a couple of new features here.

    が、そこで気付く ここで新機能のいくつか。

  • There's a variable, called "muted," and then there's a bunch of conditions.

    と呼ばれる変数、「ミュート」は、あります した後、条件の束があります。

  • And for now, let me just tease you by saying

    そして今のために、私を聞かせて ただ言ってあなたをいじめる

  • that if this guy gets too annoying, I can hit the spacebar and he stops.

    この男はあまりにも厄介な取得する場合、その、 私は、スペースキーを打つことができるし、彼は停止します。

  • Because the role being played by these two scripts is as follows.

    役割は次式で演奏されているので これら二つのスクリプトは以下のようである。

  • One of them is doing the barking every few seconds.

    そのうちの一つは、やっている 数秒ごとに吠える。

  • The other one is just waiting for me to hit the spacebar.

    もう一つは、ただ待っている 私のためにスペースバーをヒットする。

  • And if I do hit the spacebar, it's going to change

    そして、私は、スペースバーをヒット行う場合は、 それは変更するつもりだ

  • the state of this variable, the value of this variable, that's apparently

    この変数の状態、値 この変数の、それは明らかだ

  • called "muted," I didn't call it something boring like n,

    いわゆる「ミュート」と私は呼んでいなかった nのような退屈な、それは何か、

  • I called it an English word, "muted."

    私は「ミュート」、英語の単語と呼んで

  • From 1 to 0 or 0 to 1.

    0〜1または0〜1。

  • From true to false or false to true.

    真から偽またはfalseに忠実に。

  • And so you can actually see now, that you

    だから、あなたが実際にすることができます あなたことを、今を参照してください。

  • could have two scripts, two programs running simultaneously,

    2つのスクリプトを持つことができ、2 プログラムは、同時に実行している

  • and both of them might be sitting in a loop doing something.

    両者は、座っている可能性があります ループの中で何かをして。

  • Waiting for the human to do something like hitting spacebar.

    人間がするのを待って スペースバーを打つようなもの。

  • [SEAL BARKING]

    [SEALの吠える]

  • DAVID J. MALAN: And now he's on his way again.

    DAVID J.マラン:そして今 彼は再び彼の方法でだ。

  • [SEAL BARKING]

    [SEALの吠える]

  • DAVID J. MALAN: So what else might we do with these examples?

    DAVID J.マラン:だから何他 私たちは、これらの例をどうでしょうか?

  • Well, let's go ahead and do an example with counting sheep.

    さて、先に行くとやらせる 羊を数えるとの例。

  • We'll continue this along the lines here of-- let's open up the sheep example.

    ここではラインに沿って、これを続けます of--のは羊の例を開いてみましょう。

  • And notice, much like before, this one, thankfully, is a little less annoying.

    そして予告、ずっと前のように、この1、 ありがたいことに、少し面倒です。

  • Once I hit play here-- Oh no, this is annoying.

    私はhere--プレーヒットしたら ああ、いや、これは迷惑です。

  • He is going to baa with some probability.

    彼は、BAAに起こっている ある確率で。

  • Let's play this again.

    それでは、もう一度これをプレイしてみましょう。

  • >> [SHEEP BLEETING]

    >> [シープBLEETING]

  • DAVID J. MALAN: The only difference is we've changed the costume, so to speak,

    DAVID J.マラン:唯一の違いは、 私たちは、いわば、衣装を変更しました

  • and we're halving and say what that actual number is.

    私たちは半分と言うしている その実際の数は何ですか。

  • Well let's go ahead and take this one step further.

    さてそれでは先に行くとしましょう さらにこの1歩を踏み出す。

  • And let me tease you with one other feature here.

    そして、私はであなたをいじめるしましょう ここに一つの他の特徴。

  • Let's go ahead and open up a program called Threads.

    それでは先に行くと開いてみましょう スレッドと呼ばれるプログラム。

  • So much like you can have one sprite, having multiple scripts,

    あまりにも多くのあなたがいずれかを持つことができますように スプライト、複数のスクリプトを持つ、

  • you can have two sprites, a bird in a cat, each having their own script.

    次の2つのスプライト、鳥の中に持つことができます 猫は、それぞれ独自のスクリプトを有する。

  • And each of them can operate simultaneously.

    それらのそれぞれができる 同時に動作する。

  • If you've ever heard the word "multithreading"

    あなたが今まで聞いたことがある場合は 単語 "マルチスレッド"

  • a computer is "multithreaded" means it can do multiple things at once,

    コンピュータは、「マルチスレッド」手段であり、 それは、一度に複数のことを行うことができます

  • and, indeed, so can Scratch.

    そして、実際に、そのようにスクラッチすることができます。

  • >> And now notice the bird is kind of dumb.

    >> そして今、鳥が種のダムで気づく。

  • It's just doing things randomly, bouncing off the screen.

    それだけでランダムに物事をやっている、 画面を跳ね返る。

  • Clearly the cat has been programmed to kind of have seeking capabilities

    明らかに、猫がプログラムされている 種類の求める能力を持っている

  • to home in on the bird because he's always pointing at him.

    鳥上のホームへの理由 彼はいつも彼を指しています。

  • Until finally, he catches the actual bird.

    最終的にまで、彼 実際の鳥をキャッチします。

  • So I won't dwell on the details here, but you can kind of

    だから私は、細部にこだわることはありません ここが、あなたはこの種の缶

  • glimpse the same shapes, some "if" conditions, some variables,

    同じ形状の、いくつかを垣間見る 条件の "if"、いくつかの変数、

  • maybe some loops, are ultimately doing the same thing.

    おそらくいくつかのループであり、 最終的には同じことをやって。

  • >> Now let me go ahead and open up something else altogether,

    >> 今、私が先に行くと、開いてみましょう 完全に何か他のものまで、

  • to tease some of you, particularly those more comfortable,

    特に、あなたのいくつかをいじめるために より快適なもの、

  • what you can actually do with this.

    実際にこれで何を行うことができます。

  • I'm going to go ahead and open up Button here.

    私が先に行くつもりです ここでボタンを開きます。

  • And this is a super simple-seeming program,

    そして、これはスーパーで 単純見せかけプログラム、

  • but watch what happens when I-- Watch what

    しかし何が起こるか見て I--は何を見たとき

  • happens when I open this version of it, here in the browser, scratch.mit.edu.

    私はそれは、このバージョンを開いたときの動作、 ここではブラウザ、scratch.mit.edu中。

  • And when I click this big red button, notice what happens.

    そして、私はこの大きな赤いをクリックすると ボタンは、何が起こるかに注目してください。

  • So what's going on here?

    それでは、ここで起こっている?

  • There's actually a lot more complexity going on underneath the hood,

    より多くの複雑さは、実際にあります ボンネットの下に起こって、

  • even though I've implemented this, or frankly, Dan Bradley

    私が実装されたにも関わらず、 この、または率直に言って、ダン·ブラッドリー

  • has implemented this so simply.

    そう、単純にこれを実装しました。

  • He has designed a custom Scratch puzzle piece, known as a Scratch extension,

    彼は独自のスクラッチパズルを設計しました スクラッチ拡張機能として知られている作品、、

  • he called it Toggle.

    彼はトグルと呼んだ。

  • >> And what Toggle does is it sends a message over the internet.

    >> そして、何の切り替えが行うのは、送信するある インターネットを介したメッセージ。

  • And that message itself looks a little cryptic.

    そして、そのメッセージ自体 少し不可解に見える。

  • But this, too, you'll understand by term's end.

    しかし、これは、あまりにも、あなたはよ 任期の終わりまでに理解しています。

  • The message he's actually sending looks a little something like this.

    彼が実際に送信者からのメッセージ このような小さなものになります。

  • It's just text.

    それは単なるテキストです。

  • Cryptic.

    謎めい。

  • You'll understand it by the time we get the problem set seven.

    あなたは、時間によってそれを理解するでしょう 私たちは、問題が7に設定し得る。

  • It's just sending a textual message over the internet to a server.

    それだけでテキストメッセージを送信しています サーバーにインターネット経由で。

  • And that server is, ultimately, talking to this light bulb, which

    そして、そのサーバーには、最終的には、ある この電球、と話している

  • has one of those fancy light bulbs in it that, itself, is talking

    これらの空想の電球のいずれかを持って その中に話している、それ自体、という

  • to the Wi-Fi in the network here, where a local device down here--

    ここで、ネットワーク内のWi-Fiと、 ここで、ローカルデバイスダウンhere--

  • and, ultimately, it's actually turning that light on and off.

    そして、最終的に、それは実際の オンとオフ、その光を回す。

  • But we can do more interesting things still.

    しかし、私たちはより多くのことを行うことができます それでも面白い。

  • Notice what Dan also did for us.

    ダンはまた、私たちのために何をしたかに注目してください。

  • He made multiple sprites, each of which has a script waiting for a click.

    彼は、それぞれを複数のスプライトを作った そのクリックを待っているスクリプトを持っています。

  • And if I click red, it goes red.

    私は赤をクリックした場合と、それが赤くなります。

  • If I get blue, it goes blueish.

    私は青を取得する場合は、青みを帯び行く。

  • Green, yellow, orange.

    緑、黄色、オレンジ。

  • And all of this is happening by going way out onto the internet,

    そして、これがすべてによって起こっている インターネット上に道外出、

  • back down here to the light bulb, on and off.

    背部の下、ここに 電球、オンとオフ。

  • >> And if you can believe it-- and this is perhaps one of the most complex Scratch

    >> そして、あなたはit--を信じることができる、これがある場合 最も複雑なスクラッチのおそらく1

  • projects someone has implemented-- he did it, in fairness, in a day.

    プロジェクト誰かがimplemented--あります 彼は一日に、公正さに、それをやった。

  • And that was the challenge we threw down to Dan when we saw have binary bulbs,

    そして、それは私たちがダウンして投げた挑戦だった ダンに私たちは、バイナリ球根を持って見たとき、

  • we have Scratch, how can we combine them?

    私たちはどのように、スクラッチを持っている 私たちはそれらを組み合わせることができますか?

  • And, indeed, this is absolutely something anyone in this room

    そして、確かに、これは絶対にあり この部屋で何か誰

  • could do by semester's end-- Is he reimplemented binary bulbs using

    学期のend--は彼ですかによって行うことができます 使用して再実装バイナリ球根

  • the same interface that was on our iPad on Wednesday.

    だった同じインターフェイス 水曜日に私たちのiPadで。

  • So that now, if I actually click the plus over here,

    今では、私が実際にそうであれば こちらにプラスをクリックし、

  • we have one, two, three.

    私たちは一、二、三を持つ。

  • I can hit the 16 and turn that one on.

    私は16をヒットし、そのいずれかをオンにすることができます。

  • 128, and so forth.

    128などが挙げられる。

  • >> Now if that alone has and blown your mind,

    >> 今だけではそれが持っている場合 そしてあなたの心を吹き、

  • you could do things far more accessible, not involving any hardware certainly.

    あなたがはるかにアクセス可能なことを行うことができ、 確かにハードウェアを含まない。

  • Just things on the screen itself.

    ただ、画面自体に物事。

  • And, indeed, what most students end up doing is some kind of game,

    そして、実際に、どのようなほとんどの学生 ゲームのいくつかの種類でやってしまう、

  • some piece of artistic work, or some kind of interactive animation.

    いくつかの芸術的作品、あるいは インタラクティブなアニメーションのいくつかの種類。

  • And I will say one of our favorites has been this one.

    そして、私は私達ののいずれかを言うだろう お気に入りはこの1つであった。

  • And I thought if we could dim the lights,

    私たちならば、私は思った 照明を暗くできた、

  • we'll take a glimpse at this final Scratch project in conclusion.

    私たちは、この最後の時に垣間見るを取るよ 結論としてスクラッチプロジェクト。

  • But what you'll should keep in mind, as I can tease you with one last detail,

    しかし、あなたのように、心に留めておく必要があります 私は1つの最後の細部であなたをいじめることができ、

  • sectioning will begin next week.

    切片は来週開始されます。

  • Office hours will begin next week.

    営業時間は来週開始されます。

  • Problem set zero will be posted CS50.harvard.edu later today.

    問題設定ゼロが掲載されます CS50.harvard.edu後で今日。

  • And you will be greeted in problem set zero

    そして、あなたは迎えられるでしょう 問題にゼロを設定する

  • to CS50's own Zamyla Chan, who guides most of our walkthroughs.

    誰CS50自身Zamylaチャンへ ガイドたちのチュートリアルのほとんどを。

  • These are embedded videos in the problem sets

    これらは、動画に埋め込まれている 問題セット内

  • that will hold your hand through a lot of the initial set up and through many

    それがたくさんを通してあなたの手を開催します 初期セットアップの多くのスルー

  • of the possible design decisions.

    可能な設計上の決定。

  • So if you've ever had that emotion when picking up a homework assignment

    だから、あなたがその感情を持っていた場合は、 宿題をピックアップする際

  • and wondering, where do I begin?

    と疑問に、どこで始めるのですか?

  • She will have that answer for you.

    彼女はあなたのためにその答えがあります。

  • And now, a final program from one of your predecessors

    そして今、最終的なプログラム あなたの前任者の一方から

  • in answer to the question "What does the fox say?"

    質問への答えでの 「キツネは何と言っていますか? "

  • [MUSIC YLVIS, "WHAT DOES THE FOX SAY?]

    [ミュージックYLVISは、「FOXは何と言っていますか?]

  • >> YLVIS: (SINGING) Dog goes woof.

    >> YLVIS:(SINGING)犬は横糸を行く。

  • Cat goes meow.

    猫がニャーを行く。

  • Bird goes tweet and mouse goes squeak.

    バードつぶやきを行くとマウスが鳴き行く。

  • Cow goes moo.

    牛はMOOを行く。

  • Frog goes croak.

    カエルは、しわがれ声を行く。

  • And the elephant goes toot.

    そして象は警笛を鳴らす行く。

  • Ducks say quack and fish go blub.

    アヒルはいんちきと魚がブラブ行くと言う。

  • And the seal goes ow ow ow, but there's one sound that no one knows,

    そして、シールは流れ流れ流れなりますが、 誰も知らない1音があります、

  • what does the fox say?

    キツネは何を言っていますか?

  • And

    そして

  • >> DAVID J. MALAN: That's it for CS50.

    >> DAVID J.マラン:それはCS50は終わりです。

  • We will see you at Puzzle Day and on Monday.

    私たちは時にお会いします 昼と月曜日にパズル。

  • >> [APPLAUSE]

    >> [拍手]

  • >> [MUSIC YLVIS, "WHAT DOES THE FOX SAY?"]

    >> [ミュージックYLVIS、「FOX SAYを何? "]

  • >> NARRATOR: And now deep thoughts, by Daven Farnham.

    >> ナレーター:そして今、深い 祈るファーナムによる思考、。

  • Today I got hit in the face with a phone book.

    私は当たった今日 電話帳に直面しています。

  • Confusing, as I'm at home watching online.

    私が私のように、混乱 オンライン見て家。

>> [MUSIC PLAYING]

>> [音楽再生]

字幕と単語

ワンタップで英和辞典検索 単語をクリックすると、意味が表示されます