Sonntag, 7. Oktober 2012

Random AI implemented

It's been a little quiet about meowBG lately, since I haven't had the time to program a lot. Besides, the meowBG project had reached a state where it's difficult to continue implementing, because things have grown a little too complicated to just sit down at my desk and hack a few lines of code.

I guess this is a state where a software project may die ... it just takes a little too much thought to get going. And the longer I put the project aside, the more difficult it became to continue coding.

But meowBG made it through that trough, and meanwhile I implemented a very dumb "bot" who will pick random moves from the list of possible moves. I reorganized the match structure, too, so that the game doesn't always assume a human player on one side of the board, but it is possible to register any two "player"-like objects at the match. This could be, of course, a human player, but might as well we a bot or a player on the other side of an online BG server like FIBS.

So I registered two of my bots to play versus each other. Check it out:


An idea that really excites me is to build a neural network using PyBrain as an opponent. Should meowbg fail as a FIBS/Tigergammon client, maybe this will become a different project.

Freitag, 10. August 2012

Clickable dummy finished

Things have progressed nicely so far, even though I took a little longer (as usual) to grasp some of the basic concepts of kivy. I managed to finish a clickable backgammon dummy in a few days. Check it out:


I made only legal moves in that video, but any move would have worked, like moving backwards, piling up checkers of different colours etc. It's only a dummy without any logic underneath. That's the task lying ahead: Connect the existing meowBG logic to the new presentation layer.

Mittwoch, 8. August 2012

meowBG going kivy

I'm on holiday right now, and the last days I've been diving into the kivy framework. Kivy looks very promising, especially with respect to its multi-platform support. There has even been a kivy app released on Apple's app store. Hacking for iPhone and iPad in pure python? Me gusta!

So, after I've become a little tired of how sluggish my dear meowBG looks in its wxPython based implementation, I'm now planning to move the graphics parts entirely to kivy.

I'm especially looking forward to making the checkers fly smoothly across the board - the part that made my brain hurt in wxPython. It may be my lack of knowledge of wxPython, but animating widgets in kivy is just a walk in the park. Kivy's approach to animations is interesting: You define the animation independently of the widget it is applied to, and just specify the attributes that the animation will change. For instance, changing the position with an animation could work like this:

animation = Animation(pos=(100, 100), duration=0.2)
animation.start(target_widget)

This would move the object behind target_widget to the position (100, 100) within a fifth of a second. And of course you could specify a callback function to be called when the animation has finished, by setting

         animation.on_complete = your_callback_func

Samstag, 30. Juni 2012

meowBG logo improved

I changed the logo colours, since the colour blue just didn't look natural beside a "wooden" board. Current version:




Apart from that I did some actual development and introduced two dialog windows: One that allows you to choose the target game server and input your credentials. The other one pops up when you invite someone and specify the length of the match. Nothing too exciting. 





Donnerstag, 7. Juni 2012

(me)meowBG

The buttons of the meowBG gui seemed a little too heterogeneous, since I downloaded their graphics from different sites. So I decided to try something completely different: Meme buttons.

For the three buttons I have, two choices were pretty obvious: The challenge accepted meme for the accept button and the "NO" meme for the reject button. But which one to pick for the undo button? That was a tricky one, and I finally picked the Neil deGrasse Tyson Reaction meme, which allows for the alternative interpretation "Oops, I'll probably take that one back".


I plan to make the memes an optional button layout eventually, since the crowds of people using my program may prefer less distracting icons.

Now how about changing the name of my app to "memeowbg" or "me²owbg" ... or, since the intersection of people loving those memes and people loving backgammon is probably {me}, even "{me}me²owbg" ... ah, never mind.

Sonntag, 27. Mai 2012

meowBG, a wxPython based backgammon client


A friend of mine is currently developing a backgammon server, and the idea of building a client was appealing, so I've started to expand my Python GUI programming knowledge a littler further and tried out wxPython.

A little background first: For reasons unknown to me, the name of the web server under development is "Tiger Gammon" (German site), and it's a nice alternative to FIBS, the First Internet Backgammon Server. Both servers communicate with clients over the telnet protocol, which seems odd at first. But when FIBS was born in 1992, that was probably the obvious choice. Tigergammon, on the other hand, strives to be a better FIBS, and thus uses telnet as well. So my client will have to follow that path.

In the meantime my wxPython client has grown pretty nice, but it's not ready for being shown off in public. But as of today, the client has its own splash screen, and I like it so much that I wanted to share it here. Since it's a client for tigergammon, I called it "meowBG", and when I found an old picture of our cat Alice sitting in a waste-paper basket, the logo just fell into place …



I ought to polish it a little more, but for my limited GIMP skills I guess that's as good as it gets. Should meowBG ever be released I may need a talented designer.

Posts about the client itself are soon to follow. Currently it looks like this ...


... which is not perfect but a decent start. Network play over either FIBS or tigergammon is already possible, but the user interface is still far from intuitive. Stay tuned!


Dienstag, 28. Juni 2011

An Ook! interpreter in Python

A recent geocache introduced me to an esoteric language named "Ook!", which was designed for Orang-Utans to communicate without arousing human suspicion.

It's pretty simple, as the language consists of only three syntax elements:
  1. Ook.
  2. Ook!
  3. Ook?
That's it. To make the language a little more powerful, elements are grouped into pairs, e.g. "Ook. Ook!" or "Ook? Ook.". So we have nine possible pairs and thus nine distinct commands, only eight of which are actually used ("Ook? Ook?" has been supplied with no deeper meaning ... maybe it's left for the Orang-Utan to express "WTF are you talking about?!").

When I felt an itch to implement an Ook! interpreter, I discovered that Ook! is all but identical to the well-known Brainfuck, since both languages have eight commands, and there exists a one-to-one mapping between them.

Furthermore, since Brainfuck is already a "minimal" language in that any command consists of one character only, I started off with the BF interpreter.

(Ok, to be totally honest, I started off implementing the Ook! interpreter, which eventually had bugs I wasn't able to track down anymore ... :) only then I realized what a stupid plan it was to begin with the Ook! part and started all over again, this time implementing the BF part first)

After finishing that, the remaining task was to implement a preprocessor which would turn an Ook! listing into a BF listing, and I was done.

If you're curious about the result, grab the code from github.

(It's my first project on github btw, and I absolutely recommend the github for mac application)