Jump to content

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)
moveif = Move(solp1, direction(solp1, solp2), offset(solp1,== solp2))
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 nearlynearby square to move, " *
"then immediately click on the midpoint square for that move.", win)
newgame!(win)
4,105

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.