- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
IT, Programming, & Web Development › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 2: [Arrays] – Functions, Variable and Scope, Debugging, Arrays, and Command Line Arguments › Scrabble lab: Adding #define for POINTS
Tagged: define command, define function
Since the number of letters are 26, I guess #define can be introduced. I tried to add but it does not work.
[dm_code_snippet background=”yes” background-mobile=”no” slim=”yes” line-numbers=”yes” bg-color=”#abb8c3″ theme=”dark” language=”clike” wrapped=”yes” height=”” copy-text=”Copy Code” copy-confirmed=”Copied”]
#include <cs50.h> #include <string.h> #include <ctype.h> #include <stdio.h> #define POINTS 26 int compute_score (string word); string decide_winner (int score1, int score2); 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 main (void) { }
[/dm_code_snippet]
Is there any formatting error?
Reply
https://edstem.org/us/courses/176/discussion/1876752[learn_press_profile]