2008年3月30日星期日

Maze

I wanted to write a maze game application long ago before the Web was born. But I did not have enough computer knownledge to figure out the algorithm to create a "prefect" maze. I thought since I did not study in computer science, there might be no way for me to make it. I even did not know what algorithm is that time. I gave up.

Until these days, as my computer knownledge grows, I suddenly figured out the algorithm. I created the maze programme. Played the mazes and had fun and also upsetted when I was lost in the mazes feeling hopeless. Oh no, how can a maze game without solution and hints provided. Right, I didn't write the solution yet!

I tried many times in many ways but all failed. I had to give up again. Really give up, I said to myslef.

However the problem was still hanging around on my mind untill, finially, I got something. There was still hope. I reconstructed my logic. Solved some minor bugs and built the solution path.

I have to thank Javascript. Without Javascript, I don't know I can write the maze game or not. Javascript is the most fantastic language for building application prototype.

The story I really want to tell is some feelings I have got when I wrote this maze and playing with it. I found when I was lost and lost hope in a huge maze, if I still could hang on, I could always find the way out, just like I could finish writing this maze game.

Finally, the most important words I want to say:
No matter what trouble you are in, don't bother your head about it. Somehow there should be a way to solve your problem. That time will come. If the time is not yet come, come here and play a huge maze. Don't give up. You should always can find a way out in the maze. After you have made it, you may also find a way to solve your problem. You may get hints to solve your problem when playing the maze. Good luck.

2008年3月28日星期五

迷宮

很久以前在沒有互聯網的時代,就有寫迷宮遊戲的打算,可是良久都想不到建構一個“理想”迷宮的演算法。唉!自己又不是念電腦學的,放棄吧!那時連什麼是演算法都不知道呢!放棄了,放棄了。直至近日,不知怎樣來的靈感,可能是自己的電腦知識有進步吧,想通了建構迷宮的演算法。很開心,興奮。

在玩自己寫的迷宮時,很開心,很興奮。可以隨時玩很大很大的迷宮。以前是沒有這麼多機會,玩這麼大的迷宮,在這麼大的迷宮中迷路。能逃出迷宮,很開心;迷了路,很徬徨,無助。

對!無助!我還沒有寫出迷宮的解題的部分!

怎樣寫呢?想!想!想!想了很久。試!試!試!試了很多次。都一一失敗,最後感覺到絕望。又一次要放棄!半途而廢的人是最無用的人。唉!真沒法子,電腦知識進步了也寫不了,不想真真正正放棄也不行!

說是放棄了,但腦海中還在斷斷續續的思索。數日後,偶然想想,突然有一閃靈光。於是重新整頓思維,解決了一些小難題後,解題部分終於完成了。

不可不提,要多謝 JavaScript 。沒有 JavaScript ,這個網頁真是不知會否面世。

說了這麼多廢話,其實是想表達一些寫這迷宮及玩迷宮時所得的感受。

原來迷宮與砌圖及一般遊戲不同,情況不妙時,如果不正視問題,只會越弄越壞。但是,無論迷宮有多大,在迷宮中如何失去方向,甚至信心,但只要能堅持,重整旗鼓,是一定可以找到出口的。 (其實,在“理想”迷宮中,就有一個很簡單的方法是一定可以找到出口的。) 我在寫此迷宮的過程中,就多次像在迷宮裡失掉方向、信心,亂了陣腳,多次認為完成不了,多次要將思潮折返,重新整理,不屈不撓,才能令這迷宮面世。

所以,最後,最重要的一句說話。如果你遇上任何挫折,工作上或生活上有任何不如意的時候,請到這裡,選一個最大的迷宮玩一玩。之後,你可能會發現你的所遇到的難題並不太大。或者可能在玩迷宮的過程中,領略到解決問題的方法。