Click here to Skip to main content
15,798,278 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to calculate in c# the possibility of this game Pin
OriginalGriff22-Aug-20 23:13
mvaOriginalGriff22-Aug-20 23:13 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor22-Aug-20 23:31
Exoskeletor22-Aug-20 23:31 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor22-Aug-20 23:32
Exoskeletor22-Aug-20 23:32 
GeneralRe: How to calculate in c# the possibility of this game Pin
OriginalGriff22-Aug-20 23:33
mvaOriginalGriff22-Aug-20 23:33 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor22-Aug-20 23:37
Exoskeletor22-Aug-20 23:37 
GeneralRe: How to calculate in c# the possibility of this game Pin
OriginalGriff22-Aug-20 23:43
mvaOriginalGriff22-Aug-20 23:43 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor22-Aug-20 23:57
Exoskeletor22-Aug-20 23:57 
GeneralRe: How to calculate in c# the possibility of this game Pin
OriginalGriff23-Aug-20 0:05
mvaOriginalGriff23-Aug-20 0:05 
That's because C# doesn't contain a factorial function - but it's trivial to create one yourself, it's one of the first exercise beginners are often given. Recursive or iterative, it's simple either way:
C#
private static int FactorialRecursive(int x)
    {
    return (x > 1 ? x * FactorialRecursive(x - 1) : 1);
    }
private static int FactorialIterative(int x)
    {
    int f = 1;
    while (x > 1)
        {
        f *= x--;
        }
    return f;
    }
So why couldn't you just write those? Or google for them?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor23-Aug-20 0:28
Exoskeletor23-Aug-20 0:28 
GeneralRe: How to calculate in c# the possibility of this game Pin
Luc Pattyn23-Aug-20 13:51
sitebuilderLuc Pattyn23-Aug-20 13:51 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor23-Aug-20 14:01
Exoskeletor23-Aug-20 14:01 
GeneralRe: How to calculate in c# the possibility of this game Pin
Luc Pattyn23-Aug-20 14:03
sitebuilderLuc Pattyn23-Aug-20 14:03 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor23-Aug-20 14:06
Exoskeletor23-Aug-20 14:06 
GeneralRe: How to calculate in c# the possibility of this game Pin
trønderen23-Aug-20 14:28
trønderen23-Aug-20 14:28 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor23-Aug-20 14:33
Exoskeletor23-Aug-20 14:33 
GeneralRe: How to calculate in c# the possibility of this game Pin
Luc Pattyn23-Aug-20 16:57
sitebuilderLuc Pattyn23-Aug-20 16:57 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor24-Aug-20 1:35
Exoskeletor24-Aug-20 1:35 
GeneralRe: How to calculate in c# the possibility of this game Pin
Richard MacCutchan24-Aug-20 2:04
mveRichard MacCutchan24-Aug-20 2:04 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor24-Aug-20 2:10
Exoskeletor24-Aug-20 2:10 
GeneralRe: How to calculate in c# the possibility of this game Pin
Eddy Vluggen24-Aug-20 13:52
professionalEddy Vluggen24-Aug-20 13:52 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor25-Aug-20 0:22
Exoskeletor25-Aug-20 0:22 
GeneralRe: How to calculate in c# the possibility of this game Pin
Luc Pattyn24-Aug-20 8:48
sitebuilderLuc Pattyn24-Aug-20 8:48 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor25-Aug-20 0:22
Exoskeletor25-Aug-20 0:22 
GeneralRe: How to calculate in c# the possibility of this game Pin
trønderen26-Aug-20 1:50
trønderen26-Aug-20 1:50 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor23-Aug-20 20:23
Exoskeletor23-Aug-20 20:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.