• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release nCr and Factorial Functions
#1
Hi

More random garbage I have just found around my files, I have no idea why I made this things long time ago. I´ll probably download MW2 soon Big Grin

Code:
nCr( n, r )
{
    return ( Factorial( n ) / ( Factorial( r ) * Factorial( n - r ) ) );
}

Factorial( number )
{
    fact = 1;
    for( i = 1 ; i <= number ; i ++ )
              fact *= i;
    return fact;
}

http://en.wikipedia.org/wiki/Binomial_coefficient

Thanks for reading Smile
[Image: veovuq.png]
[-] The following 1 user says Thank You to Yamato for this post:
  • Nekochan
  Reply
#2
If you mirror this you could make a pyramid of carepackages without the need to set the coordinates yourself (except for one where the pyramid starts).
[-] The following 1 user says Thank You to surtek for this post:
  • Yamato
  Reply
#3
Inb4 pyramid bunkers incoming, @surtek .

stahp! Troll
C++/Obj-C developer. Neko engine wip
Steam: Click
[-] The following 1 user says Thank You to Nekochan for this post:
  • surtek
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Release] Matrix Functions Yamato 1 1,180 07-29-2013, 20:14
Last Post: Rendflex
  [Release] Random Functions 1.1 Yamato 22 5,542 04-20-2013, 10:13
Last Post: Dominator56
  Functions surtek 14 5,898 09-19-2012, 07:57
Last Post: Pozzuh
Information [Solved] Info about functions, events and etc. Nerus 2 1,139 09-09-2012, 20:57
Last Post: surtek
  Seldom required functions Phl3x_ 3 1,453 06-03-2012, 10:53
Last Post: RaZ
  Help I find This functions and i need your help. Bloodfocus 5 1,850 04-23-2012, 01:43
Last Post: House
  Help Functions iPrintLnBold() [Z00MBY] Alex 7 3,026 04-16-2012, 08:44
Last Post: [Z00MBY] Alex
  [Release] Array functions master131 4 1,654 09-17-2011, 14:23
Last Post: AZUMIKKEL
  [Release] Random Functions Yamato 12 3,383 08-17-2011, 13:07
Last Post: Nekochan
  Mw2 Functions Injection - DLL NieXrlaM 11 5,811 08-01-2011, 08:52
Last Post: d0h!

Forum Jump:


Users browsing this thread: 1 Guest(s)