Morpion solitaire/Julia: Difference between revisions
m
fix diagonal case where new point is the midpoint in user play
m (remove comment) |
m (fix diagonal case where new point is the midpoint in user play) |
||
Line 238:
if solitaire_gotfirst
solp2 = Point2i(x, y)
movs = filter(m -> m.o == 0, possiblemovesforpoint(solp1, game))
d = isempty(movs) ? SE : movs[1].d
else
d = direction(solp1, solp2)
end
move = Move(solp1, d, offset(solp1, solp2))
if isempty(any5inarow(move.p, game.board.points, move.d))
@warn("bad move $move")
Line 257 ⟶ 263:
elseif mode == 1 # solitaire
set_gtk_property!(modelabel, :label, modelabels[2])
info_dialog("Click on a valid empty
"then immediately click on the midpoint square for that move.", win)
newgame!(win)
|