+ 1
Clean my code
Hi, i want to clean up my code and push some part to functions. Can you help? https://code.sololearn.com/c0Pn88Ocbp8h/?ref=app
7 Réponses
+ 2
I want to clean it and separate to functions.
Thx, sorry if it spam/off topic.
+ 2
To fix the indentation ( I don't know how you managed to get it wrong at the first place ) you can try tools like clang format.
But for changing overall structure of the program, you have to do that yourself.
+ 2
Would you consider code reduction as the type of clean up you intended?
By thinking outside the box, lines 34 - 56 could be reduced to a two-line while statement. It would require no special statements beyond ones that you have used already in the given code.
Hint: I mentioned the approach in response to a question earlier today about this Code Coach task.
+ 1
ElkanaM it's fine but I feel like most people here count that as doing your work for you, so I'd recommend look over it yourself :)
+ 1
Why don't you try it yourself? We will help you if you are stuck in any step. All the best =)
0
Hmm, is this code advertising or are you asking for help? If it's the first one I'm afraid this is spam and off-topic.