Ad
  • Custom User Avatar

    merged and approved

  • Custom User Avatar
  • Custom User Avatar

    Цікавий підхід

  • Default User Avatar

    Known CW bug, I fixed it. Thanks!

  • Custom User Avatar

    Hey, for those using TypeScript, you will need to fix the specs for the sample test to make reference a self closing tag like below

    /// <reference path="/runner/typings/mocha/index.d.ts" />
    /// <reference path="/runner/typings/chai/index.d.ts" />
    
  • Default User Avatar

    thanks, description is confusing

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thanks, is it ok that I have both in there. I made minor changes to the javascript program since things like station were not needed.

  • Custom User Avatar

    You removed the ruby examples and replaced them with javascript, but javascript should be added to ruby (the description is shared between all languages).

    You can fork and re-submit.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Can I humbly request you change the name of the function from push to unshift or prepend? Although it is completely my fault, I did not thoroughly read the instructions, and definitely wrote it as a push method.

  • Custom User Avatar

    Awesome kata. I would like to mention that when I left a 'byebug' line in the code, the system said I completed the kata. You may want to look into why the behavior occurred

  • Default User Avatar

    Thanks for your comment

  • Custom User Avatar

    Really challenging problem. I can't say if it is a 3 kyu or not, but definitely took me a bit to get it right. It would be interesting if you made a separate one that dealt more with efficiency. The top solution in ruby is elegant and really well thought out, but it can't handle moderately large numbers (anything in the 10 million+).

    Regardless, great problem

  • Custom User Avatar

    This was really challenging, but a lot of fun. It was refreshing to having a kata that was simple to understand and difficult to execute efficiently and cleanly.

    For people testing at home, I quickly wrote this to help create a randomize set of cards for testing.

      class Card
        attr_reader :count, :color, :shape, :filling
      
        def initialize(count, color, shape, filling)
          @count = count
          @color = color
          @shape = shape
          @filling = filling
        end
      end
      
      def create_cards
        cards = []
        [1,2,3].each do |cnt|
          ["red","green","blue"].each do |color|
            ["rect", "oval", "odd"].each do |shape|
              ["plain", "shade", "full"].each do |filling|
                cards << Card.new(cnt, color, shape,filling)
              end
            end
          end
        end
      
        return cards
      end
      
      def create_play_set
        cards = create_cards
        play_set = Array.new(4) { Array.new(3) }
      
        return play_set.map do |row|
          row.map do |value|
            cards.delete(cards.sample)
          end
        end
      end
    
  • Loading more items...