April 10, 2015

Week of 04/05/15 - Python Part 26: Finished Up

    This project has taken up a lot of my time. So, to just finish it and move on, what I'm going to do is remove the references to the row and the column, because I can't get them to work outside of the turn() function. So what I'm going to do is have it check every row, column, and diagonal every turn. On Monday, I had tried moving most of the contents of the turn() function to outside it, but I didn't know what it did, so I just reverted everything back. Now, I've made the code look like:

    def column_checker(column, board):
        if board[0][0] == board[1][0] == board[2][0] \
        or board[0][1] == board[1][1] == board[2][1] \
        or board[0][2] == board[1][2] == board[2][2]:
            return 1
        else:
            return 0


    I was testing it with my friend Felipe, who sits next to me in class, and it works how it should. I'm probably going to test it out with a few other people later. But now that I have that project out of the way, I kind of want to move away from Python. I've been doing this for the past semester and a third. I want something new. I want to learn something more lower level. I want to learn C or C++.

    On Friday, the morning was spent figuring out which one to learn; I decided to learn C++ because it can make programs with a GUI, and is a pretty common language. I'm going to learn using the website http://www.learncpp.com because I saw it recommended on several websites, including stackoverflow.

    The tutorial starts out with explanation of instruction sets in binary, assembly, and then higher level languages. For higher level languages it described compilers and interpreters. Then it goes into a history of C itself. I didn't know that because C was so portable, able to compile on many different types of computers, that Ken Thompson and Dennis Ritchie rewrote Unix from assembly to C. A formal standard for C was created by some committee in the 80's, and C++ was developed as an extension to C in 1979, but C++ was only ratified in 1998; a new version, C++03, was ratified in 2003, and C++11 was ratified in 2011. The site says it teaches C++03, and any additions by C++11 will be in the appendix. It also says that C++ is object oriented.

No comments: