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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Not sure if someone is still working on the kata.
Had an issue pop up with some of the PHP test cases. Doesn't seems to be an issue on my side.
The code runs fine in my IDE but I get "undefined array key" in the test case file when running the code on CW.
Let me know if other people are experiencing the same thing and if I maybe need to have a look at my code again (:
Go look up sliding puzzle and how inversions play a role. If a certain amount of numbers are "out-of-place" the puzzle becomes unsolvable.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Definitely not the most efficient way.
But still clever.
Practically, don't think this will ever need to be scaled. It's tic tac toe. If possible future scaling isn't an issue, why even bother future proofing it?
This might be a very simple function, but it's basically unreadable. Makes maintaining a codebase a lot harder. Same function just with more descriptive variable names and a comment or two and you should be set.
Shorter does not always equal better.
The whole idea is having a class and a constructor for multiple people, eventually being able to scale with more parameters and methods. This solution is not only unreadable, but makes it diffucult to scale.
Less lines of code doesn't mean the code is written better. Code readability is actually important. Great solution, but I'd be very mad at you if I was your successor and you handed me a codebase that looks like this. Companies check for clever solutions, but value readability over the solution "looking fancy".
Code is obviously very concise, but lacks serious readability. Use more descriptive variables. Just something that gives other people reading the code a better idea of what the code does. This will be quite important when you ever write code that will eventually be used by other devs.
Very nice solution, but wouldn't be very readable without proper commenting in a codebase.