Click here to Skip to main content
15,881,882 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to calculate in c# the possibility of this game Pin
OriginalGriff22-Aug-20 22:13
mveOriginalGriff22-Aug-20 22:13 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor22-Aug-20 22:31
Exoskeletor22-Aug-20 22:31 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor22-Aug-20 22:32
Exoskeletor22-Aug-20 22:32 
GeneralRe: How to calculate in c# the possibility of this game Pin
OriginalGriff22-Aug-20 22:33
mveOriginalGriff22-Aug-20 22:33 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor22-Aug-20 22:37
Exoskeletor22-Aug-20 22:37 
GeneralRe: How to calculate in c# the possibility of this game Pin
OriginalGriff22-Aug-20 22:43
mveOriginalGriff22-Aug-20 22:43 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor22-Aug-20 22:57
Exoskeletor22-Aug-20 22:57 
GeneralRe: How to calculate in c# the possibility of this game Pin
OriginalGriff22-Aug-20 23:05
mveOriginalGriff22-Aug-20 23: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
Exoskeletor22-Aug-20 23:28
Exoskeletor22-Aug-20 23:28 
GeneralRe: How to calculate in c# the possibility of this game Pin
Luc Pattyn23-Aug-20 12:51
sitebuilderLuc Pattyn23-Aug-20 12:51 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor23-Aug-20 13:01
Exoskeletor23-Aug-20 13:01 
GeneralRe: How to calculate in c# the possibility of this game Pin
Luc Pattyn23-Aug-20 13:03
sitebuilderLuc Pattyn23-Aug-20 13:03 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor23-Aug-20 13:06
Exoskeletor23-Aug-20 13:06 
GeneralRe: How to calculate in c# the possibility of this game Pin
trønderen23-Aug-20 13:28
trønderen23-Aug-20 13:28 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor23-Aug-20 13:33
Exoskeletor23-Aug-20 13:33 
GeneralRe: How to calculate in c# the possibility of this game Pin
Luc Pattyn23-Aug-20 15:57
sitebuilderLuc Pattyn23-Aug-20 15:57 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor24-Aug-20 0:35
Exoskeletor24-Aug-20 0:35 
GeneralRe: How to calculate in c# the possibility of this game Pin
Richard MacCutchan24-Aug-20 1:04
mveRichard MacCutchan24-Aug-20 1:04 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor24-Aug-20 1:10
Exoskeletor24-Aug-20 1:10 
GeneralRe: How to calculate in c# the possibility of this game Pin
Eddy Vluggen24-Aug-20 12:52
professionalEddy Vluggen24-Aug-20 12:52 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor24-Aug-20 23:22
Exoskeletor24-Aug-20 23:22 
GeneralRe: How to calculate in c# the possibility of this game Pin
Luc Pattyn24-Aug-20 7:48
sitebuilderLuc Pattyn24-Aug-20 7:48 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor24-Aug-20 23:22
Exoskeletor24-Aug-20 23:22 
GeneralRe: How to calculate in c# the possibility of this game Pin
trønderen26-Aug-20 0:50
trønderen26-Aug-20 0:50 
GeneralRe: How to calculate in c# the possibility of this game Pin
Exoskeletor23-Aug-20 19:23
Exoskeletor23-Aug-20 19: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.