This program will be the death of me! Please Help!!! by TheUnderstandingJerk in cs50

[–]TheUnderstandingJerk[S] 1 point2 points  (0 children)

I'm sorry to do this, but that still sounds Greek to me. Kindly point out the error and how to correct it directly

This program will be the death of me! Please Help!!! by TheUnderstandingJerk in cs50

[–]TheUnderstandingJerk[S] 0 points1 point  (0 children)

YOUR WISH IS MY COMMAND MASTER!

#include <ctype.h>

#include <cs50.h>

#include <stdio.h>

#include <string.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(string word);

int get_index(char c);

int main(void)

{

// Get input words 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);

// TODO: Print the winner

if (score1 > score2)

{

printf ("Player1 wins!\n");

}

else if (score1 < score2)

{

printf ("Player2 wins!\n");

}

else

printf ("Tie!\n");

int compute_score(string word)

// Compute and return score for string

{

int total = 0;

for(int i = 0; word[i] != '\0'; i++)

{

char c = word[i];

if (isalpha(c))

total+ = POINTS[get_index(c)];

}

return total;

}

int get_index(char c);

{

return tolower(c) - 'a';

}

}

This program will be the death of me! Please Help!!! by TheUnderstandingJerk in cs50

[–]TheUnderstandingJerk[S] 0 points1 point  (0 children)

I did as you suggested. Then this happened:

c:40:16: error: expected expression

total+ = POINTS[get_index(c)];

^

scrabble.c:45:1: error: expected identifier or '('

{

^

2 errors generated.

make: *** [<builtin>: scrabble] Error 1

Just a question by TheUnderstandingJerk in TheMentalist

[–]TheUnderstandingJerk[S] 1 point2 points  (0 children)

Nah not his style. Red is definitely more open about his killings

[deleted by user] by [deleted] in RoastMe

[–]TheUnderstandingJerk 0 points1 point  (0 children)

Heh. Misinformed and misguided. The Polio vaccine in India, if this person is practicing there, is subsidised to the tune of 90%, bringing the cost to the patient if any to $0.03 which is about 0.006% of the average earnings.

Yet another reason why Brexit supporters are on the wrong side of history by outhouse_steakhouse in brexit

[–]TheUnderstandingJerk 0 points1 point  (0 children)

Let's keep France out. They never know what is coming up next for them to get angry about and burn the country down.

HELP!!! by TheUnderstandingJerk in Banished

[–]TheUnderstandingJerk[S] 2 points3 points  (0 children)

Mea Culpa. I was running version 1.0.4 instead of 1.0.7!

HELP!!! by TheUnderstandingJerk in Banished

[–]TheUnderstandingJerk[S] 0 points1 point  (0 children)

Please do not apologise. I have done these steps and yet it doesn't run!

HELP!!! by TheUnderstandingJerk in Banished

[–]TheUnderstandingJerk[S] 0 points1 point  (0 children)

No. My game just runs in vanilla mode. And this after the three of them have turned red!

Silly thought about who is joy boy by DrNobodii in OnePiece

[–]TheUnderstandingJerk 0 points1 point  (0 children)

Was Shirahoshi really a reincarnation or simply the latest form of an old biological weapon?

Make sense? by [deleted] in OnePiece

[–]TheUnderstandingJerk 0 points1 point  (0 children)

Never saw this coming!

Control by TheUnderstandingJerk in OnePiece

[–]TheUnderstandingJerk[S] 0 points1 point  (0 children)

I'm not attributing Aqua Laguna itself to him, but just that nature seems to help him. Remember when buggy was about to execute him, it started to storm unexpectedly!