1
00:00:00,790 --> 00:00:05,500
Hey guys, welcome to Day 8 of a 100 Days of Code.

2
00:00:05,890 --> 00:00:10,240
And today we're going to be looking at functions that allow you to give them

3
00:00:10,270 --> 00:00:14,800
inputs. And once we've learned all of that and we've grasped it,

4
00:00:15,070 --> 00:00:18,520
then we're going to be building a cipher program.

5
00:00:18,820 --> 00:00:21,610
And the cipher program is called Caesar cipher.

6
00:00:22,150 --> 00:00:27,100
So Caesar cipher is a really quite ancient type of encryption.

7
00:00:27,640 --> 00:00:29,980
So the story goes that, um,

8
00:00:30,010 --> 00:00:34,660
when Caesar wanted to send highly sensitive military messages,

9
00:00:34,930 --> 00:00:39,930
he would encode his message so that each letter would be shifted by a

10
00:00:40,150 --> 00:00:41,260
predetermined amount.

11
00:00:41,800 --> 00:00:46,800
So let's say that we wanted to encode the letter "A" and we shift it by three,

12
00:00:47,710 --> 00:00:47,910
well

13
00:00:47,910 --> 00:00:52,910
then A becomes D, B becomes E and so on and so forth.

14
00:00:54,250 --> 00:00:56,800
And this is what the final version will look like.

15
00:00:57,130 --> 00:00:59,200
Let's go ahead and encode something.

16
00:00:59,740 --> 00:01:03,310
So I'm going to type encode to start encrypting a message.

17
00:01:03,760 --> 00:01:07,210
And then I'm going to type my message with no spaces in between.

18
00:01:08,560 --> 00:01:10,660
And then I'm going to give it a shift number.

19
00:01:10,690 --> 00:01:12,130
So this is going to be a number that

20
00:01:12,160 --> 00:01:15,700
the recipient and I are going to agree on so that we know how to decode the

21
00:01:15,700 --> 00:01:17,920
message. Let's put that at nine.

22
00:01:18,550 --> 00:01:21,460
And then it's going to give us the encoded results

23
00:01:21,520 --> 00:01:23,230
which is something like this.

24
00:01:23,290 --> 00:01:26,440
And this will be the message that I'm going to transmit to my friend,

25
00:01:26,500 --> 00:01:28,780
either through a letter or through an email

26
00:01:29,080 --> 00:01:31,780
and it means that whenever somebody comes across this message

27
00:01:32,050 --> 00:01:35,350
they won't really know what's going on unless they knew the shift number.

28
00:01:35,890 --> 00:01:40,150
So let's say that I am my friend. I've just received this message.

29
00:01:40,630 --> 00:01:45,340
And I'm going to go ahead and type yes to go again

30
00:01:45,430 --> 00:01:48,640
and in this case, I'm going to decode instead of encoding.

31
00:01:49,090 --> 00:01:52,030
And then I'm going to paste the message and hit enter.

32
00:01:52,510 --> 00:01:56,920
And of course, the shift number is nine and now I have the decoded results

33
00:01:57,190 --> 00:02:01,720
which I can read and understand. By the end of today,

34
00:02:01,720 --> 00:02:04,030
you would have learned about functions with input,

35
00:02:04,300 --> 00:02:08,020
you'll know what the difference is between arguments and parameters.

36
00:02:08,590 --> 00:02:11,050
Once you're ready, once you're loaded up on coffee,

37
00:02:11,290 --> 00:02:13,960
then head over to the next lesson and let's get started.

