Thread Rating:
  • 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. Ill 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
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).
Reply

#3
Inb4 pyramid bunkers incoming, @surtek .

stahp! Troll
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply



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

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.