クイズのサン。Quiz's san.
おお、マイナスサンじゃん。マイナスサン。Oh, it's minus three. Minus three.
こんにちはクイズノックの須貝です。Hello, this is Sugai from QuizKnock.
やしこです。I'm Yashiko.
山本です。I'm Yamamoto.
漢文っぽいプログラミング言語初見で理解できるのか。Can you understand a classical Chinese-style programming language at first sight?
まずこちらご覧ください。First, please look at this.
じゃあ。あ、Well. Ah,
漢文だ。It's classical Chinese.
こちらですね。It's this.
漢文風のプログラミング言語ウェンヤンというあるの本のウェンヤン。ウェンヤン。Here it is.
プログラミングの初心者が最初に書くコードといえば何かわかりますか。ハローワールド。Speaking of the first code a programming beginner writes, do you know what it is? Hello World.
ですよね。Right.
おお。Oh.
はい。Yes.
これはね、ウェンヤンの場合がハローワールドこんな感じになっております。In the case of Wenyan, Hello World looks like this.
で、コードを説明すると、モジュールつこのモンテンチコダイコテン数コに代入してください。To explain the code, please assign to the variable ko this muntencikodaikoten number ko.
な、これ今コ。This is now ko.
はい。Yes.
どういうことか。What does that mean.
で、そのコを出力してください。And please output that ko.
とすると、まあこのモジュールつモンテンチコダイマルが出ると。Then, well, this module tsu montencikodaimaru will appear.
なるほどね。I see.
本日はこのウェンヤンのコードを見て何が出力されるのか当てるというクイズになっておりますね。Today's quiz is to look at this Wenyan code and guess what will be output.
なるほど。I see.
協力で。With cooperation.
でございます。あ、It is. Ah,
協力ですね。It's cooperation.
で、今回問題で出題されるのはすべて数列になっています。And all the questions this time are number sequences.
答えは並びやすいって答え言って大丈夫です。The answer is easy to line up, it's okay to say the answer.
3人で協力して5問クリアを目指すと。The three of us will work together to aim to clear 5 questions.
はい。Yes.
第一問はこちらです。Here is the first question.
なるほど。I see.
あれ、一数、数だねあれ。Huh, one suu, it's suu, huh.
数字の数じゃない。Not the number suuji's suu.
役みたいなですか。Is it like a role?
数の旧字体。The old form of the character for number.
数ですか。Is it suu?
旧字体ですね。It's the old character form.
一つの数あり。There is one suu.
一があるんだ。There is a one.
でこれをコウと名づける。And name this Kou.
次にまたあれある一つの数。違くNext again there is one suu. No,
二。Two.
これをオツと名づける。はいはいName this Otsu. Yes yes
はい。コウYes. Kou
という名前の一とオツという名前の二があります。There is a one named Kou and a two named Otsu.
はい今。Yes now.
はい。Yes.
出す。Output it.
これ10遍。10This 10 times. 10
回繰り返すよってことかな。Does it mean repeat this 10 times?
オツを以ってコウを乗ず。Multiply Kou by Otsu.
これが乗算なのか、累乗なのかわかんないですけど。I'm not sure if this is multiplication or exponentiation.
でまたあでこの乗じたやつをヘイと名づけます。And then name this multiplied result Hei.
若しこのコウというもの有りきり。If there is this thing called Kou.
プログラミングに実践出てきないってことないけど。It's not that it never comes up in actual programming, but.
一旦前半処理する。はいはい。Let's process the first half for now. Yes, yes.
単純前半処理しよう。Let's simply process the first half.
乗というものが掛け算だと仮定すると、はい。Assuming that 'multiply' means multiplication, yes.
まず乙を以って甲を乗ず。First, multiply Kou by Otsu.
つまり2を以って1を掛ける。That is, multiply 1 by 2.
はい。Yes.
掛けて2がやること。はいはいMultiplying gives 2. Yes, yes.
はい。Yes.
でこれを10回繰り返そうとするとね、プログラミングでいうところfor文ってやつですか?And to repeat this 10 times, in programming terms is that like a for loop?
同じ処理を10回とかまあ何回繰り返しますよみたいな。Like repeating the same process 10 times or however many times.
昔の甲が丙に入ってみたいな。Like putting the old Kou into Hei or something.
ああ、なるほどそういうこと?Ah, I see, is that what it means?
代入するんだと思うんですよね。I think it's assigning it.
そうかそうかそうかそうか。I see, I see, I see, I see.
1回の処理内容は乗ずから云云までがこう繰り返しの範囲内を指してるんですか。Does the content of one iteration, from 'multiply' to 'etcetera', indicate the range of the repetition?
云云までを10回繰り返してこうを掛けるということ。Repeat everything up to 'etcetera' 10 times to multiply Kou.
おお、云云いいですね。Oh, 'etcetera' is nice.
云云。'Etcetera'.
云云終わりを意味してるかな。I wonder if 'etcetera' means the end.
云云終わりを意味してるかもね。Maybe 'etcetera' means the end.
ね。Right.
その括弧とかでどこまでが1回の処理なのか。2Like parentheses showing where one iteration ends. 2
に1入れる。2Put 1 into 2. 2
に2入れる。1Put 2 into 1.
かけ2。Times 2.
を行う。Perform it.
丙とする。Call it Hei.
甲に丙を入れる。Put Hei into Kou.
なるほど。I see.
そうすると答えに乙を掛ければよね。Then you just multiply the answer by Otsu.
甲に乙掛けるみたいなことだよね。It's like multiplying Kou by Otsu.
乙は二だから数字増えてくでいいね。Otsu is two, so the number keeps growing, good.
オッケー。Okay.
そうだね。That's right.
二の十乗。Two to the tenth power.
二の十乗。Two to the tenth power.
基本的な文法の話で今初めて気づいたのは、最初にあの変数の型を宣言してたんだなということに今気づきました。Speaking of basic grammar, what I just realized for the first time is that it was declaring the variable type at the beginning.
さっきはなんか文言って言ったからテキストしか入れられなかったけど、今回数字が入れられるってこと。Earlier it said 'text', so only text could be entered, but this time numbers can be entered.
なるほどね。I see.
この言語にもちゃんと型宣言があるんですね。This language has proper type declarations too.
答えはどうぞ。Go ahead with the answer.
千二十四。One thousand twenty-four.
正解。Correct.
わかりやすいようにインデントを付けたものがこちらになります。Here is the same thing with indentation added to make it easier to understand.
ああ、インデント。Ah, indentation.
おお。Oh.
わかりやすい。Easy to understand.
わかりやすい。Easy to understand.
最初からこうしてよ。You should have done this from the start.
もう一回これでございます。あ、Once more, here it is. Ah,
できますね。You can do it.
できます、できますね。You can, you can do it.
安全でできちゃってるじゃないですか。You've already done it safely.
安全でできます。It can be done safely.
これね、ツイッテブックメモに立てていただいて。Please post this in the Tweetbook memo.
安全。Safe.
まあアンコンパイル。Well, uncompile it.
俺らがコンパイラじゃ。We are the compiler.
俺は人間コンパイラ。I'm a human compiler.
二問目はこちら。Here is the second question.
えー。Uh...
なんだなんだ。What, what?
あれ、カスで見た。Huh, I've seen that in C.
三角の所。The triangle part.
なんだ?What is it?
関数や。It's a function.
プログラミングどこいった?Where did the programming go?
安定の所ですね。It's the stable part.
ライブラリみたいな。Like a library.
ライブラリ。Library.
これじゃない?Isn't it this?
ライブラリ。Library.
最初にスイングしてる。It's swinging at first.
これなんだよネタバレ。This is a spoiler.
三角っていうライブラリから関数持ってくるやつ。The one that brings a function from a library called triangle.
これなんだよネタバレ。This is a spoiler.
で、方べきの字。And, the character for power.
漢文だと一個目冪字でまさにべきの義を悟っただIn classical Chinese, with the first character 'power', I grasped exactly the meaning of power
とすごい三角の定を見たらべきの定義を理解したんじゃないでしょ。Like, after seeing the definition of triangle, didn't you understand the definition of power.
まあそういうことは。あ、Well, something like that. Ah,
でここからまさっき見られたですね。And from here, as you saw earlier.
はい、数がありますよ。Yes, there is a number.
はい、え、それは二ですよ。Yes, uh, that is two.
二ある。There's a two.
これを甲と名付けます。We'll name this Kou.
はい、でまた数があります。Yes, and there's another number.
して、はい、うわ、負の三。お、And, yes, wow, negative three. Oh,
マイナス三じゃん。It's minus three.
これ半分過ぎておうって何言って。This is past halfway, what are you saying.
これは乙と名付けますよ。We'll name this Otsu.
はい、うわやばいやばい。ここYes, wow this is bad bad. Here
甲置いて乙置いて、これどっちがどっちをべきするんだろうな。Putting Kou and putting Otsu, I wonder which raises the other to a power.
うわどうかな。Oh, I wonder how it'll go.
一旦続けます。はいはい、Let's keep going for now. Yes, yes,
甲に乙持って乙引く。Take B from A and subtract B.
乙の引きですね。It's the pulling of B.
引く乙だ。It's the pulling B.
引き引く乙ですね。It's pull, pull B.
でそれを丁と名付けます。And name that D.
はい、で丁を出力しなさいと。はいはいはいはい。Yes, and output D. Yes yes yes yes.
八だ八か二のマイナス三乗引く。Eight, eight minus 2 to the power of minus 3.
マイナス三かマイナス三を引くマイナス三どっちかどっちかだね。Minus 3, subtract minus 3, it's one or the other.
どっちかだとべきの書き方ってさ、こうこういう書き方まずあるじゃないですか。Either way, for how to write powers, well, there's this way of writing, right.
今多分こうこうじゃなくてこういうこういうRight now it's probably not like this, but like this, this
下側の書き方みたいなのがされている気がして、何かを何かしなさいみたいな書き方だなと思ったとき、今の文順だと甲が二、乙がマイナスI feel like it's written in the lower style, and when I thought it's phrased like do something to something, with the current sentence order, A is 2, B is minus
三、二のマイナス三乗いいですか、八分の一。Three, 2 to the power of minus 3, okay, one-eighth.
そうしましょう。Let's do that.
八は零点一二五、零点一二五引くマイナス三じゃEight is 0.125, 0.125 minus negative 3, so
三点一二五。3.125.
べきやな、べきやな。It's a power, it's a power.
答えはどうだ、三点一二五。So how about the answer, 3.125.
正解。Correct.
参入一部二輪五門ということで、So, entering, part one, two wheels, five gates,
小数出ても不安にならない心を鍛えてきてるんです。We've been training our minds not to panic even when decimals appear.
東大受験あるあるね。That's so typical of Todai entrance exams.
東大受験あるある。Typical of Todai entrance exams.
第三問はこちら。Here is question 3.
長いよ。It's long.
長い長い長い。Long, long, long.
数があります。There is a number.
はい。Yes.
それは二です。That is 2.
二でした。It was 2.
甲です。It's A.
はい。Yes.
二。2.
また数がありまして、それは一です。There is another number, and that is 1.
はい。Yes.
それを乙と名付けます。Name that B.
はい。Yes.
二一。Two one.
四分だ。It's a quarter.
四ペンこれをなす。Four pens, make this.
はい。Yes.
もしだ。If.
もし。If.
二分だ。It's a half.
もし甲大なり乙であれば加える乙持って乙。はいはい。If A is greater than B, add, take B and B. Yes yes.
持って乙。Take B.
さらに乙を乙に足すんだ。Furthermore, add B to B.
あまた丙を名付けてかつて乙だったものに丙を代入しますと。Ah, name it C again and assign C to what was formerly B.
でもし甲七よりも小さくなければ。But if it's not smaller than A seven...
だから大なり小よりってことか。So it means greater than or less than.
はい。Yes.
減ずる甲を持って乙。Take Otsu with Kou decreased.
ちょっと待って無視だ。Wait a sec, ignore it.
これ丙と名付けまして甲に丙を代入します。We name this Hei and substitute Hei into Kou.
入します。Substitute it.
えこれ一旦本文が終わります。Uh, this ends the main text for now.
云云でね。Blah blah, you know.
あるいはまあだからifをやるかifを満たさなくなったら別の方をやれるみたいなのがあるんでね。Or well, so there's like doing an if, and if the if is no longer satisfied you can do the other one.
この云云はforの終わりじゃなくてif文の終わりを指します。This blah blah refers not to the end of the for but to the end of the if statement.
あのそう思ってこういう時プログラミングある。You know, I think like that, this happens in programming.
先に末尾を見に行くと云云だ云云だ。If you look at the end first, it's blah blah, blah blah.
えコードになってるぞ。Huh, it's become code.
であるいはもし甲が乙と等しいならば甲に四を加える。Or, if Kou equals Otsu, then add four to Kou.
はい。Yes.
丁と名付けて丁と名付けてで甲に丙を代入する。はいはい。Name it Tei, name it Tei, and substitute Hei into Kou. Yes yes.
もしそうでなければ甲に五を加えてこれを丁と名付ける。If not so, add five to Kou and name this Tei.
はい。Yes.
で甲に丙を代入してAnd substitute Hei into Kou,
これがもしが終わってさらに四遍繰り返してるのが終わりましてで言上する甲云々を言上する。This ends the if, and further ends repeating it four times, and then report, report Kou blah blah.
でそれを丁と名付けて丁を出力しろ。はいはい。And name that Tei and output Tei. Yes yes.
オッケー。はいはい。Okay. Yes yes.
やめてやめてやめてやめて。Stop stop stop stop.
あとやるだけ。Just have to do the rest.
条件かこ。A condition, huh.
あの、人間が理解できる言語ですね。Um, a language humans can understand.
理解できる言語なんです。It's a language you can understand.
高級言語ですか。Is it a high-level language?
結構高級。Pretty high-level.
甲に2です。2 into Kou.
はい。Yes.
乙に2。2 into Otsu.
丙出ました。Hei came out.
これもう。This is already.
じゃあスクリプトとかで書いたの。So you wrote it in a script or something.
ありがとうございます。Thank you.
甲に。Into Kou.
別の結果で。With a different result.
やめちゃえば。If you just quit.
甲が乙より大きいなら乙に2を足す。If Kou is greater than Otsu, add 2 to Otsu.
して。And.
名前は丙。The name is Hei.
でかつて乙だったものに丙を代入する。And substitute Hei into what was formerly Otsu.
だから乙がどんどん2ずつ増え。So Otsu keeps increasing by 2.
乙に丙を代入した後にもし甲が7より小さくなければ甲から2を引く。After substituting Hei into Otsu, if Kou is not less than 7, subtract 2 from Kou.
それを丙と名付ける。Name that Hei.
甲は2ずつ減っていくと。Kou will decrease by 2s.
あるいは丙。Or Hei.
甲イコール乙。Kou equals Otsu.
甲に4を加える。Add 4 to Kou.
甲に4を加えてくると。はいはいAdd 4 to A. Yes, yes
はい。Yes.
かつて甲だったものに丙を代入する。はいはいSubstitute C into what was once A. Yes, yes
はい。Yes.
甲に4を足される。はいはい4 is added to A. Yes, yes
はい。Yes.
最後に。Finally.
にどれでもなければ。If it's neither.
甲に五をまず。First five to A.
甲に五を足して丙とする。Add five to A and make it C.
足してのことか。You mean adding it.
丙を甲に代入する。はいはい。Substitute C into A. Yes, yes.
これも一を入せてね。Put a one in this too.
甲丙入れて。Put in A and C.
でこの文面で一旦多分三つの分岐が終わり。はいはい。And with this wording, probably the three branches end for now. Yes, yes.
で最後に残っている甲と乙を掛けたやつが丙だ。And finally, A multiplied by the remaining B is C.
丙を入力しておけましょう。はいはいLet's input C. Yes, yes
はい。Yes.
よっしゃ。Alright.
よっしゃ。Alright.
あとは計算するだけや。Now we just have to calculate.
オッケー。Okay.
じゃ僕交互つましやろう。はいはい。Then I'll do them alternately. Yes, yes.
まず甲が乙より大きいです。First, A is greater than B.
ので一個目の分岐いきましょう。So let's go to the first branch.
はい。Yes.
乙足す2。B plus 2.
はい。Yes.
その上にもう一回イフが入ってて、甲が七よりも大きいときは文面なんですが、甲にです。On top of that there's another IF, when A is greater than seven the wording is, to A.
じゃ最初に戻って。Then back to the beginning.
はい。Yes.
でじゃ一回ループ終わりました。あずAnd so one loop is finished. Azu
アイ。I.
アイが担当。I is in charge.
アイだ。It's I.
アイだ。It's I.
二回目の二出しました。Put out the second two for the second time.
え次は甲と乙を比較したときに、乙の方が大きい。Uh next, when comparing A and B, B is larger.
甲に五を足します。Add five to A.
やばい。Oh no.
二シースで。ええ。In two Cs. Yeah.
これです。This is it.
甲。A.
コンピューターなのでね。Because it's a computer.
確かにね。Indeed.
これは自然ですよね。This is natural, isn't it.
ちょっとこちらに入りますね。I'll go in here a bit.
はい。Yes.
ああ。Ah.
分かりづらい。Hard to understand.
七と三ですね。Seven and three.
甲です。It's A.
はい。Yes.
三回目のループ行きましょう。Let's go for the third loop.
三回目入ります。Entering the third time.
甲の方が大きいのでこちらを適用します。Since A is larger, we'll apply this one.
乙に二を足してください。Please add two to B.
ええ。Yes.
そうそう。Right, right.
はい。Yes.
えさらに甲が七以上なので甲から二を引いてください。Also, since A is seven or more, please subtract two from A.
甲から二を引く。Subtract two from A.
乙。B.
乙だ。It's B.
一緒だ。They're the same.
すごい。Amazing.
最終ループ。Final loop.
はい。Yes.
はい。Yes.
甲と乙が等しいため甲に四を足してください。Since A and B are equal, please add four to A.
はい。Yes.
はい。Yes.
オッケー。Okay.
四回やりました。Did it four times.
四回やりました。Did it four times.
最後掛け算しましょう。Finally, let's do the multiplication.
はい。Yes.
九かける五で四十五。Nine times five is forty-five.
四十五。Forty-five.
はい。Yes.
できた。Done.
だ。There.
はい答えはどうぞ。Yes, please give the answer.
四十五。レーカー。Forty-five. Raker.
頑張りましたね。You worked hard.
ありがとうございます。Thank you.
半分の知識があるため。Because I have half the knowledge.
若いが出てきてすぐもしだ。Young ones come out right away though.
うん。Yeah.
その辺気にしている場合じゃないからね。This is no time to worry about that.
素晴らしい。Wonderful.
第二問はこちらです。Here is the second question.
わあ短い短い。Wow, it's short, short.
いけるいける。You can do it, you can do it.
いいね。Nice.
ああ。Ah.
配列が来た。An array has come.
列があります。There are columns.
配列ってあれだよね。An array is that thing, right?
数字の束を入れていい場所だよね。It's a place where you can put a bunch of numbers, right?
そうですね。Yes, that's right.
でそれを甲と名付けます。And we'll name that Kou.
はい。Yes.
え次に数があります。Uh, next there is a number.
はい。Yes.
えこれは二です。Uh, this is two.
はい。Yes.
で乙が二ですよと。はいはいAnd Otsu is two, you know. Yes yes
はい。Yes.
見ました。I saw it.
四分です。It's four minutes.
はい。Yes.
誤解を行います。We'll do the misunderstanding.
はい。Yes.
わあ知らないきた。Wow, an unknown one came.
当てる。To hit / to apply.
ここに乙を持って当てる。Bring Otsu here and apply it.
まあ充足性を入れようみたいなことか。Well, it's like let's put in satisfiability.
乙に二をかける。Multiply Otsu by two.
はい。Yes.
でこれを丙と名付ける。And name this Hei.
丙から一を減らす。Subtract one from Hei.
これを丁と名付ける。Name this Tei.
うん。Yeah.
かつて乙だったものを丁に代入する。Substitute what was once Otsu with Tei.
はい。Yes.
じゃ。Well then.
じゃこれで本文終わり。Well, with this the main text ends.
はい。Yes.
つまり空の入れ物をまず用意します。In other words, first prepare an empty container.
はい。Yes.
たら数字をたくさん入れる箱。Then a box for putting lots of numbers in.
たくさん用意された。Many were prepared.
たくさん入れる箱なんですけどまだ何も入ってない箱があります。It's a box for putting lots in, but there's a box with nothing in it yet.
はい。2Yes. 2
を持ってて。Having.
はい。Yes.
箱2に2入れる。2Put 2 into box 2. 2
が入った。Went in.
はい。Yes.
これを入れるよって言ったこいつを。Saying we'll put this in, this guy.
2倍して1引いて3にしたい。Double it and subtract 1 to make it 3.
今度これまた3を入れる。This time put 3 in again.
入れる。Put in.
はい。Yes.
入れて3を2倍して1引いたら5になる。Put it in, and doubling 3 and subtracting 1 makes 5.
うん。Yeah.
でこれ入れる。And put this in.
うん。Yeah.
で5が2倍して1引いたら9になる。And doubling 5 and subtracting 1 makes 9.
うん。Yeah.
で9入れる。And put in 9.
うん。Yeah.
で9を2倍して1引いたら17入れる。And double 9 and subtract 1, then put in 17.
はい。Yes.
だから2, 3, 5, 9, 17みたいなのが入った箱が完成します。So a box containing things like 2, 3, 5, 9, 17 is completed.
はい。Yes.
で次に甲の3番目ですけど甲ってのは例えば箱の名前なので。And next is Kou's 3rd, but Kou is for example the name of the box, so.
はい。Yes.
箱の3番目を指してて。It's pointing to the 3rd of the box.
なるほど。1I see. 1
だ。is.
はい。3Yes. 3
番目をボと名付けます。はいはいWe'll name the rd one Bo. Yes yes
はい。Yes.
さらに甲のボ。Furthermore, Kou's Bo.
甲のボというのを。The thing called Kou's Bo.
甲の5番目に持ってくるってことだから。means bringing it to Kou's 5th, so.
ことだからこれを指さしてて、これを丁と名づけて、でその丁を書けってことは、これ、これ、いけ、so it's pointing to this, naming this Tei, and to write that Tei means, this, this, go,
はい、答えは、答えは十七です。Yes, the answer is, the answer is seventeen.
正解。Correct.
素晴らしい。あ、Wonderful. Ah,
須貝が早かったね。Sugai was fast.
わかんの?You get it?
配列大好きなんだ。あ、I love arrays. Ah,
そうなの?Really?
聞いたことがない、配列大好きな人がいるんだって。Never heard of it, there's a person who loves arrays.
いいですからね。That's fine.
最終問題はこちら。Here's the final problem.
うーん、Hmm,
術だよ。It's a technique.
多分これはファンクションだ。あ、Probably this is a function. Ah,
ファンクションなんか自分で作るって言ってるわ。It says to make a function yourself.
関数定義するんじゃないですか。はいはい。Isn't it defining a function. Yes yes.
プログラミングでね、まとめてやりたい操作を先に自分で名前つけて置いとけるんだよね。In programming, you can give a name in advance to an operation you want to do together.
まあちょっと読んでみますか。Well, shall we read it a bit.
はい。Yes.
これを甲乙と呼ぶ。Call this Kou-Otsu.
必ず、まず一つの数を。Always, first one number.
洗面のインテリアなんでやっぱ。Since it's a washroom interior, after all.
部屋のインテリアプログラミングもできる。You can program room interiors too.
この数lあだから先に数を一個lだから。This number l, ah so first one number l, so.
関数を動作させるんだったら数字がいるでしょ。If you're going to run the function, you need a number, right.
っていう関数の必須ですね。That's required for the function.
だいたい一般にはゼロには。Generally, roughly, to zero.
コがfで。Ko is f.
オツがxだと思っています。はいはいはいはい。I think Otsu is x. Yes yes yes yes.
じゃこのf xみたいな感じでコオツってあるんですね。So it's like this f x, like Ko-Otsu.
うん。Yeah.
でもしオツが零に等しければ、つまり零をlオツにゼロを入れたらゼロを出力するってことですかね。And if Otsu equals zero, that is, if you put zero into l Otsu, it outputs zero, right.
その関数で。コゼロIn that function. Ko zero
はゼロ。is zero.
うん。Yeah.
で次にもしオツが一と等しいときは一をlはい。And next, if Otsu equals one, then one, yes.
ここまで当てはまっていない場合、オツから二を引く。If none of the above apply, subtract two from Otsu.
なるほど。I see.
a等オツ引く二ですね。a equals Otsu minus two.
えで次にtがオツ引く一。And then t is Otsu minus one.
コにaをおどこし。Put a into Ko, uh where.
ああなんかコっていう関数をaという引数で作動させる。コ。Ah, like activating a function called Ko with the argument a. Ko.
確かに。Indeed.
でそれをボーン。And put that into Bo.
ボーに代入するんで、まあボーイコール、で自分で自分を呼び出してるんだな。Assign it to Bo, so well, Bo equals, it's calling itself.
今度はキがこう、こうでなんだ。あキイコールキイコールThis time Ki is like, like this. Ah, Ki equals, Ki equals
こうし、でボとキを足したものをこう、でそれを関数の結果として出力する。Like this, and add Bo and Ki, like this, and output that as the function's result.
ここまでが関数の定義です。That is the end of the function definition.
はい、オッケー。Yes, okay.
さて、こうに十を入れたらどうなるでしょう。Now, what happens if we put ten into Ko.
オッケー。Okay.
まずどっちでもないため、ゼロでも一でもないからパターンをやりますよと。First, since it's neither, neither zero nor one, we'll do the pattern.
エーとティーに八と九が入ってる。ボUh, A and T get eight and nine. Bo
はこう、こう、ヘイ、こうヘイ、こうも八。is ko, ko, hey, ko hey, ko is also eight.
やばい。Oh no.
ああだから最初のがいってくるのか。Ah, so the first one is coming.
ああだから下っていくんだ。Ah, so it goes down.
下っていくんだ。It goes down.
これゼロか一になるまで永遠続くんだこれ。This continues forever until it becomes zero or one.
まあ有限だからやればいいのか。Well, it's finite so we can just do it.
これ逆にしたら。If you reverse this.
フィボナッチ数列になります。It becomes the Fibonacci sequence.
えーと、項十は八足す九でできていて、九は項八足す項七だね。Um, term ten is made of eight plus nine, and nine is term eight plus term seven.
うん、そうだね。Yeah, that's right.
だからフィボナッチ数列と同じになる。So it becomes the same as the Fibonacci sequence.
おー、二個前の項を足せる。Oh, you add the term two before.
まあ項っていうの誰か。Well, who calls it term.
やばい。Oh no.
数列の三番目の項でした。It was the third term of the sequence.
二番目、二番目。Second, second.
フィボナッチ数列なのに。Even though it's the Fibonacci sequence.
でいうと二個前の二番目を足せる。In that sense, you add the second one two before.
これ以上に初項の定義を与えてくれてて、うんうんそうだ。It's giving us the definition of the initial terms beyond this, yeah yeah that's right.
第ゼロ項はゼロ、第一項は一とした時の直前の二項を足した数列の第十項の値を求めよっていう問題だと解釈できます。It can be interpreted as the problem: find the value of the tenth term of the sequence where the zeroth term is zero and the first term is one, adding the previous two terms.
すごい。Amazing.
項ゼロはゼロ。Term zero is zero.
かかる。It takes.
項ゼロ、項一は一がかかる。Term zero, term one takes one.
項二はっていうとゼロ足す一の一になる。Term two is zero plus one, so it becomes one.
一になる。It becomes one.
項三はっていうと項一足す項二になるから、これは一足す一、一になる。Term three is term one plus term two, so this is one plus one, becomes one.
二です。It's two.
これを考えていくと、やってることは必須です。Thinking this through, what we're doing is essential.
すごい。Amazing.
必須です。It's essential.
第十個。The tenth.
一、一、二、二、三、五、八。One, one, two, two, three, five, eight.
十分五回だ。That's five out of ten.
六、七個目。The sixth, seventh one.
十三。Thirteen.
八個目。The eighth one.
二十一。Twenty-one.
九個目。The ninth one.
三十四。Thirty-four.
十個目。The tenth one.
ええ、五十五。Yes, fifty-five.
いける。You can do it.
え、項十は五十五。Uh, the tenth term is fifty-five.
正解。Correct.
ええ、マスターですね。Yes, you're a master.
マスターしちゃった。You've mastered it.
関数の中でも再帰関数というものでしたね。It was what we call a recursive function, among functions.
関数の自分の定義の中で自分が出てくるっていうね。Where the function itself appears inside its own definition.
検証大成功ということですね。So that means the verification was a huge success.
多少限で理解できるのか。Can it be understood to some extent?
できる。You can.
ということで本日は漢文みたいなプログラミング言語を人力で解読してまいりましたけれども、皆さんどれほどわかったでしょうか。So today we've manually decoded a programming language that looks like classical Chinese, but how much did you all understand?
ぜひコメント欄にも漢文っぽいコメントお待ちしております。Please leave classical Chinese-style comments in the comments section.
それでは次の動画でお会いしましょう。Then I'll see you in the next video.
さようなら。バイザクラ。Goodbye. Byezakura.
今日の一問はこちら。Here is today's question.
本日もご視聴いただきありがとうございました。Thank you for watching today as well.
チャンネル登録、高評価もよろしくお願いします。Please subscribe to the channel and give it a high rating.
概要欄からSNSとフォロワークラブ、スコレもぜひチェックしてみてください。Please also check out the SNS, Follow Work Club, and Skole from the description box.
それではまた次の動画でお会いしましょう。Then I'll see you in the next video.
さようなら。Goodbye.