I'm a missionary in Japan. The name of my mission agency is WEC International. That's supposedly Worldwide Evangelisation for Christ, but I think I have a better idea about what it stands for...
2008-06-21
Javascript go board, part 2
So the other day I wrote a Javascript go board.
First, it had a few problems with the rules and liberty counting, and I've ironed those out. Now as I said before, what I actually want is a go problem application for the iPod, and to get that working, I'd need to be able to read in Go problem files. Go games are stored in a format called SGF. The next step to my go problem application, then, is a Javascript SGF parser. So... you guessed it.
Here's a second version of the Javascript go board, this one will pull in an external SGF file and replay it move for move.
2008-06-12
Javascript go board
I had four things I wanted to do today. I've done two of them and I've started on the third but I'm probably too tired to actually finish it. Unfortunately, the third is the one that I actually have to do today, my sermon for Sunday. So what have I been doing instead? Um, well, messing with Javascript, actually. (OK, I also spent some time helping a local evangelism group learn how to improve their Internet communication, and I spent the afternoon with the old guys in the local community center, so it wasn't a complete messing-about day. But there certainly was some messing-about in it.)
Well, to be honest, I see messing about with Javascript as part of keeping my hand in with the latest technologies, which is useful both for me personally if I need it for professional work, and for the mission as I am frequently called upon to do various computer jobs for them. Even a relatively old technology like Javascript has undergone a seismic shift in the way it's been used and understood, from being a hackabout way to get web sites to do something interesting into being a fully-fledged dynamic programming language with object-orientation and complex data structures.
I've known that Javascript was something that I need to spend some time re-learning, and so I set myself a challenge. (This is the best way to learn or re-learn a programming language - to have something specific you want to do, rather than follow other people's tutorials which don't relate at all to your own goals.) And my challenge is to do with Go.
I study Go (baduk in Korean, weiqi in Chinese, igo in Japanese, and pretty much impossible to Google for in English), a Chinese strategy board game which is very popular here in Japan. It's both a good way for me to relax and to meet and get to know some of the older folks in town. As part of my Go studies, I have a bunch of books of Go problems, which give you an isolated portion of a Go game and ask you to look ahead several moves and come up with the best sequence. The books will tell you several possible enemy responses for your moves, so if you make bad moves, you will be shown why they are bad. One computerised version of this idea is at goproblems.com.
But that particular site requires quite a lot of processing firepower to get going: first, you need a Java client, and second, you need to be connected to the Internet. What I want is a problem engine which can run as an off-line application on my iPod, and for that, the best way is to write it in Javascript. (OK, we can debate whether that's really the best way, but it's certainly the best way for me.)
As a first step to a full-blown Go problem engine, it'd be nice to have a Javascript class which models a Go game, knows when stones have been taken, and so on. So (you guessed it) I wrote one. Please see this page for a very-much-prototype, Javascript-only Go board simulator.
| « | 2008-08 | |||||
|---|---|---|---|---|---|---|
| S | M | T | W | T | F | S |
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | ||||||
lathos: Going from iPod 1.x to 2.x and severely regretting it.





