Hi guys,
I am a beginner in C, would like to know how u guys would write connect 4 in C ( not C++!)
All suggestions and programs(via email) are welcome.
thanks!!
tahjiun
This is a discussion on connect4 in C within the Game Programming forums, part of the General Programming Boards category; Hi guys, I am a beginner in C, would like to know how u guys would write connect 4 in ...
Hi guys,
I am a beginner in C, would like to know how u guys would write connect 4 in C ( not C++!)
All suggestions and programs(via email) are welcome.
thanks!!
tahjiun
PHP Code:ccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccc
It would go on something like that, of course I don't want to give away my complete source for connect four written c.
get it? See? I made a funny!
c++->visualc++->directx->opengl->c++;
(it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)
what a coincidence
I was experimenting with C++ just a few days ago and made myself a connect 4 console game. Although I used C++, nothing specific to C++ was "needed" to make my program work so I guess its in C. (so much opportunity for puns... must resist)
anyways, basically you make functions of checking. e.g
i had the following check routines in this order of execution as part of my AI:
check for winning move
check for threat
check for 'ok' move
then i had the following neutral functions:
display
check for winner
check for draw
player move
computer move
I wont go into detail of how to make each function because it will become obvious as you make it.
As you can see, if you think systematically, you can make simple AIs with relatively little skill required. (For advanced AI programming, i think you'll need to think recursively, something my peuny brain is incapable of)
I AM WINNER!!!1!111oneoneomne
I made this a LONG TIME AGO. and the code SUCKS. The only copy I still have is the one I posted to this board almost a year ago.
Check here for ideas: Connect 4!
Note: The code was written when I was a complete newbie, and it's not very pretty.
If you want an idea of some AI, check out my C4 game on this thread:
New Connect Four Game
Its in C++ but you should get the idea by looking at it.
So if i post something here i get slapped by you?Originally posted by tahjiun
All suggestions and programs(via email) are welcome.
![]()