Still learning, but I think managed to solve the second challenge. I just believe the code I wrote is too large. Any advice on space and time saving?
Challenge 2 solved | Need general advice
Post a Reply
|Oldest Newest Rating|
· June 9, 2015
Thank you for the advice! I'll try your suggestions and mess around with the code a bit to get better at C.
· June 8, 2015
I don't think you need so many variables. h, l and s are never actually used and you could actually use dice1, dice2, dice3 both times and not need to declare dicea, diceb and dicec. Technically you don't even need the sum2 variable. This will save space in ram but considering how little the space is that you are using you don't really need to worry about it...
You also don't need to have the if inside the else statements because that will only happen if the if condition is false. The way its set up now it will actually check every single one. So if you know how you might want to make it an if - else if - else statement instead of stand alone if else statements...
hope this is what you were asking about...
Nice job tho
One of the most popular languages of all time.
|Bucky Roberts Administrator|