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.
I keep getting an error
when calling the
transitionFunction
, which is really annoying. My solution works for the given tests and I cannot see what is wrong with me calling the way I do.Need more clarification on what types of attribute access to record.
For example, I assumed access to init before calling it also needs to be recorded.
fixed.
thanks!
minor typos:
Turing is a proper noun, ao should have a capital T
transition
character
done
noted.
done
done
This comment is hidden because it contains spoiler information about the solution
( JS )
T[[s,q]] = ...
This. Is. Horrible.
Object
property keys can only beString
s. This syntax is valid, it's very, very Clever, and it relies on implicit coercion and it's completely unmaintainable. Also, I don't want to think about what happens whens
orq
happens to be','
. Or whenT
is aMap
instead of anObject
, which might at some point be a desirable optimisation.If you understand fully and completely when and how coercion works, and any and all collaborators agree this is a good idea ( with the same deep understanding of coercion ), and this behaviour is extensively, exhaustively documented, you might get away with it as long as nobody else ever needs to maintain your code. ( I would never ever want to be one of those collaborators. ) Given that the platform and the testing framework might at some point get upgraded and require maintenance on your testing code, and you might disappear from CodeWars and some poor sod other than you might have to perform that maintenance, please don't do this. It's begging for bugs, which might leave the kata non-functional at any moment.
Oh, and the transition function example has invalid syntax. This is needlessly distracting. Just use correct, complete, valid syntax.
( JS )
This is confusing ( because it's actually easier to not do it with a
String
. I notice the example solution does this the same way I do it - not aString
in sight ). This implementation detail should be left to solver.It's not a byte, it's a character. It might be any datatype actually, but that would clash with the expected implementation of the tape.
I'd suggest describing the "string" generically as "the tape", specifying that it's a sequence of characters, and that the return value of
machine
is to be aString
.For
direction: 'r'
?!?Also, please use camelCase for identifiers. It's the accepted convention. And set
Node 10.x
as default.You should also update the transition function's description
done
Description should be clearer (at least use more formatting).
Function descriptions should be presented in the conventional way:
Typos:
aed in that order:This was never ment to be a constraint. It was suoppose to be a guide of what the output should be.
If this was confusing it is metter removed.
Loading more items...