Skip to main content
3 votes
Accepted

Easiest method to organize code

You went down the rabbit hole with this pset. You chose the wrong path at the fork on the road. Just think for a minute how mush you will have to change, if instead of 5 letters which is the current ...
ChrisG's user avatar
  • 7,396
2 votes
Accepted

Too much whitespace in vigenere.c, style50 error in pset2

Consider removing the typecasting, because it is essentially redundant. A char is a one-byte integer; the system does it's own internal "casting". Perhaps rewatch the caesar walkthrough. Starting ...
DinoCoderSaurus's user avatar
2 votes

Too much whitespace in vigenere.c, style50 error in pset2

Change (int) alphabet to ((int) alphabet). The parentheses won't change the meaning (as typecast has higher precedence than binary minus operator), but they silence style50 (and are my preferred ...
Blauelf's user avatar
  • 20.9k
2 votes
Accepted

Style50 provides improvement suggestions I don't understand. What should I do with the code?

This output is indeed not very helpful. I guess they create a "properly formatted" version of the script and apply a generic diff tool (you can learn more about those later in the course, in the "...
Blauelf's user avatar
  • 20.9k
2 votes
Accepted

Bug in CS50's score counting?

If you need to submit your code to fix the style, be sure to run style50 and then use the 2018 submission instructions. submit50 cs50/2018/x/hello submit50 cs50/2018/x/mario/less
curiouskiwi's user avatar
  • 18.7k
1 vote
Accepted

pset 1 mario style

The bottom line is that style50 is upset about all the inconsistent indentations across the program. On those two lines, it's just having trouble expressing it. If this answers your question, please ...
Cliff B's user avatar
  • 68.8k
1 vote

Too much whitespace in vigenere.c, style50 error in pset2

Interesting question. In my opinion, your code is correctly styled. Both of the other answers provide a solution to the problem. But, the real problem is style5050 itself. Again, in my opinion, this ...
Cliff B's user avatar
  • 68.8k
1 vote

pset4 recover style

I think that your style is perfect. In general its good practice to use sensible variable names where possible. This eliminates the need for comments at each instruction or decision. for the sake of ...
Daniel Lee's user avatar
1 vote
Accepted

How should I wrap lines on long conditions?

There are no hard and fast rules on how to split a long test condition. It's mostly about doing what makes sense and what makes it easiest to read. For instance, putting one test condition per line ...
Cliff B's user avatar
  • 68.8k

Only top scored, non community-wiki answers of a minimum length are eligible