[nim-dev] Re: Bug in my GTK3 wrapper

  • From: Stefan_Salewski <mail@xxxxxxxxxxxx>
  • To: nim-dev@xxxxxxxxxxxxx
  • Date: Wed, 20 Jan 2016 23:24:40 +0000

I just did a stupid toy chess game...

http://ssalewski.de/tmp/toychess.png

Just to get some feeling for coding in Nim -- one motivation was, that I
recently discovered that unicode chess fonts exists.

Well, I wrote it from scratch, last weekend move generation as in a
precalculated way as known from gnuchess, a very basic board evaluation, and
alpha beta pruning as sketched in wikepedia. And yesterday the GTK board with
pango unicode pieces. Very basic still, but less then 300 lines of code, 100
kbyte executable size. Would have been much more source code and development
time in C. My feeling is that development in Nim is really as fast as in Ruby,
maybe even faster when I get more experience. And it is more fun -- chess in
pure Ruby would be slow of course. Maybe I will put sources to github at some
time -- but of course it is a pure toy project, there a hundreds of chess games
available :-)

Some remarks for the case that someone may use the GTK3 3.15.xx wrappers from
github: You dont have to run the generator scripts, they will not work with
latest GTK3.20 and latest c2nim. Just take the .nim files, they should work for
GTK 3.16 and never. And remember that you need all the wrappers from that
reposity. Today someone tried with old Nimrod pango, which gave problems. For
pango-cairo.nim you have to fix the library name from libpango to
libpangocairo, see https://github.com/StefanSalewski/nim-gdk3/issues/4.
Similar name change may be necessary for other pango related libraries.


Other related posts: