Thursday, April 10, 2014

Tic Tac Toe

I fixed the positioning of the x's and o's but I still can't figure out how to prevent the x from changing to an o. I tried to put in a statement that would check but either it doesn't work or I am not putting it in the correct place.

if (!$(this).hasClass("o")) || (!$(this).hasClass("x")) {

Wednesday, April 9, 2014

Tic Tac Toe

Here is the newer version of my game
I would say that if I could just fix the toggle then it would be fully functional. Although, I could make it look nicer like by centering the images, making the grid bigger, etc.

Monday, April 7, 2014

JavaScript

Questions
  1. What does the following expression evaluate to "var answer = (((3 * 90) === 270) || !(false && (!false)) || "bex".toUpperCase() === "BEX");"?
  2. Write a switch statement that uses 2 cases and a default.
  3. Create an object with 2 properties either using object literal notation or constructor notation.
  4. Access any property of the object "dog" using either bracket notation or dot notation.
    • var dog = {
        species: "greyhound",
        weight: 60,
        age: 4
      };
  5.  Make a method for an object, "rectangle", to change its height.
    • var rectangle = new Object();
      rectangle.height = 3;
      rectangle.width = 4;
Also, I tried to have the items in my to do list highlight when the cursor hovered over them but instead it highlighted the entire list. You can take a look at it but I will likely remove it later unless I can make it look better.

Friday, April 4, 2014

Tic Tac Toe

I got the game working for the most part but there are a couple of problems:
  1. When a shape is put into the grid it hugs the border when I would like it to be a bit smaller than the spot it takes up. I also had to change the circle to a square otherwise the border of the table would wrap around the circle.
  2. If you click on the green square when the red square is queued up it will replace the green square. 
    • .circle{
          background-color:#00CC00;
          //border-radius: 100%;
          width:90px;
          height:90px;
      }
      .square{
          background-color:#FF0000;
          width:90px;
          height:90px;
    • I noticed that whichever style is first is the one that will be replaced. I think both these things have something to do with CSS specificity but I don't quite know.
I forgot to do my JavaScript questions but I am committed to doing it next week!

Thursday, April 3, 2014

jQuery

I added some more to the To Do list, you can see it for yourself here. The only problem I currently have with it is that there is an empty bullet point.

I started on the friends list, although I did not get a lot done, but I do have all of tomorrow to work on either that or the tictactoe game.


Wednesday, April 2, 2014

jQuery

I finished up the lesson and I added the to do list to my web page. I added a bit of CSS to it to make it look better but I will have to go back to it and add more later.
http://students.gctaa.net/~snicholakos/webgraphics/todo.html

Tuesday, April 1, 2014

JQuery

I tried out the toggleClick function but I wasn't able to get it working so I moved on to the lesson. I've finished most of the lesson and I'm hoping that by the end of it I may be able to fix my game.

This lesson mainly talked about messing with the html using JQuery
  • $(document).ready(function() {
        $("#text").click(function() {
            $(this).addClass("highlighted")
        });
    });
    • For example this function adds a class to text which adds CSS to it giving it a highlighted effect(removeClass does the opposite)
  • $(document).ready(function () {
        $("body").append("<p>I'm a paragraph!</p>");
    });
    • This simply adds a paragraph to the end of the body, alternatively prepend would put it at the start
  • remove gets rid of an element completely while empty gets rid of its contents