From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5225E090.9010706@gmx.de> Date: Tue, 3 Sep 2013 15:13:52 +0200 From: Friedrich Psiorz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: 9fans@9fans.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] a simple chess board for plan9 Topicbox-Message-UUID: 7956a3c4-ead8-11e9-9d60-3106f5b1d025 Great work! Maybe the mkfile could be improved a bit; I had to copy the images manually. And since you're asking for comments on your C style ... imho, most of it looks really good; maybe you could try to avoid deep nesting of control structures. if(cond1) { if(cond2) { ... } } should be changed to if(cond1 && cond2) { ... } and while(...) { if(cond) { ... } } should be changed to while(...) { if(!cond) continue; ... } Am 03.09.2013 14:06, schrieb Travis Moore: > I was a little surprised at the lack of chess resources for something > which came out of bell labs. I'm not about to contribute an engine, > but I did end up writing this graphical program to help me keep track > of my correspondence games: > > http://runjimmyrunrunyoufuckerrun.com/src/chessbd.tgz > > It doesn't check moves or anything, but it can load, save, and play > back games. It also accepts among its arguments a strict form of > portable game notation, so that you can, for example, run: > > chessbd 1.e4 c5 2.c3 e6 3.d4 d5 4.exd5 exd5 \ > 5.Nf3 Bd6 6.Be3 c4 7.b3 cxb3 8.axb3 Ne7 \ > 9.Na3 Nbc6 10.Nb5 Bb8 11.Bd3 Bf5 12.c4 O-O \ > 13.Ra4 Qd7 14.Nc3 Bc7 15.Bxf5 Qxf5 16.Nh4 Qd7 \ > 17.O-O Rad8 18.Re1 Rfe8 19.c5 Ba5 20.Qd3 a6 \ > 21.h3 Bxc3 22.Qxc3 Nf5 23.Nxf5 Qxf5 24.Ra2 Re6 \ > 25.Rae2 Rde8 26.Qd2 f6 27.Qc3 h5 28.b4 R8e7 \ > 29.Kh1 g5 30.Kg1 g4 31.h4 Re4 32.Qb2 Na7 \ > 33.Qd2 R4e6 34.Qc1 Nb5 35.Qd2 Na3 36.Qd1 Kf7 \ > 37.Qb3 Nc4 38.Kh2 Re4 39.g3 Qf3 40.b5 a5 \ > 41.c6 f5 42.cxb7 Rxb7 43.Kg1 f4 44.gxf4 g3 \ > 45.Qd1 Rbe7 46.b6 gxf2 47.Rxf2 Qxd1 48.Rxd1 Rxe3 \ > 49.Rg2 Nxb6 50.Rg5 a4 51.Rxh5 a3 52.Rd2 Re2 0-1 > > then use the arrow keys to step through Kasparov's game against Deep > Thought (press down, then right repeatedly). > > This is my first program in C, let alone for plan9, so any comments or > suggestions are most welcome, > > Travis >