My journey through coding

I started off with no knowledge and ended up with knowing how to make a BuzzFeed quiz a game, which I always thought was an extremely complex process. We learned how to make and use strings, variables, integers, random input, lists, if and elif, while loop and calculations.  When I found out we were doing coding in design class my initial reaction was oh no, because I have only seen it with random letters and numbers. However, when we started using phyton it became easier. Although this journey was still a ride I have learned a lot and I am proud to say I can use the basics of coding and have made a rock paper scissors game.

During our first coding class we learned the difference between strings and variables.  Starting with just printing hello and then building it to make the computer writing a sentence. The difference between a variable and a string is that a variable stores it in the computer and a string makes it a text.Screen Shot 2018-01-25 at 2.06.50 PM.png

We then built the process by learning integers. WHen putting it as a string you are telling the computer to just write it, therefore, there should be no quotation marks around it. If wanting to make the computer do calculations you say print and then put the calculation in brackets. In order to calculate something in a word problem, you make the computer know the number of having the variable. Then you make it another variable by putting the variable and then the equation symbol. Screen Shot 2018-01-25 at 2.06.55 PM.png

The next class we learned how to use if, elif as well as input and created a game called the greeter. Before we did this we coded a little something to learn how to use input and if, elif and else. In order for the computer to be enabled to use data of the computer user is by user input and a variable.  The first line allows the computer to enter the age however if the age is lower than 18 the computer will then say it cant drive and print its age. However, elif is used if the age is 17 however you can see i forgot to put ==17. To end a if clause you have to use else and if the age was 18 or higher the computer will say have fun in your car.  In the greeter we use variables, strings, if and elif. The way it works if something happens then this happens however if that does not happen you use elif. To enable the computer know what the right answer is you use two equal signs. An important thing to remember is to always have a colon after an if or an elif and have the print indented.  To run you through the greater you start off with making a variable where the computer user will input its name using an input. The computer will ask what is your name and then there is a space to input it. The coding then goes on and if the name == Barry it would so go away however otherwise it would say hello please to meet you. We used these {} brackets because you can not mix a variable with a string.Screen Shot 2018-01-25 at 2.13.36 PM.png

The following class we developed our knowledge by learning how to input random integers, range and while loop. The extension was to create a counter which should allow a limited amount of tries. In order to make the computer be able to use random integer you first have to write import integer. In today’s class, we created a guessing game where you had to guess the number. The while loop has to end at some point. Therefore, you can see the while loop on this game will continue if the answer is not equal to the random integer and as long as the counter is below 4. != means not equal to. Then you continue with an if statement and use strings and print to make to computer say something when something happens. To enable to a user have another guess one has to make sure to add the input again.  To increase the counter you make counter +1. If the guess was too high it would say something and else it would say too ow if the guess was to low. and if the guess is correct it would say you got it however else it would say no more tries which makes the while loop end and you make the if statements end. You have to end the if statements with an else.Screen Shot 2018-01-25 at 2.26.55 PM.png

My highlight of this journey was making the BuzzFeed.

Screen Shot 2018-01-25 at 2.32.41 PM.pngScreen Shot 2018-01-25 at 2.34.33 PM.png

I always thought it was extremely complex however with the previous knowledge I was easily able to make it. Using print, strings, variable, range, if and elif you are able to make BuzzFeed. Letting the user choose between four choices and each choice has a number of points. Then the coding behind it is a total of points has a range and says your sport. The if and elif statements are used to make the computer know if that happens then those however else if this happens.

Our final coding project was making rock, paper, scissors. Using previous knowledge and how to use a computer with using import random integer and while statement and if and else if one is able to create rock paper scissors. I struggle with the counter but in the end, it workedScreen Shot 2018-01-25 at 2.45.06 PM.png

Overall, I think it is really good we learn coding at school since it is the new century and there is coding behind everything even thoguh we do not know the most complex at least we have more understadning of it. Personally, I would not go into computer science, because parts of this journey I did not enjoy. However, we learned a lot and I think everyone has the bases of coding.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s