Thursday, November 21, 2013

Getting Ready for Tonight's ADA After Hours

In preparation for tonight's ADA After Hours, I'm drilling down into the public parts of the Ada Dev Academy curriculum. Today's warm up (which I worry may take me all day to complete) utilizes rspec, a testing tool that comes up repeatedly in posts that I've read but that I haven't really started working with yet.

So.

After a bit of Googling and digging into Stackoverflow questions, I found a link posted by PriankaK in a question on SO, (shockingly) called "Getting Started with rspec." (Imagine that.) The link led me to a blog on automated testing techniques by none other than Jeff Nyman!  So, I'm poring over it, trying out a "testing spike", cramming in as much knowledge as I can on rspec and then I'll be able to actually start the "warm up" of writing a Hamming module. Yeay!

Things are going to start getting very frustrating. It's the uber-busy season at work (yeay, retail!) but I'm hopeful that I can catch up a bit when ADA starts working on Javascript (I will hopefully have less studying to do in order to complete those assignments.)

Back to work, but I wanted to share the link to Nyman's blog. It looks like it's going to be a very helpful source of info for me and may be for future learners, too. :D

P.S.

OMG I did it:

# Implement a Hamming Class here:
#
class Hamming

  def Hamming.compute(strand1, strand2)
    diff = 0

    if strand1 == strand2
      puts "they match"
    else
      length = strand1.length <= strand2.length ? strand1.length : strand2.length
      for i in (0..(length-1)) do
        if strand1[i] != strand2[i]
  diff += 1
end
      end
    end
    return diff
  end 

end

Excuse me while I vacuum up the yak hairs...

No comments:

Post a Comment

Comments? Questions? Complaints? Coladas?