number_guessing_game's People
number_guessing_game's Issues
remove unused namespaces
If you don't know where a using is coming from or you don't know what it's for remove it.
You can also Visual Studio let figure it out by right-clicking on the using and select "Remove and Sort usings" or use the shortcut
Ctrl + R, Ctrl + G
Consistency is key
number_guessing_game/number_guessing_game/Program.cs
Lines 32 to 37 in e8373be
Try to be consistent within your codebase, regarding indentation and placing of curly brackets
show the user the random number
Just a suggestion, but if the user did not quess the correct number, it would be nice to show him, what the hidden number was :)
combine condition checks into one condition
number_guessing_game/number_guessing_game/Program.cs
Lines 27 to 37 in e8373be
Instead of checking if "i >= 0" vor every if-condition, you could wrap it around your checks.
Also think about if you really need to calculate number range for every guess?
using Math.Abs
Instead of checking for the positive and negative range, you could use the Math.Abs function and only compare for the flat value
https://learn.microsoft.com/en-us/dotnet/api/system.math.abs?view=net-7.0
This way you could also even omit the declaration of the numberRange variable at all,
because Math.Abs can also work with mathematic expressions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.