5 kyu

Brian's Brain

48 of 85St3f4n
Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • imatmati Avatar

    Sorry to bother here, but If anyone with more 4000 honor and knowledge in Go and Elixir could test and approve my translations of "Coordinates Validator", I really appreciate as the author seems far away to come back. https://www.codewars.com/kata/coordinates-validator/javascript https://www.codewars.com/kumite/59efabf3c596eb1eea00003c?sel=59efabf3c596eb1eea00003c https://www.codewars.com/kumite/59efaf8f2a7accf8eb00013b?sel=59efaf8f2a7accf8eb00013b Sorry if it's not the proper place to do it, but I don't know how to resurrect "dead katas" :-)

  • Voile Avatar

    Approved

  • ZozoFouchtra Avatar

    I've first thought "alive" may means "On" OR "Cooldown". May be it could help to precise that "2 neighbours that are alive" means "*2 neighbours that are * On'"

    ; ) )

  • user5036852 Avatar

    Great kata again! Thanks for your great job!

  • wthit56 Avatar

    Great kata!

    The only I'd suggest is to simplify the description a little. You list the three states 4 times in 4 different ways, in different orders:

    I on or firing, II dying or refractory, and III dead.

    0s, 1s, and 2s representing the cell states: off, dying, and on respectively

    1. off but ready to fire,
    2. firing, or
    3. refractory after firing.

    a cell turns "on" if it was "off" but had exactly two neighbors that were "on" (this rule is often refered to as the birth rule) cells that were "on" go into the "dying" state cells that were in the "dying" state go into the "off" state.

    You could collapse these into a single list that focusses on how the implementation should work. Something like:

    • Off [0]: A neuron ready to fire. If it has exactly 2 neighbours that are alive, this neuron sparks into life into the "on" state.
    • Cooldown [1]: A neuron that fired on the previous iteration.
    • On [2]: A neuron that is firing.

    I think this encompasses all the info but it's in a single, understandable order and has all the pertinent (and story-based) information in one place.

    You don't have to use it, but it was easier to explain by showing you what I mean.

    But as I say, well done on a solid kata!

    • St3f4n Avatar

      Thanks! I've made some changes (included your list) and squeezed out the unnecessary things. What do you think?

    • St3f4n Avatar

      Oh and it seems there are a lot of people here whose english is not as good as their coding so I added that part: These cells go into the off/cooldown state. in description, even though your description makes it obvious for those who speak the language well :)

    • wthit56 Avatar

      Looks good to me. And the description has been condensed a lot too. Great stuff! ^^

      Suggestion marked resolved by wthit56 8 years ago
  • donaldsebleung Avatar

    PHP Translation Kumited - please accept :D

  • myjinxin2015 Avatar

    Type code 5 minutes, but read the description used 15 minutes. My poor English! ;-) Why you guys write code so many lines? WAHAHAHa!

  • donaldsebleung Avatar

    Great Kata, absolutely loved it, ranked and upvoted :D I think there's a very minor spelling mistake though in the test cases - where it says 'Simple "glidder" implementation' I think you mean "glider"? ;)

    • smile67 Avatar

      Isn't it something for you too ("...interpreter...");-): https://www.codewars.com/kata/assembler-interpreter-part-ii/python Don't know if you use/like python...? It's really a nice kata - i think:-)!

    • St3f4n Avatar

      Hey guys. Yeah that was a typo, thx for noticing Donald, fixed it :)

      Suggestion marked resolved by St3f4n 8 years ago
    • smile67 Avatar

      By the way always good and interesting katas @St3f4n;-)! Thanks for your work...!

    • St3f4n Avatar

      A bit off the topic, but I have to say I have no prior education in computer science. I studied economics and decided to give JavaScript a chance a year ago, so I guess I should thank you guys too and all the "alliens" on this site that I learned a lot from :)

    • donaldsebleung Avatar

      Me neither, but I have to say, it's pretty impressive how you're now already 1 kyu in JavaScript despite only having started it a year ago; I've been working with JavaScript for almost three full years and I'm still a n00b ... :p

  • macobo Avatar

    This comment has been hidden.

    • St3f4n Avatar

      Hi, thanks for your feedback and for taking the time to solve it. All similar katas expect a function that expects the next iteration so I intentionally made a slightly different implementation. Oh and I've added an empty array test as well.