Share your repls and programming experiences

← Back to all posts
ConnectFour!
PattanAhmed (1417)

ConnectFour!

Hi everyone!
Welcome back to my new post!

Last time, I made a game called [Pong] which was made in Python Turtle.
This time, I tried making a game in Pygame.
Yahoo! 🥳.

With that said:-
I would like to introduce you to my new game called ConnectFour.

This basically a game that two people play in real life.
So, I decided why not make this game with Python.

If you don't know how to play, Here is how to play:-
Just press the location where you wanna drop your selection as the First player.
then repeat this step as the Second player.
Red color represents 1st player
as Yellow color represents 2nd player.
Make sure that any of the players won't get four in a row. (whether it's from horizontal, diagonals, or vertical)
by blocking their way to the win.
and try to win by yourself.
And the player who made 4-in-a-row wins!!

That was just a small description of how this game works.
I am pretty sure that many people know about it.

As @Name12 said, Python is powerful.

By the way, The code is pretty well beginner-friendly. So you guys can follow up along the code easily too.

Thanks to @Muffinlavania for helping me with win statements.
Thanks to @Bookie0 for helping me too
Thanks to this tutorial for helping me a lot.

And also, If you guys wanna play this game on full-screen, you can play at this link below:-
https://repl.it/@PattanAhmed/ConnectFour?lite=1&outputonly=1

So,
Have fun!
and:-

Be intelligent!

Be gaming!

ByE!!

This post has been locked
Comments
hotnewtop
programmeruser (618)

@moderation I'm pretty sure this was plagiarized from https://www.youtube.com/watch?v=UYgyRArKDEs.

Full source code that the tutorial gave: https://github.com/KeithGalli/Connect4-Python

@CodeLongAndPros @CodingCactus @Vandesm14 <-- active mods

(isn't this the second time that PattanAhmed has plagiarized code from a tutorial?)

programmeruser (618)

@realTronsi he just added this to the description:

Thanks to this tutorial for helping a lot.

realTronsi (927)

@programmeruser it should be more like

I copied this tutorial

in bold heading at the top

realTronsi (927)

@programmeruser lol read his post

Hi everyone!
Welcome back to my new post!

Last time, I made a game called [Pong] which was made in Python Turtle.
This time, I tried making a game in Pygame.
Yahoo! 🥳.

With that said:-
I would like to introduce you to my new game called ConnectFour.

This basically a game that two people play in real life.
So, I decided why not make this game with Python.

notice the

Last time, I made a game called [Pong] which was made in Python Turtle.

and

I would like to introduce you to my new game called ConnectFour.

RayhanADev (2696)

@realTronsi @programmeruser
It’s been like that since he posted it, chillax. That’s only reason I didn’t say anything.

RayhanADev (2696)

@realTronsi @programmeruser
They also considerably changed the program from what the repo has...

DynamicSquid (5068)

@RayhanADev I think it is copied. The only diff I see are whitespace and comments

RayhanADev (2696)

@DynamicSquid really? Let me take a closer look..

Bookie0 (6560)

but pretty cool, you should make it restart again after the end game, and a leaderboard to keep track of the scored! ;)

PattanAhmed (1417)

@Bookie0
Thanks for your suggestion. I will surely try when I get my Python level increased.

Bookie0 (6560)

@PattanAhmed ok, but ig you can just like have a variable with the user's score, and if they win, you just increment another variable that contains the number of wins a user has..

PattanAhmed (1417)

@Bookie0 I tried that, It didn't work on the first try.
I will try to surely add that feature.

Bookie0 (6560)

@PattanAhmed hum well you could just add 1 to the variable when a user wins, i think it's line 242 when you say that a player won

PattanAhmed (1417)

@Bookie0 Wanna invite you to this Repl?

Bookie0 (6560)

yea you can send me the link, and I'll hop in when I can @PattanAhmed

ROCKINGRAYQUAZA (94)

nice one, you surely put a lot of work in it!

MarblesAndMore (61)

This is cool, and the only bug I found was when scrolling you fill in the whole thing

PattanAhmed (1417)

@MarblesAndMore It would be good if you send a screenshot.
Thanks!

MarblesAndMore (61)

@PattanAhmed Here, I don't know whether this will help but look

PattanAhmed (1417)

@MarblesAndMore That's what it needed to be.
I guess.

RayhanADev (2696)

Ummm it didn’t work:

and it threw a bunch of errors :(. Pingu me when you fix it :D!

PattanAhmed (1417)

@RayhanADev It's working fine.
Refresh your page.

PattanAhmed (1417)

@RayhanADev Hold on.
Let me just fork out this Repl and post it again.

RayhanADev (2696)

@PattanAhmed okay so the Repl in the post didn’t work but the one on your profile does :/
might just be me lmao

PattanAhmed (1417)

@RayhanADev :/
weird stuff on Repl.it goes on every day.
lmao

GABELACANLALE (33)

@RayhanADev yeah it works for me you just restart the program

[deleted]

i found a bug when you scroll on it it fills the whole thing.

[deleted]

@idrgplayer scroll down from the top you will see

PattanAhmed (1417)

@idrgplayer It will be good if you send a screenshot.

[deleted]

When this becomes famous I will be happy to know i was the first upvoter lol.

[deleted]

@idrgplayer Seriously tho cool game.

PattanAhmed (1417)

@idrgplayer Yep, you are the first upvoter. lol

[deleted]

@PattanAhmed lol thx. Do you know how to fix the bug.

PattanAhmed (1417)

@idrgplayer It will be good if you send a screenshot here.
I cannot find it by myself.