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.
It holds the same space as any int
Is it actually BP to write this outside of the class declaration?
LOL. No.
Good questions are welcome any time -- answers are free. You can pay me by following my C solutions and upvoting whatever you like, by asking more interesting questions, and by telling me any bugs you find.
Cheers.
Thanks for such a great response. Is that canned? I hope I didn't take too much of your time. If so, how can I pay you.
And I'm still trying to solve problems like you but it'll take some time
Here are a few strategies I use:
Just stick to simple problems --- Firstly, my "simple" solutions are only for Kyu 8,7,6,5. So I am only doing the easier puzzles in the first place. I am too lazy these days to ways to spend days to solve something.
Be confident! --- IMO it is not uncommon for simple problems to have simple solutions, so just convince yourself that you are going to find what it is if you just take time to think about it, instead of bashing out the first code that springs to mind.
Iterative Process --- Arriving at a good solution is much more iterative than you may think. The better ones might be my 3rd or 4th submission, and I often fork my own soultions to improve them... sometimes even years after the original.
Stand on others' shoulders --- Often I get some clues off the other people's solutions. e.g. Person A has one good idea, Person B has another good idea. Then I will try to figure some way of combining the best parts of both A and B create something new that is better than either of them.
Deliberately use code that looks like magic --- For C Programming (my favourite) I gravitate towards things like pointers and bit-fiddling and recursion. I've been writing C code long enough that it is not hard anymore but I know it sometimes looks like magic. e.g. I will always use pointers to traverse an array instead of using an index variable. Why? Just because.
Avoid the overly mathy Kata --- IMO those Kata generally rely on some special clever trick that only a maths student would know, so for those user the Kata is easy and concise, but others would struggle. I am in the "others" group.
Practice Practice Practice --- Playing code-golf with a few other CW users here is a fun way to keep from getting rusty and learning cute new tricks.
Learn from others --- After submitting your solutions definitely take time to look through several pages of other solutions. See if you can learn techniques that other people used.
KISS --- Actually, concise simple solutions is my solution goal from the outset. Of course, many Kata solution might be easily written verbosely or with multiple loops etc, but I don't start that way because I know 100s of other people will post those kind of solutions anyway. So I deliberately start out from the POV of "what can I do here that is really left-field that nobody else is likely to do"?
Don't kid yourself - Although I lean towards aiming for "clever", instead of "best practice" solutions, don't kid yourself they are the same thing. Mostly they are not. Many of my "concise, simple" solutions are cute but they are also just plain silly rubbish code and not production-quality.
I agree. I am pleased you recognize this is not one of my better ones.. :-(
Ok, how do you always come to concise, simple solutions and what is your thought process behind achieving simple solutions?
:D
Willing to pay a lot if you think you can actually quantify that
Note that I don't think this solution is that easy to read, but I've seen alot of your other answers
No, but if you ask me a question I will try to answer it.
Do you do any coaching dinglemouse?
That's because the old-school, pre-ANSI, K & R C style function declarations format, that I learned before you were born, is still supported ;-)
https://stackoverflow.com/questions/22500/what-are-the-major-differences-between-ansi-c-and-kr-c
How are you allowed to not specify types in your function declarations?
I disagree.
Unless the solution is ridiculously hard to achieve with an algorithm, hard coding only leaves you completely inflexible to any future requirement changes.