Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Please use code formatting blocks and spoiler flag when posting code.
This comment is hidden because it contains spoiler information about the solution
You get more votes for best practice and it is harder to read so built in obfuscation to thwart the competition.
On CodeWars, comments like that don’t really matter, because everyone knows what the code is supposed to do.
But the comment "The comment just tells what the code is already saying." sounds like a more general statement, not just specific to CodeWars — so I decided to share my thoughts on the topic.
Saying "The comment just tells what the code is already saying." is actually a good thing in my opinion — because it helps you understand what’s going on faster.
"It is redundant." Well, comments don’t have to reinvent the wheel. Redundancy can be helpful when it saves time.
"Pointless"? Saving time is pointless?
"In a larger context, it could get out of date soon." — Sure, like everything else. But we read code way more often than we write it.
Good programmers are used to writing good comments.
yea, its surprising
The triple chevron represents a Here String, which feeds the string on the right to the operation on the left(input redirection)
If you add or subtract zero, the result will not change, but there will be no unnecessary operation.
I also summed it up with zero.
happens to the best of us
I did :)
i do play old school runescape if thats what you mean. @stojak139808. i do think it matters for people that dont understand and if your bad at simple programs you'll suck at writing big programs
you have a point, but it really doesn't matter for simple problems like these
bc
stands forbasic calculator
asprintf()
is a Linux function, not in standard C or POSIX. you must either declare it manually, or#define _GNU_SOURCE
before you#include <stdio.h>
Would you mind to elaborate? It's almost the same solution in C.
You don't need strlen! Now you iterate twice over the string!
Loading more items...