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.
https://docs.ruby-lang.org/en/master/doc/syntax/literals_rdoc.html
"There is also a character literal notation to represent single character strings, which syntax is a question mark (?) followed by a single character or escape sequence that corresponds to a single codepoint in the script encoding:"
It is in the Ruby documentation. No, it's not Symbols (:Ruby) but it's quite a mess since originally this was intended as a Number literal but doing
?a
to get97
was confusing and it wasn't intuitive so now it's a String and people can just do?a.ord
for97
.Sorry if this is real nooby question, but why does ?* == * as a string
I cant find anything about ?* in the Ruby documentation
Edit: also how do I put code into the little boxes like Unihedron has?
Checks the binary 1st digit. 1 is odd.
Very nice. Just: what does ".count{|d| d[0] == 0}" ?
I cant understood...
Awesome solution!
I got error message even the test is passed.
I delete all the code, just kept the return 0 if array.empty? and i got error below the right return.
Test Passed: Value == 0
main.rb:5:in
getLengthOfMissingArray' main.rb:21:in
block (2 levels) in'
/runner/frameworks/ruby/cw-2.rb:180:in
wrap_error' /runner/frameworks/ruby/cw-2.rb:72:in
it'/runner/frameworks/ruby/cw-2.rb:206:in
it' main.rb:10:in
block in'
/runner/frameworks/ruby/cw-2.rb:55:in
block in describe' /runner/frameworks/ruby/cw-2.rb:46:in
measure'/runner/frameworks/ruby/cw-2.rb:51:in
describe' /runner/frameworks/ruby/cw-2.rb:202:in
describe'main.rb:9:in `
'
Hum! Very interesting, thank you!
Strings are mutable in Ruby, when the validation function is executed, it uses the value you previously mutated, giving the wrong result.
The + instead of the <<... obviously!
What i don't understand and what make me stop testing other obvious solutions is the fact that the "expected" result is wrong. How can it be?
You're mutating
first_name
in yourget_full_name
method. Use another way to do string concatenation that doesn't mutate your strings.This comment is hidden because it contains spoiler information about the solution
No, it's not like you claim. You're probably mutating the input or your initializer is wrong. Why don't you show your code? I can't help you if you don't do that.
All the inputs in the submit final tests are expecting to be doubled.
Without any code, you can tell if an input "Name" is expecting result "Name Name". I think we are not expecting that.
One more example :
Expected: "Clint Southhill Southhill", instead got: "Clint Southhill"
Input: "Clint", "Southhill"
AFAIK Ruby tests work. It's probable your code is the culprit, can't tell without seeing it, remember to use Spoiler content flag if you post it.
Expected: "Southriver Southriver", instead got: "Southriver"
Inputs : "Southriver"
Loading more items...