Clean my code | Sololearn: Learn to code for FREE!

+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

10/26/2021 11:25:23 PM

ElkanaM

7 Answers

New Answer

+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

https://www.sololearn.com/Content-Creation-Guidelines/ https://code.sololearn.com/Wv5gTHy1N6Ji/?ref=app https://www.sololearn.com/discuss/1316935/?ref=app

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.