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

Dice Game #31

Merged
merged 16 commits into from
Apr 13, 2022
Merged

Dice Game #31

merged 16 commits into from
Apr 13, 2022

Conversation

javithegreat35
Copy link
Contributor

Hello, I have created a new game called "Dice Game" which has the player go up against a computer and they will each roll a dice 10 times and the player who gets the higher number 10 times wins the game.

@ZacharyPatten
Copy link
Collaborator

Hello. Thanks for checking out the repo and contributing. :)

I will review this pull request as soon as I have time to do so.

@ZacharyPatten ZacharyPatten self-assigned this Apr 12, 2022
@ZacharyPatten
Copy link
Collaborator

I made some changes:

  • f0801a3 moved the project into the Projects directory because that is where all the projects are
  • f1ada2d I changed Console.ReadKey() to Console.ReadKey(true) because this hides the user input (for example if the user types the A key)
  • f3b01e8 added a description of the game that shows when the application is launched
  • ff86f29
    • changed the turn order so that the Rival rolls the dice first as I felt it would add more anticipation because the player knows what they need to roll to win.
    • removed the Thread.Sleep because I don't think it is entirely necessary here
    • updated the output verbiage a bit
  • 638994a removed class Program so that the code is top-level statements because it is shorter
  • 4a168b7 used string interpolation to simplify the code from
    "The score is now - You : " + playerPoints + ". Rival : " + rivalPoints + "." to
    $"The score is now - You : {playerPoints}. Rival : {rivalPoints}."
  • cd9290b moved the declaration of rivalRandomNum and playerRandomNum inside the loop rather than before because that is generally the preferred place to declare variables

And I made some additions:

  • 43d9c5f added a blazor port of the game so that it will appear on the website and be playable online :)
  • 7acfdff added the necessary files so that Dice Game shows up as an option when using Visual Studio Code
  • eb2dfac added a GitHub Actions workflow for build validation
  • c18112d added Dice Game to README.md so it shows up on the home page of the GitHub repo and and added a Projects\Dice Game\README.md

@javithegreat35
Copy link
Contributor Author

javithegreat35 commented Apr 13, 2022 via email

@ZacharyPatten ZacharyPatten merged commit 8daddd0 into dotnet:main Apr 13, 2022
@ZacharyPatten
Copy link
Collaborator

ZacharyPatten commented Apr 13, 2022

This pull request has bene merged. Thanks @javithegreat35 for contributing a new game, and congratulations on your first pull request on GitHub!

If you want to show off your game, it is playable at this link: https://zacharypatten.github.io/dotnet-console-games/Dice%20Game

#17

@ZacharyPatten
Copy link
Collaborator

ZacharyPatten commented Apr 19, 2022

By the way, yours was the first game to be contributed and not originally written by myself (other contributors contributed to existing games). You already show up in the contributors tab of the repo, but if you would to be explicitly mentioned on that game let me know.

For example...

contributors: @javithegreat35

...could be added in the Notes column of the Dice Game row of the table in the README.md.

@javithegreat35
Copy link
Contributor Author

javithegreat35 commented Apr 25, 2022 via email

@ZacharyPatten ZacharyPatten added the community contribution Games originally contributed by members of the community. Thank you! label Apr 29, 2022
@ZacharyPatten ZacharyPatten removed their assignment Apr 29, 2022
Fuinny pushed a commit to Fuinny/dotnet-console-games that referenced this pull request Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community contribution Games originally contributed by members of the community. Thank you!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants