Could you please help me how to create a four in a row game in C?
Thanks!
AnnA.B
13
Newbie Poster
Recommended Answers
Jump to PostWhat do u mean by "four in a row game"
1)Explain the game how it is.(game rules)
2)Also you can share ur coding and approach for the game.
Jump to PostHello Anna,
Will try my best to guide you for devloping this game.
Before that you need to have the understaing for the following things.1)Graphics in C
2)Dealing with Files in C
3)Basics of pointers,structures and stringsnow we will go by the graphics
Lets say …
Jump to PostCreate an array which holds the board state.
(don't forget to initialize the board before using it)1) Write code to display the board (from the array).
(Test whether everything is displayed correctly).2) Write code to accept user input.
3) Write code which processes the user …
Jump to Post1)Take a 2D array.
char storage[6][8];
At initilazation all values in the array will be NULL lets say "*".
2)Use a flag which will indicate which users turn is now.
int user_flag;
its value can be 1 or 2.if(user_flag=1)
{
user1_turn(); //fill with X
…
Jump to PostHi Anna,
Now at this point forget about the Artificial Intellegence .just make it a 2 player game.After its completion you can go for the AI.
Thanks,
DP
All 17 Replies
Dream2code
12
Junior Poster
AnnA.B
13
Newbie Poster
Dream2code
12
Junior Poster
AnnA.B
13
Newbie Poster
mvmalderen
2,072
Postaholic
Dream2code
12
Junior Poster
Dream2code
12
Junior Poster
mvmalderen
2,072
Postaholic
AnnA.B
13
Newbie Poster
mvmalderen
2,072
Postaholic
AnnA.B
13
Newbie Poster
iamthwee
Dream2code
12
Junior Poster
Dream2code
12
Junior Poster
AnnA.B
13
Newbie Poster
jephthah
commented:
LOL
+13
jephthah
1,888
Posting Maven
joao.jose.520
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.