Python

Python is a program that you can program to play games. The game that I taught it how to play was was the number game. Basically the computer would think of a number between 1 and 100 then I would have a pre determined amount of guess to figure it out.

The picture above you can see the code for the game. This code will cause the computer to pick a number between One and Hundred. You will have 15 guesses to get it right. If you are wrong with in those guesses it will tell if the number is higher or lower. The picture below shows what the code will respond like.


Snowflake


The code above goes for the making a snowflake in Python. You must type in all the code or the program will question what you are referencing. It should automatically spawn a turtle with it's pen down. The snowflake will end up looking like the picture below. It was very so work hard and try to figure out how to make the computer understand what I want it to do.


Rock, Paper, Scissors


In class on November first we did more coding on Python. We had to teach our computer to play Rock, Paper, Scissors against us. In the code below you can see what we had to write for it to understand. I converted Rock, Paper, Scissors into number, 1,2,3. This made it possible for the computer to tell you if you won or not. I was also able to make it understand if there was a tie. If there was a tie it would start the game over.