Questions tagged [style]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
3answers
65 views

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

The Program has no errrors when checking with check50 but when i check vigenere.c with style50 by: style50 2015.fall.pset2.vigenere vigenere.c it gives the following error: :( 84:20 Too much ...
1
vote
2answers
218 views

Easiest method to organize code

I'm just finished the entire cs50 course (yay), except the final project, and I'm ready to start submitting all of my psets. Before I submit, I'm going to proofread all my code and simplify/style it ...
1
vote
1answer
672 views

Memory allocation: recommended practices

I'm rambling a little with hacker 2 (the passwords') and, in the meantime, gained some insight about pointers, mem-alloc, 'valgrind', etc... It's been a truly great, challenging experience. But, ...
1
vote
2answers
119 views

Line length too long

I just finished the Caesar program and it works, but when I run style50 it complains that this line is too long: if ((text[i] >= 'a' && text[i] <= 'z') || (text[i] >= 'A' && ...
1
vote
1answer
696 views

CSS Table Gradient Not Working

I am trying to make a gradient for my table head, but it is not working at all. CSS: PHP + HTML I still have my nooby table.
0
votes
1answer
99 views

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

I wrote this piece of code. Generally it's just a declaration of four integers and the corresponding formulas. One line for each int: int q25 = cents/25 - cents%25/100; int q10 = (cents - q25*25)/10 ...
0
votes
1answer
226 views

Bug in CS50's score counting?

I checked my "CS50.me:Scores" recently, and was surprised to find that the score of my first two programs that I submitted in 2017 changed from 100% to 75%! I understand that they introduced a new ...
0
votes
1answer
107 views

Is there a more elegant way than this to search for the start of a jpeg? (pset4 recover.c)

// start of new jpeg? if (buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff && (buffer[3] == 0xe0 || buffer[3] == 0xe1)) There must be, because this ...
0
votes
2answers
51 views

placement of structs in code

Stylistically is it possible to declare structs on top followed by their definition after int main? I tried doing it the same way as one would declare functions before main but it doesn't seem to work....
0
votes
1answer
71 views

pset4 recover style

Having completed the first 4 psets and having little prior programming experience I start to worry about my style(comments, identation etc.) I would like to hear some comments as to what I could ...
0
votes
1answer
183 views

How should I wrap lines on long conditions?

What's the recommended and / or required way to wrap the condition on an if block? For example, I have this block: if ((islower(p[i]) && encrypted > 'z') || (isupper(p[i]) && ...
0
votes
2answers
65 views

Font issues in Breakout

I cant find any specified fonts names, styles or samples to implement it inside setFont() can anyone help ?
0
votes
1answer
266 views

pset1 - Mario less comfortable - Styling problem

Could any one please tell me what's the "styling problem" in this code? I keep getting score of 4 out of 5 and I don't understand what I miss ? #include <cs50.h> #include <stdio.h> int ...
0
votes
1answer
28 views

cs50 pset4 style check - both 3 questions

I have passed cs50 check on all 3 questions, but style score is 4, 4, and 3. i have put the recover code here and want to know why the style code is 3. Is there any way to check the style before ...
0
votes
0answers
99 views

Need Coding style help - pset1 credit.c - (style50 failed to parse, feels and looks messy)

Style50 fails to even parse the code and it feels messy and cluttered. Need coding style pointers. Check50 passes. Trying to get the most out of this course, not just fumble through. What is wrong, ...
0
votes
1answer
73 views

Hints on how to style the postal code in pset8

I've been trying to style the postal code like the staff version, but without success. The code runs if I enclose <%- postal_code %> with the <span> tag, but if I try to add an id, ...