Комментарии:
Thank you
ОтветитьYou missed the shovel << operator for adding to arrays smh
ОтветитьBro how come every video is like learn ruby coding but no videos are like here's what I did with ruby coding, might have to do something about that
ОтветитьTyhansen
ОтветитьAre you still smoking Ecigs Derek? 😀Nice bookmark on your browser 😀
Ответитьthank you for course
ОтветитьGreat video.
ОтветитьAny new updated video coming of Ruby ?
ОтветитьAmazing tutorial my guy <3
Ответитьamazing work ! thanks so much !
ОтветитьExcellent. Really glad to find a source that did not cover all the basics of programming and just got to the point.
Ответитьscarlet ruby farmming
ОтветитьAfter this one video, I'll probably be mostly good. I'll go straight to the Go video next
You should do a Rust video sometime! As a advanced Rust dev, we need more material out there
Thank you. I will look for you on Udemy.
ОтветитьBest
ОтветитьGood explanation...thank you.
ОтветитьWhich IDE are you using?
Ответитьi know ruby
ОтветитьThank you so much for the tutorial, as a python learner as well I see a ton of similarities to Python. So I think it can glom onto this language
ОтветитьThe syntax parser seems to be doing left-first traversal. Meaning, in Python we do "If (condition): continue", while here its "next unless". Maybe I am wrong, but most commands do something similar it seems
ОтветитьSpeedrunning Ruby, WORLD RECORD
ОтветитьIs Derek Banas god ?
ОтветитьI just have ONE question. Why *STAY HOME*??
Ответить55 minutes later... Ruby syntax is ugly.
ОтветитьIncredibly efficient, well put-together video. Helped me review for my final without wasting time. Thanks!
Ответитьok, now this:
"""
s = "cat cat cat"
puts s.count("cat") # = 9
"""
is annoying.
apparently one has to use:
"""
s = "cat cat cat"
puts s.scan(/cat/).length # = 3
"""
to achieve what one would expect.
if someone is interested how a not-completely-trivial recursion works in ruby, here's what i have managed to discover:
"""
def max(*args)
case args.length
when 0 then return nil
when 1 then return args[0]
else
def _max(*args)
x, y, *tail = args
m = (x > y) ? x : y
return (tail.empty?) ? m : _max(m, *tail)
end
return _max(*args)
end
end
def min(*args)
case args.length
when 0 then return nil
when 1 then return args[0]
else
def _min(*args)
x, y, *tail = args
m = (x < y) ? x : y
return (tail.empty?) ? m : _min(m, *tail)
end
return _min(*args)
end
end
def sum(*args)
case args.length
when 0 then return nil
when 1 then return args[0]
else
def _sum(*args)
x, y, *tail = args
s = x + y
return (tail.empty?) ? s : _sum(s, *tail)
end
return _sum(*args)
end
end
def avg(*args)
case args.length
when 0 then return nil
when 1 then return args[0]
else
n = 2
def _avg(*args, n)
x, y, *tail = args
a = ((n-1)*x + y).fdiv(n)
return (tail.empty?) ? a : _avg(a, *tail, n+1)
end
return _avg(*args, n)
end
end
arr0 = []
arr1 = [4]
arr2 = [2, -3]
arr3 = [3, 5, 0, -4]
arrs = [arr0, arr1, arr2, arr3]
for arr in arrs do
nums = arr.to_s[1..-2]
puts "max(#{nums}) = #{max(*arr)}"
puts "min(#{nums}) = #{min(*arr)}"
puts "sum(#{nums}) = #{sum(*arr)}"
puts "avg(#{nums}) = #{avg(*arr)}"
end
"""
regarding looping on arrays, i have seen another that seems to be popular and quite funny:
"""
nums = [1, 2, 3, 4]
N = nums.length
N.times do |idx|
puts nums[idx]
end
"""
i have found a more ruby way to display these even numbers:
"""
num = 1
while num <= 10 do
puts num if num.even?
num += 1
end
"""
or
"""
num = 1
while num <= 10 do
puts num unless num.odd?
num += 1
end
"""
regarding ruby's case example, i think this would have been better:
"""
print "Enter greeting: "
greeting = gets.chomp.capitalize
case greeting
when "French" then
puts "Bonjour!"
when "Spanish" then
puts "Hola!"
else
puts "(peace sign)"
end
"""
i.e. one can capitalize and there is no need for these "exit"s as it doesn't seem to cascade anyways.
also, i like to put optional "then" as it reads almost like a sentence. ruby is amazing. :)
one thing I like to check in a new language is what it returns when I enter something like "-1 % 4", and i am so pleased to see that ruby returns 3 here and not -1. so pleased. 💗💗💗
ОтветитьGreat. A quick, complete and professional teaching.
Ответить"elsif" why no e??
ОтветитьAwesome
ОтветитьAlternative title: Derek having a midlife crisis.
ОтветитьThis is the way i teach people.
Thank you, Derek.
Now i can use this object-oriented language (it has classes i see).
Saving this for later
ОтветитьLoved it! Thanks man!!
ОтветитьJust wondering, but what's the point of ennumerabels? like, it seems like an Array with extra steps, great content, thank you so much
ОтветитьHow about a refresher? what changed in new latest version
ОтветитьThank you so much for this video. I will take it piece by piece.
Ответитьdef ask_integer(message)
print message+' '
gets.to_i
end
i1=ask_integer('first integer?')
i2=ask_integer('second integer?')
puts "#{i1}+#{i2}=#{i1+i2}"