For my
final blog post I am going to talk about computer science. To help me explain such a broad topic, I am
going to use a program I wrote a few months ago that simulates a game of
checkers when you run it and, due to a limited amount of space, I can only briefly
talk about the concepts behind this program. Since Computer Science and the
program I'm using as an example are both very complex topics, I'm going to
primarily focus on the way a computer thinks when it compiles code. Before I
can go on to explain checkers, I would like to talk about how computers think
and function very briefly. A computer can't look at a situation and assess it
like we can as humans. A computer can
only recognize two things: whether a condition is true or false. To best show
what this means, you can look at binary. Our number system is called
decimal. It has ten digits and is easy
for us to understand because we can count to 10 on our fingers and it's a
fairly simple system. Binary is different in the sense that it only has two
digits--0 and 1, 1 being true and 0 being false. At the end of this post I've
linked a video that explains how to convert from decimal to binary for those
who are interested in the topic.
Since a computer can only recognize things as
true or false, you have to keep this in
mind when you construct the game board. To do this, I used something called a
two-dimensional array or a matrix. A matrix is like a grid where it has two
values (an x and a y) and it uses those two values to find the place in the
matrix you're looking for, then it returns that information. I've posted a picture of the matrix bellow.
As you can see, there are four different values on the board: an X which represents the spaces you can't "jump" your pieces to, an empty space which represents the empty places on the board, a capital O which represents one player's pieces, and a lowercase o which represents the other player's pieces. Now that I have a board created, the next step I had to take in writing my program was taking this matrix and making a visual representation of it as a game board. To do this, I used text and something called a loop. A loop is a type of function that will repeat itself until its condition is false.
Unfortunately due to a lack of space I could only briefly
describe to concepts of this program. Other parts of this program include:
selecting a piece to move, returning move options for the selected piece,
identifying when a player can jump another piece, identifying the possibility
of multiple jumps, and also implementing the king piece.
https://www.youtube.com/watch?v=Q2UgMYwWiO4 - David
Williams: Base 10 to Base 2 (Decimal to Binary) Conversion
I think Alex's topic is one that is interesting and a good read since he seems to have a liking/passion for the topic. Having used his own program, it was easier for him to explain and thus made it easier for us as readers to grasp the concept. As a person who knows nothing about how computers work, this topic was still a bit confusing. The binary code sounded familiar and how computers use this code to create determine whether something is either true or false. I liked Alex's idea of running a checkers game through his program. It is an interesting game to look at and to see how a computer program looks at the game. The way a computer and a human look at a game like checkers is completely different. Human's think ahead, have a strategy and a way they like to play. A computer, as Alex mentioned, can only determine true or false. I enjoyed reading about Alex's topic and it was intriguing reading about a topic he is invested in. The only wish I have is that I understood computers better to get a better gist of all the little facts Alex included in his post. I think this knowledge would be useful not only for thus post, but in general life.
ReplyDeleteI would like to start off by noting how impressed I am that you wrote your own computer program; the topic you chose to write over is obviously a huge interest for you. As for the explanation for the program, I am a little confused, but I know very little about computers and how they work. I also got lost while you were relating the program to checkers, but I have played online checkers before and I’d imagine your program is similar to the algorithm the websites use to play the games. I think this idea is so neat and fun especially because of your level of interest in it.
ReplyDeleteI think it is super cool that Alex seems to have taken a liking to writing computer programs. It is really impressive mainly because I have seen two of his programs and neither make much sense to me, but he seems quite passionate about them. I also find it interesting that he can create a checkers simulation on the computer. Like I said earlier I do not really understand computer programming and due to limited space he obviously could not go into great detail, but creating a “robot” opponent so to speak is very interesting. All in all, Alex did a great job.
ReplyDeleteJust by reading this, it’s clear that Alex has a passion for programing. It is impressive that just in one class he could write a program that works and it is impressive how easy he makes it look. With that being said, I know nothing about that type of stuff and the subject is rather confusing for me as a whole. I’m sure to someone who understands computers and programs that this would be clear to them but sadly not to me. Alex did a good job of explaining the step by step process that he created I just cant get a grasp on the whole thing.
ReplyDeleteJust by reading this, it’s clear that Alex has a passion for programing. It is impressive that just in one class he could write a program that works and it is impressive how easy he makes it look. With that being said, I know nothing about that type of stuff and the subject is rather confusing for me as a whole. I’m sure to someone who understands computers and programs that this would be clear to them but sadly not to me. Alex did a good job of explaining the step by step process that he created I just cant get a grasp on the whole thing.
ReplyDeleteI think it is impressive and simply awesome that Alex was able to create a program like this and the knowledge behind doing this is very interesting to me. This blog post was very interesting and I am still clueless on how Alex was able to create a program like this, it seems a lot more challenging than he made it seem. I wish I understood computer programming a lot more than I do because this post would make even more sense to me if I could grasp this concept a bit better. This would be something I would like to research and learn more about.
ReplyDeleteThis must have taken a lot of dedication to learn computer science and then apply it to make your own codes. I was very impressed by what you accomplished when showing us in class. It feels like you have to learn an entirely different language. As I read through your post, it didn't seem as confusing as it first appeared. You did a great job breaking down the coding and explaining the parts. I’ve always had an interest in computer science, but always thought it would be too difficult or advanced for me. After reading this post, maybe I’ll look into some basic computer science after finals!
ReplyDeleteI can tell from this post that Alex really has a passion and a knack for coding. I, on the other hand, I am the exact opposite. This resulted in me being pretty confused as I read Alex’s post. This being so, I did my best to push through. It was hard, but it was very interesting. I think it is amazing how far we have come with technology, both creating it, and applying it to things that help society. I also think it is interesting that all the functions of a computer can be communicated to it with just the use of two numbers.
ReplyDeleteI’ve always been interested in computer science and writing code for programs I’ve just never put in the time or effort into the field. In high school I took a web design class which I know is very different than writing a code for a working game of checkers, but still has many of the same elements. Alex did a good job explaining how his program works and it really got me interested in maybe getting back into the computer science field. What makes this post so cool is this code was all written and made by him, I find that really inspiring and cool.
ReplyDeleteIt's so amazing how you can dissect and determine call of this coding and programming! I think you did a great job of explaining your processes and how the game works with code, although, being a non-analytical / quantitative-brained person, I still found it a bit difficult to follow (which is not your fault at all - it's not you, it's me). It's really great that you have such a passion and talent for coding and computer science because it's surely going to be a very important thing to be good at in the approaching years of technological advancements! I agree with Vito about the inspiring part - it's very inspirational to see someone my age create such a seemingly complicated program out of just numbers and commands.
ReplyDeleteI am terrible at computers and usually just play around with things until I get the outcome that I want. The fact that you took time and effort to write your own program is pretty cool, especially because I couldn’t do it myself. I enjoyed that you broke down the program into the simplest way because I know nothing about computer programming. Likewise, the more times I read the post I found it easier to comprehend and understand a little about the program itself. I found it amazing that humans and computers have two completely different ways of thinking about a simple game like checkers.
ReplyDeleteI think since he used something that he made he did a better job explaining this than anybody could have. I haven't been big into computers, but have been getting more and more involved into them since arriving to college. I thought this was a very interesting read since I know so little about computers and how they function. Since the field of technology is continuously changing this would be a very good field to get into and it seems like he has a passion for it and that is good. There will always be jobs involving this kind of thing that only certain people will be able to do. For how vaguely he was able to describe is program do to lack of space I am glad that it wasn't in full depth because this concept was hard to understand let alone the whole program and the details on how it works.
ReplyDelete