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



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

  • TheLolobag

    After I start the game P1 plays and then after only P2 plays, help how do I correct that???

    June 27, 2020 - 7:23 am Reply
  • rollergamer 02

    How many possible wins are there in connect 4 ?

    June 27, 2020 - 7:23 am Reply
  • Miguel Acevedo

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

    June 27, 2020 - 7:23 am Reply
  • Jeffrey Cheng

    what version of python is this

    June 27, 2020 - 7:23 am Reply
  • Toby Webb

    Awesome video, although I find the np.flip does not do anything, any advice? I am using verson 3.7

    June 27, 2020 - 7:23 am Reply
  • Strawberry Havoc

    he has 10k views 17k subs and 5 comments

    June 27, 2020 - 7:23 am Reply
  • sam liew

    Is there others way to code winning moves?

    June 27, 2020 - 7:23 am Reply
  • Kyle Eames

    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.

    June 27, 2020 - 7:23 am Reply
  • Walter White

    Congrats, your channel has some pretty nice content, subscribed.

    June 27, 2020 - 7:23 am Reply

Leave A Comment

Your email address will not be published.