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

02 ternary v4 #30

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

Conversation

RomanMokych
Copy link

No description provided.

@@ -21,7 +21,7 @@ If your language provides a method in the standard library to perform the conver

int IntFromTernaryNumberString(const std::string& ternaryNumberString)
{
return 1;
return ternaryNumberString.front() - '0';
Copy link
Collaborator

Choose a reason for hiding this comment

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

как только ты добавляешь front() или back() сразу стоит задуматься о тесте с пустой строкой :)

@@ -26,7 +26,7 @@ int IntFromTernaryNumberString(const std::string& ternaryNumberString)
return (ternaryNumberString.front() - '0') * 3;
}

return ternaryNumberString.back() - '0';
Copy link
Collaborator

Choose a reason for hiding this comment

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

не совсем понял с чем связано это изменение на этапе красного теста

Copy link
Collaborator

@mettizik mettizik left a comment

Choose a reason for hiding this comment

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

Ты наверное даже немного перестарался с маленькими шагами, std::pow можно было ввести раньше (на этапе рефакторинга теста на 100), это сделало бы переход к циклу более очевидным и ты на том же этапе рефакторинга смог бы его ввести

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.

2 participants