
Connect Four Python Game Tutorial with pygame
video description
Date: 2022-03-14
Related videos
Comments and reviews: 10
Hayden
I think it's a good tutorial but I found the code to be, say, not simplified?
Range only counts to column count - 1 or row count -1.
The grid starts at [0][0]
You had to flip it
Then you had to offset it when making the graphics
You almost used paradoxical loops
In a single line you used the variable SQUARESIZED like 20 times
I understand why you did all of that, I just found it hard to keep track of the loops as you went through it because I felt it was needlessly complex. I did manage to understand what was going on in mine working though so thank you. Just difficult for a beginner to track because the code is, I dare say, a tad bit messy.
reply
I think it's a good tutorial but I found the code to be, say, not simplified?
Range only counts to column count - 1 or row count -1.
The grid starts at [0][0]
You had to flip it
Then you had to offset it when making the graphics
You almost used paradoxical loops
In a single line you used the variable SQUARESIZED like 20 times
I understand why you did all of that, I just found it hard to keep track of the loops as you went through it because I felt it was needlessly complex. I did manage to understand what was going on in mine working though so thank you. Just difficult for a beginner to track because the code is, I dare say, a tad bit messy.
reply
Angel
Hi I'm pretty new to python, I've got until min 26 and I'm getting this error
Traceback (most recent call last):
File -connect4.py-, line 75, in
print_board(board)
File -connect4.py-, line 41, in print_board
print(np.flip(board,0))
AttributeError: 'module' object has no attribute 'flip'
---Repl Closed---
IF anyone knows and wanna help me it will be greatly appreciate it !
reply
Hi I'm pretty new to python, I've got until min 26 and I'm getting this error
Traceback (most recent call last):
File -connect4.py-, line 75, in
print_board(board)
File -connect4.py-, line 41, in print_board
print(np.flip(board,0))
AttributeError: 'module' object has no attribute 'flip'
---Repl Closed---
IF anyone knows and wanna help me it will be greatly appreciate it !
reply
Pri
I am a beginner programmer at 73 years of age... And, my first try at programming was your video of how to create a Connect4 game...Brilliantly explained! Only one thing did not work: the input function did not recognize integers, so I had to put the int() function in the input. I think it was because I could not install the SimplyREPL module
reply
I am a beginner programmer at 73 years of age... And, my first try at programming was your video of how to create a Connect4 game...Brilliantly explained! Only one thing did not work: the input function did not recognize integers, so I had to put the int() function in the input. I think it was because I could not install the SimplyREPL module
reply
AceDemonic
I know this video is kinda old but i had a question. I wrote the code alongside you but i had a bug where my code wouldn't stop showing the board over and over and over. I checked as much as i could but didn't find any significant changes apart from some var names and dif names which i made sure were correct.
reply
I know this video is kinda old but i had a question. I wrote the code alongside you but i had a bug where my code wouldn't stop showing the board over and over and over. I checked as much as i could but didn't find any significant changes apart from some var names and dif names which i made sure were correct.
reply
The
I got as far as checking for winners, for some reason that code isnt working, there is no way in hell id be able to come up with a solution on my own =( idk if coding if for me, im not smart enough. i can only copy others code. my own code never works =(
reply
I got as far as checking for winners, for some reason that code isnt working, there is no way in hell id be able to come up with a solution on my own =( idk if coding if for me, im not smart enough. i can only copy others code. my own code never works =(
reply
WTBE
Whenever I run the code in PyCharm the entire column gets filled with pieces anytime I click on a single column. The pieces alternate in color. It's like the turn is running on its own until the column fills with pieces
reply
Whenever I run the code in PyCharm the entire column gets filled with pieces anytime I click on a single column. The pieces alternate in color. It's like the turn is running on its own until the column fills with pieces
reply
Vayun
If you would have iterated in a reverse way in the get_next_row() function,
Like this: for r in range(ROW_COUNT-1, -1, -1)
It would have saved you a lot of time and work in flipping.
reply
If you would have iterated in a reverse way in the get_next_row() function,
Like this: for r in range(ROW_COUNT-1, -1, -1)
It would have saved you a lot of time and work in flipping.
reply
Plokster
Great tutorial, everything worked perfectly except for the pygame QUIT event. I don't get any errors, but the game just doesn't close when I click the close button.
reply
Great tutorial, everything worked perfectly except for the pygame QUIT event. I don't get any errors, but the game just doesn't close when I click the close button.
reply
Syamala
Finally created the game and learnt a lot from this game.
Thank u soo much for creating such a helpful video Keith Galli!!
Ahh I am 2 years late :)
reply
Finally created the game and learnt a lot from this game.
Thank u soo much for creating such a helpful video Keith Galli!!
Ahh I am 2 years late :)
reply
Jos-
thanks for your video, my question is... what if the size is not 6x7 but a number chosen by the player? how do you check winners?
reply
thanks for your video, my question is... what if the size is not 6x7 but a number chosen by the player? how do you check winners?
reply
Add a review, comment
Other channel videos















