Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 9771

C# is a multi-paradigm, managed, strongly typed, garbage-collected, programming language created by Microsoft in conjunction with the .NET platform.

4 votes
4 answers
1k views

Why use this equation to get a percentage?

In an XNA book I read that this code does an action with a 0.2% of probability but I don't' understand why: float chance = 0.2f; if((float)rand.Next(0,1000) / 10 <= chance) { ... } I understand th …
0 votes
1 answer
1k views

Vector reflect problem

I'm testing some vector reflection and I want to check what happens when a ball collides with a paddle. So if I have: Vector2 velocity = new Vector2(-5, 2); position_ball += velocity; if (position …