2 years agoImplement automatic pass (when there is no legal move) and end-of-game master
Carl Worth [Thu, 5 Dec 2013 01:35:07 +0000 (17:35 -0800)]
Implement automatic pass (when there is no legal move) and end-of-game

Along with a simple report of the score and the winning player.

This is obviously much better than the hidden UI of requiring a
right-click to pass (and the bogus option of allowing a pass when a
player has a legal move).

2 years agoClean up some errant trailing whitespace.
Carl Worth [Fri, 24 Apr 2020 21:27:30 +0000 (14:27 -0700)]
Clean up some errant trailing whitespace.

Clearly I didn't have my editor configured to show this in bright red
when I wrote the offending code!

2 years agoAdd a new dvonn_board_cell_owned_by function
Carl Worth [Fri, 24 Apr 2020 21:27:24 +0000 (14:27 -0700)]
Add a new dvonn_board_cell_owned_by function

The compiler was warning that we were comparing enums of two different
types. That's true—we are, but that's because the values for
dvonn_cell_t are declared by reference to dvonn_player_t values.

Anyway, rather than cluttering up the code with lots of casts to
silence this warning, here we add a new function that takes care of
that cast, leading to more readable code.

2 years agoFix compilation by putting libraries late on the command line
Carl Worth [Fri, 24 Apr 2020 19:08:18 +0000 (12:08 -0700)]
Fix compilation by putting libraries late on the command line

Again, I don't know what changed in the compilation toolchain, but
apparently to get compilation to work now, we need to put libraries we
depend on after the object files that depend on them.

2 years agoExplicitly link against math library
Carl Worth [Fri, 24 Apr 2020 17:30:40 +0000 (10:30 -0700)]
Explicitly link against math library

I don't know what in the toolchain (or dependencies) changed such that
this is required now when it wasn't before, but here it is.

13 years agoAdd simple text indicating whose turn it is to place or move.
Carl Worth [Sat, 7 Mar 2009 01:29:01 +0000 (17:29 -0800)]
Add simple text indicating whose turn it is to place or move.

13 years agoAdd several TODO items
Carl Worth [Thu, 5 Mar 2009 20:01:10 +0000 (12:01 -0800)]
Add several TODO items

13 years agoDon't let one player place the opponent's pieces
Carl Worth [Thu, 5 Mar 2009 19:56:13 +0000 (11:56 -0800)]
Don't let one player place the opponent's pieces

The program is now aware of a dual-window mode and restricts
actions to the window belonging to the current player.

13 years agoAdd support for dual-display mode
Carl Worth [Thu, 5 Mar 2009 19:27:18 +0000 (11:27 -0800)]
Add support for dual-display mode

If we can connect to localhost:10.0, then create a second window
and send it there. Otherwise, just use a single window.

13 years agoRemove useless linking against loudmouth
Carl Worth [Thu, 5 Mar 2009 19:25:52 +0000 (11:25 -0800)]
Remove useless linking against loudmouth

13 years agoEliminate stacks disconnected from red DVONN pieces
Carl Worth [Thu, 5 Mar 2009 18:03:13 +0000 (10:03 -0800)]
Eliminate stacks disconnected from red DVONN pieces

At this point, the game is actually playable for the first time.
There's still very little actual UI here, (no indication of who
the current player is, no buttons for passing, starting a new
game, etc.). But with two people who know how to right-click
and have out-of-band communication to say when its the
opponent's turn, it's possible to play now.

13 years agoImplement right-click for pass
Carl Worth [Thu, 5 Mar 2009 17:42:08 +0000 (09:42 -0800)]
Implement right-click for pass

An actual button would be better, but I'm being lazy as far
as real UI again.

13 years agoEnforce legal moves
Carl Worth [Thu, 5 Mar 2009 16:50:59 +0000 (08:50 -0800)]
Enforce legal moves

All the checks for legal moves are now enforced, (including not
even selecting a piece if it is surrounded). Basically all that's
missing now is elimination of disconnected pieces, (and the
ability to pass when there is no available move).

13 years agoAdd visual indication for non-red stacks containing a red piece
Carl Worth [Thu, 5 Mar 2009 09:46:55 +0000 (01:46 -0800)]
Add visual indication for non-red stacks containing a red piece

Also, don't bother displaying the stack-height number until
the stack has at least two pieces in it.

The game is really close to being possible to play manually,
(without the computer enforcing the rules), except that it's
not yet possible to eliminate the disconnected pieces.

13 years agoAdd display of stack height and implement movement
Carl Worth [Thu, 5 Mar 2009 09:37:25 +0000 (01:37 -0800)]
Add display of stack height and implement movement

There's still no checking for legal moves on the movement, but
at least the stack height increases appropriately.

13 years agoAdd visual indication of selected stack
Carl Worth [Thu, 5 Mar 2009 09:06:58 +0000 (01:06 -0800)]
Add visual indication of selected stack

There's already logic for selecting only stacks that belong to the
current player, and changing the current player after each move---
just no logic for doing anything with the move yet.

13 years agoImplement placement phase of game
Carl Worth [Thu, 5 Mar 2009 09:03:05 +0000 (01:03 -0800)]
Implement placement phase of game

It's getting *close* to playable now. We still need visual
indications for the following: stack height, red piece in
stack, selected stack, and most recently moved stack. We
also need logic for legal moves as well as for removing
disconnected pieces after a move. But that's not really
that much code.

13 years agoRemove vestiges of loa in favor of dvonn
Carl Worth [Thu, 5 Mar 2009 08:41:22 +0000 (00:41 -0800)]
Remove vestiges of loa in favor of dvonn

A very minimal shell of this program began as copy-and-paste from
my loa game (of the same license). Finish fixing any remaining
leftovers from that copy-and-paste.

13 years agoAdd simplistic button-press handling
Carl Worth [Thu, 5 Mar 2009 08:33:54 +0000 (00:33 -0800)]
Add simplistic button-press handling

Right now this is just toggling a white ring on and off at
each location. The significant bit here is that the calculations
between board-index positions and screen coordinates are now
correct. Thanks to Keith Packard for helping me think through
some of the math here.

13 years agoFix vertical spacing of the board
Carl Worth [Wed, 4 Mar 2009 23:52:59 +0000 (15:52 -0800)]
Fix vertical spacing of the board

Previously we were using unit spacing for both X and Y, but the
correct answer is to include a sqrt(0.5) factor in the Y axis.

13 years agoInitial import of DVONN game
Carl Worth [Wed, 4 Mar 2009 23:35:48 +0000 (15:35 -0800)]
Initial import of DVONN game

Not yet playable, but at least we can draw something like the
correct board.