How to Program Connect 4 in Python! (part 2) – Check for Winning Move

9
3



In this video we finish the command line version of our connect four game. We implement a way to check for a four in a row and talk a little bit about good design practices.

Next Video:

Previous Video (First Part):

Full Game Source Code:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PYTHON TUTORIAL SERIES:

Why Learn Python? +Setup:

1. Math & Variables:
2. Conditional Statements (if, elif, else):
3. Functions:
4. Lists & Tuples:
5. For Loops & While Loops:

Learn to Program a game:

Nguồn: https://uwallpaperhd.com/

Xem thêm bài viết khác: https://uwallpaperhd.com/game/

9 COMMENTS

  1. What if the winning ship was placed in between chips. In this case it is not an endpoint and the algo with not work?

  2. Dude, just iterate over a sequence of vectors and scan along those vectors starting where the last piece was placed. It makes a very compact and readable function. I do something similar in my Othello game to test whether a move is valid, make a move, and simulate a move in my player bot.

LEAVE A REPLY

Please enter your comment!
Please enter your name here