August 13, 2012
I probably should have used this weekend to look for work, instead, I did something way better. Despite suffering a cold, this weekend had to be one of my most productive weekends ever.
A new version of my HexColors example is now way more efficient. Instead of six loops, everything is done in three. Basically, three different hexagons are drawn at the same time.
Yes, computers do err in mathematics. Particularly when really, really, really large numbers come into play that are larger than what the preset datatypes can handle. But this was a fun program and something I had been looking toward completing ever since I was a teenager.
Today was a momentous occasion. A quiet victory and one step closer to much greater things.
My next version of Jill may have the next version of Poly integrated into it. At least the stable parts.
( !(val % 2) ? celleven : cellodd ).fill(ctx);
pascaltriangle.html and I love it!
To break it down, the
fill() function is actually a function I wrote that is a corollary of the
fill() function defined by HTML5 Canvas. My version is a more flexible and has some feature that make for effective Canvas development.
For example, when I think of Canvas's command for
theBike.fillStyle="red";theBike.fill();. My version is much less passive. I say "Red is the color of the bike." or
red.fill(theBike); where somewhere before that a
Brush object called
red has been defined using
var red = new Brush('#f00');. Thus I can apply
red to any object that needs this color applied to it.
theBike really just represents the 2D Context element that defines what pen to use to draw with. Which is why
Brush was such an idea name to define a class that takes care of simple strokes and fills.
test ? true : false) inside parenthesis it allowed me to use a function that is shared by two different objects of the same type. Overall, I like this statement and plan on using it in the future. (Besides, I wanted to put some more content into this post.)
Site updates should occur between now and then end of the month. I wish I could use HTML5 Canvas as background especially if I figure out how to make Mandelbrot and Julia fractals with Canvas. Now there would be some good code!