You removed the ruby examples and replaced them with javascript, but javascript should be added to ruby (the description is shared between all languages).
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.
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
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+).
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
merged and approved
!
Цікавий підхід
Known CW bug, I fixed it. Thanks!
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
thanks, description is confusing
This comment is hidden because it contains spoiler information about the solution
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.
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.
This comment is hidden because it contains spoiler information about the solution
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.
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
Thanks for your comment
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
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.
Loading more items...