/html>

Monday, June 1, 2009

Day 1 of Digital Currents

Today was the first day of camp. It was awesome! We held the first session in room 200 of the Atlas building. The first thing we did was "icebreakers." We played this game where as a group we had to move from one location to another while passing around numbered tennis balls in a certain way as a team building activity-- it got the group warmed up. :) The next thing we did was to come inside an be introduced to all of the counselhttp://amath.colorado.edu/courses/DigitalCUrrents/2009Sum/images/DigitalCUrrents.jpgors, and review what we'd be doing for the rest of the 2.85 weeks. We then had our first Applied Math lesson. In it, which lasted one hour, we reviewed the different types of numbers (whole, real, imaginary, irrational, complex, etc), and how they were related to each other. We then did a basic lesson regarding Venn Diagrams, how they are used, and why. We made logic-type comparisons which we solved using two-circle Venns, and then the lesson ended. We took a break, and then came and learned about the WYSIWYG part of Adobe Flash CS4, like the drawing tool, selection tool, etcetera. Then came lunch, which was fun. Lastly, we learned programming in Action Scripting, or the math and typing-based part of Flash. We edited the following script, which created a basic Venn Diagram program:

package {

import flash.display.*;
import flash.events.*;
import flash.geom.Point;
import flash.text.*;

public class Board extends MovieClip {

private var NUM_CIRCLES:int = 100;

private var NONE:int = 0;
private var PARTIAL:int = 1;
private var FULL:int = 2;

private var gameLegend:Legend;

private var circles:Array;
private var circleClickedId:int = -1;
private var mouseDownPos:Point;
private var createdCircleId:int = -1;

private var circleCount:int = 0;

private var conclusions:Array;

public function Board():void {

circles = new Array(NUM_CIRCLES);
conclusions = new Array(NUM_CIRCLES);

for (var i:int = 0; i < gamelegend =" new" x =" 377;" int =" 0;" circleclickedid =" i;">= NUM_CIRCLES) {
return;
}

// Since a shape was not clicked, we will be creating a new
// shape at this position
mouseDownPos = new Point(evt.stageX, evt.stageY);

var venn:VennCircle = new VennCircle(mouseDownPos);

// Get the spot in the array for the circle
for (var j:int = 0; j < createdcircleid =" j;" legenditem =" new" circleclickedid =" -1;" createdcircleid =" -1;" mousedownpos =" null;">= 0) {

// Move the object, but make sure it is still on the board
circles[circleClickedId].updatePosition(evt.stageX, evt.stageY);

// Update the conclusions to display the logic
// behind the venn diagrams
checkConclusions();

} else if (createdCircleId >= 0) {

// Need to update the size of the circle
var xDiff:Number = Math.abs(mouseDownPos.x - evt.stageX);
var yDiff:Number = Math.abs(mouseDownPos.y - evt.stageY);

if (xDiff > yDiff) {
circles[createdCircleId].setRadius(xDiff);
} else {
circles[createdCircleId].setRadius(yDiff);
}

checkConclusions();
}
}
private function deleteItem(evt:Event):void {

//trace("Board: Deleting Item: " + gameLegend.itemTBD);
circleCount--;
this.removeChild(circles[gameLegend.itemTBD]);
circles[gameLegend.itemTBD] = null;
}

private function checkConclusions():void {

// Loop through all of the circle and determine if they
// overlap with any of the other circles
for (var i:int = 0; i < int =" 0;" text = "" int =" 0;" int =" 0;" string = ""> 0) {
if (conclusions[i][j] == PARTIAL) {

tempTxt = "SOME " + gameLegend.itemText(i)
+ " ARE " + gameLegend.itemText(j) + "\n";

txtConclusions.appendText(tempTxt);

} else {
tempTxt = "ALL " + gameLegend.itemText(i)
+ " ARE " + gameLegend.itemText(j) + "\n";

txtConclusions.appendText(tempTxt);
}
} else {
tempTxt = gameLegend.itemText(i)
+ " ARE NOT " + gameLegend.itemText(j) + "\n";

txtConclusions.appendText(tempTxt);
}
}
}
}
}


private function calculateOverlap(cir1:VennCircle, cir2:VennCircle):int {

var pt1:Point = cir1.getPosition();
var pt2:Point = cir2.getPosition();
var rad1:int = cir1.getRadius();
var rad2:int = cir2.getRadius();

var retVal:int = NONE;

if ((Math.pow(pt1.x - pt2.x, 2) +
Math.pow(pt1.y - pt2.y, 2)) < (Math.pow(rad1 + rad2, 2))) { retVal = PARTIAL; // The two circles overlap, now we need to check and // see if one is completely inside of the other one if ((Math.pow(pt1.x - pt2.x, 2) + Math.pow(pt1.y - pt2.y, 2)) < (Math.pow(rad1 - rad2, 2))) { retVal = FULL; if (rad1 < retval =" FULL;" retval =" PARTIAL;" retval =" NONE;">

And then we created this blog! It was really fun, and I'm looking forward to day #2!

Best,
Carson Kahn
www.CarsonKahn.co.nr




1 comment:

  1. Carson,
    This was a very vivid explanation of your day and it sure is right up your alley. You are so fortunate to have the opportunity to be engaged in such an indepth, practical and innovative program. Finally, after all your requests for such a program it has appeared!
    Enjoy!
    SOK

    ReplyDelete