-
Notifications
You must be signed in to change notification settings - Fork 0
Week2 2 #4
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
base: master
Are you sure you want to change the base?
Conversation
| // using System.Collections.Generic; | ||
| // using System.Linq; | ||
| using System.Text; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are missing the tests.
| sentence = Console.ReadLine(); | ||
|
|
||
| foreach (string text in sentence.Split()) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are only handling the case when the vowel is in the first or second position.
|
|
||
| public static string CompareHands(string hand1, string hand2) | ||
| { | ||
| // Your code here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a different way to check for a tie?
| public static string CompareHands(string hand1, string hand2) | ||
| { | ||
| // Your code here | ||
| if (hand1 == "rock" && hand2 == "rock") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method directly prints out to the console, I would like for this method to not do any user interaction, but return the appropriate value/result. And the calling method (Main in your case) handle the user interaction.
|
|
||
| return hand1 + ' ' + hand2; | ||
| } | ||
| // public static bool test() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the tests defined, but the way you implemented CompareHands, these tests would not work.
| public static void Main() | ||
| { | ||
| Console.WriteLine("Enter hand 1:"); | ||
| string hand1 = Console.ReadLine().ToLower(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see the try/catch block anywhere.
|
It looks like my try catch is with my compare hand method. Did I have to use it somewhere else?
…Sent from my iPhone
On Nov 11, 2018, at 1:41 PM, yousifS ***@***.***> wrote:
@yousifS commented on this pull request.
In RockPaperScissors/RockPaperScissors.cs:
> @@ -8,18 +8,121 @@ public static void Main()
{
Console.WriteLine("Enter hand 1:");
string hand1 = Console.ReadLine().ToLower();
I dont see the try/catch block anywhere.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
No description provided.