Learn Programming | Bill Gates | Mark Zuckerberg

Learn Programming | Bill Gates | Mark Zuckerberg

Views:4260|Rating:5.00|View Time:3:59Minutes|Likes:60|Dislikes:0
Start Learning Programming From Scratch

people make decisions every day for example before you go outside you kind of have an if statement that says if it's raining then I need to get my jacket and computers are amazing once you decide those kinds of statements that they can reliably execute those things at unbelievable speed and so a computer program really is a little bit of math and some if statements where the decision gets me so in in this puzzle the if block helps the zombie make a decision right it sucks something for example let's just a block that says if there's a path to the left and put a turn left command inside it so we're telling the zombie to check its surroundings see if there's that path on the left and if so make that turn and then we use the move forward block inside this repeat to get it to keep moving forward as long as it just wants to go straight then when there's the turn the if block will tell it to make this turn to the left and you can see if we do that if we're taking the terms to the left and otherwise moving forward we'll achieve our goal so it's an example of using an if statement which is really a fundamental concept in computer programming one of the first things I learned was how to write a program to play tic-tac-toe and you know so I if statements to say okay if the other person is about to win go ahead and and block that spot so have fun learning how to use if statements it's a key concept programming is one of the only things in the world that that you can do where you can sit down and just make something completely new from scratch you know whatever whatever you want one thing that computers are really good at is repeating commands as a person you'd get really bored if you had to do the same thing lots of times in a row but a computer can do the same thing millions or even billions of times and not get bored and be able to carry that out really well so for example if I wanted to wish everyone on Facebook a happy birthday by sending them an email it might take me more than a century to actually write out all of those emails to everyone but with just a few lines of code I can have a system send an email to everyone on Facebook wishing them a happy birthday so that's what loops are and why they're valuable and something that computers can do very well in this example your goal is going to be to move the bird to pick the plate now we're going to be able to use the repeat block in order to be able to do this very easily you can either do this by giving the computer a move forward command five times in order to advance the the bird one step each time to the pig or you can just tell the computer to move forward once and then tell it to repeat that five times and it'll do the same thing so in order to do this you drag your move forward command and then you put it inside the repeat block and you can click on it and tell it how many times you want to repeat the block to tell it how many steps you wanted to take forward now one more thing is you can put as many commands as you want inside the repeat block so in this example you're telling it to move forward and turn left which it'll do five times obsessed with maps when I was a when I was a kid and cities specifically so I taught myself how to program but at a very clear goal of what I want to do which is to see a map of the city on my screen and play with it put things on the map to move things around the map see what was happening in the city how it worked

2 Replies to “Learn Programming | Bill Gates | Mark Zuckerberg”

Leave a Reply

Your email address will not be published. Required fields are marked *