Hi all..
I decided I wanted a little ttt program in the shell
and wrote one.
Unfortunately the algo for searching for winning
combo's is linear and is limited to three consecutive
moves, when a winning combo like:
Is ignored.
Does anyone have a cool function to search a list of
moves for all winning combos given a list of player
moves in the format: "15798" ??? With the playing
squares ordered by row of course.
eg:
Thanks
I decided I wanted a little ttt program in the shell
and wrote one.
Unfortunately the algo for searching for winning
combo's is linear and is limited to three consecutive
moves, when a winning combo like:
Code:
# #
X # X # X
# #
###############################
# #
# O # O
# #
###############################
# #
O # # X
# #
Does anyone have a cool function to search a list of
moves for all winning combos given a list of player
moves in the format: "15798" ??? With the playing
squares ordered by row of course.
eg:
Code:
123
456
789