My code will compile, but I'm getting "linker code failed" on my custom function. So I'm not implementing this custom function as I intend to. I still have to deal with case sensitivity and non letters, but I'd like to work out what I did wrong first.
#include <ctype.h>
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// points assigned to each letter of the alphabet
int POINTS[]= {1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10};
int compute_score();
int main(void)
{
//get input from both players
string word1 = get_string("player 1: ");
string word2= get_string("player 2: ");
//score both words
int score1 = compute_score(word1);
int score2 = compute_score(word2);
//print the winner
if ( score1 > score2)
{
printf("player 1 wins!!!");
}
else if ( score2 > score1)
{
printf("player 2 wins!!!");
}
else if (score1 == score2)
{
printf("TIE!");
int compute_score();
for (score1=0; score1< strlen(word1); score1++)
{
score1+= * (POINTS);
}
return score1;
for (score2=0; score2 <strlen(word2); score2++)
{
score2+= *(POINTS);
}
return score2;
}
}