Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr-10 #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Pr-10 #11

wants to merge 2 commits into from

Conversation

CheezItMan
Copy link

No description provided.

Copy link

@ranuseh ranuseh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall all good.

end

def to_roman
n = self
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More descriptive variable names

require 'minitest/autorun'
require_relative 'roman_numerals'

# Common test data version: 1.0.0 070e8d5

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add edge cases?

@paulentine
Copy link

I like how you committed your tests before committing your code. Red-green-refactor!

end

def to_roman
n = self

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would benefit to leave comment that n is an instance of Fixnum, which gets converted to roman via to_roman

@@ -0,0 +1,30 @@
class Fixnum

def roman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is in a method?

roman.rb Show resolved Hide resolved
result = ""
roman.each do |num, letter|
result << letter * (n / num)
n = n % num

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be slightly shortened with n %= num

end

def test_2
skip

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to be skipping these tests? We probably want to comment these out.

@@ -0,0 +1,30 @@
class Fixnum

def roman

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we think about making this an instance variable vs. a function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants