OK i have this now please help me on how to switch to player 2?
And any other errors you see. Thanks so much.
Code:
#include <stdio.h>
char name[100] = {0};
int numlives = 5;
int score = 0;
int round = 1;
int player1live = 5;
int player1turn = 0;
int player1score = 0;
int player2lives = 5;
int player2turn = 0;
int player2score = 0;
int templives
void activeplayerstats(void);
int main(void) {
char name1[100]= {0};
char name2[100]= {0};
printf("Player one, what is your name?\n");
scanf("%s", &name1);
printf("Player two, what is your name?\n");
scanf("%s", &name2);
strcpy(name1, name)
round = player1turn;
numlives = player1lives;
score = player1score;
while (player1lives>0 || player2lives>0);
{
if (numlives>0);
{
templives=numlives;
****CALL playround(char name[], int* numlives, int* score, int round);
}
if (numlives=0)
printf("Your Game is Over.\n");
void activeplayerstats(void);
if (numlives < templives)
switch to other player ********************
}
printf("Here are the final standings:\n");
if(player1score>player2score)
printf("%s %d points\n", name1, player1score);
printf("%s %d points\n", name2, player2score);
else (
printf("%s %d points\n", name2, player2score);
printf("%s %d points\n", name1, player1score);
else {
}
void activeplayerstats(void) {
printf("%s, you now have %d points and %d lives left.\n", name,
score, numlives);