Difference between revisions of "IB Computer Science 1"

From WLCS
Line 1: Line 1:
 +
== Friday (3/28/14) ==
 +
'''Agenda:'''
 +
* Test your 1-player Tic-Tac-Toe game
 +
* Spend today improving the computer's move algorithm
 +
** i.e. can you improve the computer's AI?
 +
 +
== Wednesday - Thursday (3/26/14 - 3/27/14) ==
 +
'''Agenda:'''
 +
* Computer AI Walk-through
 +
 
== Monday - Tuesday (3/24/14 - 3/25/14) ==
 
== Monday - Tuesday (3/24/14 - 3/25/14) ==
 
'''Agenda:'''
 
'''Agenda:'''

Revision as of 13:37, 28 March 2014

Friday (3/28/14)

Agenda:

  • Test your 1-player Tic-Tac-Toe game
  • Spend today improving the computer's move algorithm
    • i.e. can you improve the computer's AI?

Wednesday - Thursday (3/26/14 - 3/27/14)

Agenda:

  • Computer AI Walk-through

Monday - Tuesday (3/24/14 - 3/25/14)

Agenda:

  • Complete and demo Tic-Tac-Toe (it is late at this point)
  • Planning the Tic-Tac-Toe Artificial Intelligence
    1. Play Tic-Tac-Toe with a partner and document the priorities of your moves
    2. What is the first strategic move you look for?
    3. What is the next strategic move you look for?
    4. Are there defensive moves/checks that you look for? Describe what exactly you are checking.
    5. Are there offensive moves/checks that you look for? Describe what exactly you are checking.
  • Plan using commented pseudocode, the different types of functions that you will create for the artificial intelligence. Describe each of the functions that you will need for your computer AI

Tuesday - Friday (3/18/14 - 3/21/14)

Agenda:

  • Complete and demo Tic-Tac-Toe by the end of the week
  • If you are done with Tic-Tac-Toe, then copy and paste your code to create a 1-player version
    • The 1-player version of Tic-Tac-Toe should allow the computer to automatically take a turn and move
    • The simplest way to do this would be to create a new function where the computer makes a move by evaluating the current board

Thursday - Friday (3/13/14 - 3/14/14)

Agenda:

Tuesday - Wednesday (3/11/14 - 3/12/14)

Warmup:

  • Take out a piece of paper
  • Draw the figure on the board
  • Determine all the red points of interest

Agenda:

Monday (3/10/14)

Warmup:

  1. With a partner, play Tic-Tac-Toe
  2. While you are playing Tic-Tac-Toe, create a flowchart to diagram a Tic-Tac-Toe program design
  3. After your flowchart, list variables and functions that you will need to create for your game

Agenda:

  1. As a class, we will create the pseudocode for the Tic-Tac-Toe program
  2. After each line of pseudocode, we should ask ourselves:
    • What variables do we need? or what pieces of information must we track?
    • What functions do we need? What exactly do they need to do?
    • Is there something in this step that we do not know how to do?
  3. 2D coordinate math
    • Assume you only have the variables cHeight and cWidth
    • On paper, calculate all the points of interest in Tic-TacToe using cHeight and cWidth
  4. Create the drawBoard() function that draws the Tic-Tac-Toe board
    • You MUST draw the board using the cHeight and cWidth variables (i.e. NO HARD CODED coordinates)

Friday (3/7/14)

Agenda:

Wednesday - Thursday (3/5/14 = 3/6/14)

Agenda:

  • Demo/show Mr. Bui and missing assignments
  • Introduction to HTML Canvas
  • Canvas Practice Assignment
    1. Create an HTML+JavaScript file named canvasPractice.html
    2. Use the skeleton template from Basic usage of Canvas
    3. Refer to W3Schools HTML5 Canvas for specific functions that will be helpful
    4. In the canvas, draw a stick figure with filled in squares or rectangles for hands and feet
    5. Under the stick figure, display a text message in the canvas that says "Computer Science Rocks!"
  • Canvas + Mouse + Events
  • Mozilla Web Event Reference
      var setup = function()
      {
        var canvas = document.getElementById('canvas');
        var ctx = canvas.getContext('2d');
        var windowRect = canvas.getBoundingClientRect();
        
        var drawRect = function(evt)
        {
          ctx.fillRect(evt.clientX - windowRect.left, evt.clientY - windowRect.top, 20, 20);
        };
        
        canvas.addEventListener('click', drawRect);  
      };

Friday (2/28/14)

  • Paid Focus Group Opportunity
    • MediaBarn is having a focus group study at 5:30pm on Tuesday (3/4/14). They are interested to talk with students who are interested in majoring in IT/Computer Science/any related topic.
    • 90-minute focus group, and the compensation is $100
    • Registration Here
    • Mediabarn Research Services (near Courthouse metro), 2200 Clarendon Blvd, Suite 1200, Arlington, VA 22201
  • Make sure that you have completed While Loops
  • Make sure that you have completed Dragon Slayer
  • Introduction to HTML Canvas
    • Read and complete the tutorial: Basic usage of Canvas
    • Don't worry if you don't understand everything...this most important part is getting the A skeleton template
    • Also refer to this documentation: W3Schools HTML5 Canvas, which will explain different parts of the template
    • If you're interested more canvas tutorials can be found here: Mozilla Canvas Tutorials
  • Canvas Practice Assignment
    1. Create an HTML+JavaScript file named canvasPractice.html
    2. Use the skeleton template from Basic usage of Canvas
    3. Refer to W3Schools HTML5 Canvas for specific functions that will be helpful
    4. In the canvas, draw a stick figure with filled in squares or rectangles for hands and feet
    5. Under the stick figure, display a text message in the canvas that says "Computer Science Rocks!"

Wednesday - Friday (2/26/14 - 2/28/14)

Warmup:

Agenda:

  • Paid Focus Group Opportunity
    • MediaBarn is having a focus group study at 5:30pm on Tuesday (3/4/14). They are interested to talk with students who are interested in majoring in IT/Computer Science/any related topic.
    • 90-minute focus group, and the compensation is $100
    • Registration Here
    • Mediabarn Research Services (near Courthouse metro), 2200 Clarendon Blvd, Suite 1200, Arlington, VA 22201
  • Demo Quadratic Formula web app
  • Complete While Loops
  • Complete Dragon Slayer
  • Introduction to HTML Canvas
    • Read and complete the tutorial: Basic usage of Canvas
    • Don't worry if you don't understand everything...this most important part is getting the A skeleton template
    • Also refer to this documentation: W3Schools HTML5 Canvas, which will explain different parts of the template
    • If you're interested more canvas tutorials can be found here: Mozilla Canvas Tutorials
  • Canvas Practice Assignment
    1. Create an HTML+JavaScript file named canvasPractice.html
    2. Use the skeleton template from Basic usage of Canvas
    3. Refer to W3Schools HTML5 Canvas for specific functions that will be helpful
    4. In the canvas, draw a stick figure with filled in squares or rectangles for hands and feet
    5. Under the stick figure, display a text message in the canvas that says "Computer Science Rocks!"

Monday - Tuesday (2/24/14 - 2/25/14)

Agenda:

Thursday - Friday (2/20/14 - 2/22/14)

Agenda:

  • Pythagorean Theorem Example
    1. There should be input boxes for a, b, and c (hypotenuse)
    2. The user should be able to fill in any two boxes, and hit calculate
    3. The empty input box should be filled in with the correct answer
    4. You should validate the input for non-numbers
  • Quadratic Formula Program
    1. Create a program that takes three inputs: a, b, and c
    2. Calculate the quadratic formula
    3. Check if the solutions are real or imaginary
    4. Output the 2 real solutions, and either output the imaginary solutions or put a message that says the solutions are imaginary

Tuesday - Wednesday (2/18/14 - 2/19/14)

Agenda:

  • More Javascript + HTML Form practice
    • Slope Calculation Example
  • parseFloat()
  • parseInt()
  • isNaN()
  • JavaScript Math

Thursday - Friday (2/13/14 - 2/14/14)

  • Snow Days

Monday - Wednesday (2/10/14 - 2/11/14)

Agenda:

Thursday - Friday (2/6/14 - 2/7/14)

Agenda:

Monday - Wednesday (2/3/14 - 2/5/14)

Agenda:

Archives