Skip to content

Conversation

@mtrich
Copy link
Owner

@mtrich mtrich commented Oct 16, 2018

No description provided.

Michael Rich added 2 commits October 15, 2018 18:36
…n a normal vowel break the code ex. my, tsktsk, cry, fly. Also need to add comments
namespace PigLatin
{
class Program
{
Copy link

Choose a reason for hiding this comment

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

I dont see the tests.

int firstYIndex = word.IndexOfAny(new char[] {'Y','y'});

//checks if Y acts as vowel
if ((firstYIndex > 0) && (firstYIndex < firstVowelIndex) && (word.ToLower().Contains("y")))
Copy link

Choose a reason for hiding this comment

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

if firstYIndex is greater than 0 then the word must contain a 'y' so that last condition is not really needed.

int firstYIndex = word.IndexOfAny(new char[] {'Y','y'});

//checks if Y acts as vowel
if ((firstYIndex > 0) && (firstYIndex < firstVowelIndex) && (word.ToLower().Contains("y")))
Copy link

Choose a reason for hiding this comment

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

if firstYIndex is greater than 0 then the word must contain a 'y' so that last condition is not really needed.

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.

3 participants