fun kata, not sure whether this kata would be considered a duplicate: https://www.codewars.com/kata/5808ff71c7cfa1c6aa00006d
yours asks for word counts, that one char counts, so probably good
Unpublishing as a duplicate of https://www.codewars.com/kata/526c7363236867513f0005ca/
This comment is hidden because it contains spoiler information about the solution
Typo in the sample tests: "Lamp getter method..." instead of "Lamp setter method..." under "// test setters"
( JS, possibly others )
Nothing is apparently being done with the colour of the lamp. I suppose there are tests, but it feels unsatisfying.
Prescribing the internal representation for on is not good. That implementation detail could, and therefore should, be hidden and up to the programmer.
Marking this as a suggestion three and a half years late would not be very useful though.
Not an issue.
If this is intended to be a beginner-level kata, perhaps the instructions/requirements could be more explicit about the constructor (order of params?) and getters/setters (method names?). New programmers may not have learned the conventions for getting and setting.
add TODO: Give the lamp an instance method called toggle_switch that will switch the value of the on attribute.
Groovy translation kumited. Please review and approve. Thanks, suic
I like that this kata tries to be simple and stay simple, even to the dismay of those who already get it and would like to move on.