For example this is the contents of my Pre-written functions .c document that I need to call into my program:
Code:
#include <stdio.h>
#include <time.h>
#define NUM_PEG 6
#define NUM_COLOR 4
#define MAX_TURN 15
#define MARKED_BOARD -1
#define MARKED_ANSWER -2
// Functiones used.
void fillBoard(int board[]);
int numPerfectMatches(int board[], int answer[]);
void getUserGuess(int board[]);
void copyArray(int dest[], int source[], int length);
void markOutCorrect(int board[], int answer[]);
int numWrongPlaceMatches(int board[], int answer[]);
void greeting();
void printArray(int array[], int length);
void printWinner(int num_turns, int num_seconds); ......etc...
This is my program so far:
Code:
#include <stdio.h>
#include <time.h>
int main () {
int guess1, guess2, guess3, guess4;
printf("Welcome to Mastermind!\n\nAt each turn, you will enter your guess for the playing board.\n");
printf("A valid guess has 4 values in between 0 and 5.\n");
printf("Each guess will have each number within the guess separated by a space.\n");
printf("When you are ready, enter your first guess.\n");
printf("From that point on, you will be told how many perfect and imperfect matches you have.\n");
printf("After this message, you should guess again. You have 10 chances, good luck!\n\n\n");
printf("Please enter your first guess now:\n");
scanf("%d%d%d%d", &guess1, &guess2, &guess3, &guess4);
if ((guess1 = 0 > 5) && (guess2 = 0 > 5) && (guess3 = 0 > 5) && (guess4 = 0 > 5));
printf("GOOD\n\n");
system("PAUSE");
return 0;
}