-
Notifications
You must be signed in to change notification settings - Fork 0
CSHARPFUNDAMENTAL: -Set1-Task7 #9
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
Open
navjot1983
wants to merge
6
commits into
main
Choose a base branch
from
users/navjot/set1-task7
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eb0501a
CSHARPFUNDAMENTAL:-Set1-Task7
navjot1983 fe41d33
CODE RUB: Fix the level
navjot1983 0d06378
CODE RUB: Use The random Number.
navjot1983 de66ee9
CODE RUB: Change The Name of SLN
navjot1983 ee9387a
CODE RUB: WorkFlow
navjot1983 7c73bc6
CODE RUB: fix the name of project
navjot1983 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| int[] player1Coin = new int[5] { 7, 5, 1, 25, 30 }; | ||
| int[] player2Coin = new int[5] { 5, 5, 10, 1, 25 }; | ||
| double player1TotalScore = 0; | ||
| double player2TotalScore = 0; | ||
|
|
||
| for (int i = 0; i < player1Coin.Length;) | ||
| for (int j = 0; j < player2Coin.Length;) | ||
|
navjot1983 marked this conversation as resolved.
|
||
| { | ||
| if (player1Coin[i] > player2Coin[j]) | ||
| { | ||
| player1TotalScore += 1; | ||
| Console.WriteLine("\n player one coin is : = " + player1Coin[i]); | ||
| Console.WriteLine(" player two coin is : = " + player2Coin[i]); | ||
|
navjot1983 marked this conversation as resolved.
|
||
| Console.WriteLine(" player one is the winner."); | ||
| Console.WriteLine("==========================="); | ||
| } | ||
| else if (player1Coin[i] < player2Coin[j]) | ||
| { | ||
| player2TotalScore += 1; | ||
| Console.WriteLine("\n player one coin is : = " + player1Coin[i]); | ||
| Console.WriteLine(" player two coin is : = " + player2Coin[i]); | ||
| Console.WriteLine(" player two is the winner."); | ||
| Console.WriteLine("==========================="); | ||
| } | ||
| else | ||
| { | ||
| player1TotalScore += 0.5; | ||
| player2TotalScore += 0.5; | ||
| Console.WriteLine("\n player one coin is : = " + player1Coin[i]); | ||
| Console.WriteLine(" player two coin is : = " + player2Coin[i]); | ||
| Console.WriteLine(" Both player are the winners."); | ||
| Console.WriteLine("==========================="); | ||
| } | ||
| i++; | ||
| j++; | ||
| } | ||
|
|
||
| if (player1TotalScore > player2TotalScore) | ||
| { | ||
| Console.WriteLine("\t\n.*******The winner of this game is Player1 with Score of := ." + player1TotalScore + ".*******"); | ||
| } | ||
| else if (player1TotalScore < player2TotalScore) | ||
| { | ||
| Console.WriteLine("\t\n*******The winner of this game is Player2 with Score of := ." + player2TotalScore + ".*******"); | ||
| } | ||
| else | ||
| { | ||
| Console.WriteLine("\t\n.*******The game is tie *******"); | ||
| } | ||
| Console.ReadLine(); | ||
11 changes: 11 additions & 0 deletions
11
CSharpFundamentals/Set1-Task2/Set1-Task6/Set1-Task7.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net7.0</TargetFramework> | ||
| <RootNamespace>Set1_Task6</RootNamespace> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| </Project> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.