Monday, March 31, 2008

Some new stuff

Well, for the past 3 months, I've been working on a lot of things. Including some animations, some small games, and some web tools.

Anyways, I've cooked up a proxy for anybody that needs to get around school censoring system.
it's http://www.jjtchiu.com/go.php

I know it's not perfect, but it should work on 50%~60% of the websites.
I, however, will monitor the traffic. So don't go to illegal sites!

The next one is a new game. It's fairly small, but fun. It's called Nim.
Basically, there are some piles of stones. You can remove any number of stones from only 1 pile in each turn. The person that gets the last stone loses.

Play it here: http://jason.jjtchiu.com/flash/nim.html
See if you can beat the computer! Remember, if you make even ONE mistake, you will lose.

Sunday, March 30, 2008

Flash CS3

Just recently I got flash CS3. It has many exciting new features, but I'm having mixed feelings.

For one thing, ActionScript 3.0 is... urm... really different. I liked the way AS2 was - fast development, and easy to write. But then... when it comes to AS3.0, everything changed. So different,

The movieclip hierarchy is now a completely different package. For example, instead of createEmptyMovieClip(), you call "var my_mc = new MovieClip();" and then "myParent.addChild(my_mc);"

Event handling is also different. The ECMAScript-style "my_btn.onrelease = function()" is obsolete in AS3.0. You now have to create a function "function my_btn_release()" and then "my_btn.addEventListener(MouseEvent.CLICK, my_btn_release);" It's cumbersome and time consuming.

Also, lots of freedom and advantage of AS2 is now gone. Variable typing is necessary, and it is also necessary that no variable referenced is undefined.

The only major improvement is... performance, sometimes by 5 folds or even 10 folds. I consider it really good, but seriously, flash applets rarely need such high performance. I mean, it certainly opens up possibilities for things such as 3D rendering and bitmap manipulation. However, for most needs, AS2 will be faster to develope for small program complexities. *hope it doesn't become deprecated in the future*

Tuesday, December 11, 2007

Flash is slow, notoriously slow

I implemented merge sort in flash, and then compare it to others.

Action: sorting 5000 random numbers in an array

Merge sort - 3.4 seconds
Flash's built-in sort - 0.15 second
Bubble sort - 38.5 seconds (yeah, don't use bubble sort! It's way too slow!)

Merge sort is one of the fastest (others are quicksort, heap sort, ...etc) sorting algorithms (speed = n log n), and yet, compared to the built-in sorting method, it is 20 times slower.


Also, Flash is bad at math.

It takes about a minute to render an image of the Mandelbrot set in Flash.

I use almost the same method, but coded in Paint.NET's codelab, it produces an image 100 times the size, 10000 times more detail, lots of coloring calculation, and with half the time.

Recently, working on a flash 3D engine project, Flash slows down just by doing a few (maybe 20~30) trigonometry calculations (sin/cos only).

It's a real frustration.

*hopes to upgrade to Flash CS3 soon*

Wednesday, December 5, 2007

Age of Wars

http://www.maxgames.com/play/age-of-war.html

Very nicely done game indeed.
At the beginning, it might be hard, but it isn't really.
The last level can be won by only ion-rays.

A guide to beat impossible:
1. wait for enemy to line up and then use special
2. build an egg-automatic
3. keep sending in club-mans so that the enemy doesn't hit base
4. build more egg-automatics as soon as you have enough money (be sure to leave enough for club-mans)
5. DO NOT evolve until the first tank appears. Keep sending in club-mans as fast as you can
6. when the first tank appears evolve to future age and buy

Thursday, November 29, 2007

Grade 10 Math

Just a week ago, I got accepted into the grade 10 math program (I'm currently in grade 8). As a result, I get to go to senior school for specific math sessions and miss a few middle school classes. Recently I just had my first unit test, and it went pretty well. There's nothing too difficult, and provides sufficient challenge and interest for me. Overall I'm pretty satisfied with the arrangement.

Wednesday, November 14, 2007

Mean Chefs...

Seriously, one of the obese chefs in the cafeteria was really mean on student cards. If we forget them, we cannot enter studentID number, and we must go back to boarding house and get a permission slip from a houseparent. His agitation peaked when the internet connection broke; he was shouting in really high voices and he looked like a cartoon character.

Tuesday, November 6, 2007

Exams & Homework

Sometimes they are a bit overwhelming, especially if you are a boarding student, which have a very strict timetable. Especially when reportcards are due... all the sudden it's a boom, and then, the next day, there's literally no homework because of long weekend.