Version 2.0 one of these days…
This Template was made from scratch…And I is Time I make another one from scratch(been saying it for a month) I mean a major realease though…with a real slot machine, not an intergrated on in the corner. The chances of winning will be made more realistic. What could be better than reading my blog, playing my slot machine and whacking off all at the same time? (porno in the blog?) Well I have officially begun work on version 2.0….I have a blank document with the <!DOCTYPE so far :)…I will also be switching hosts, hopefully. ALong with the switching hosts, I will be able to use MySQL(hopefully)….lots of fun can come out of this…along with version 2.0 of my Blog will come version 4.0 of my subprofile. (skipped a few minor releases, which means I am actually making big changes..) Version 4.0 will have an API, and hence be more includes-based. I might even change the pages, and the colors again…I haven’t decided…I am beginning to need a versioning system for this project :p.
Well, yesterday I promised an inverse for factorail, so here goes…
Factorial is the multiplication of a number by all preceeding numbers (until 1). The symbol for factorial is !. So…5! is 5*4*3*2*1 this yields 120. Taking the inverse of that isn’t all as hard as it seems, but first, allow me to write what Factorial would be written as a computer program.
#include <iostream>
int main() {
using std::cout;
using std::cin;
int num;
int newNumber=1;
int i;
cout << "\n What number would you like the Factorial of?: ";
cin >> num;
for ( i=num; i > 1; i– ) {
newNumber *= i;
}
cout << "\n " << num << "!=" << newNumber << "\n\n";
}
Yippeee!!! the main element there is the loop. It loops around X number of times, and multiplies by a different number each time. The inverse is a MUCH more lenghty process. You have to loop through and do the division, starting from one, but each iteration, you must check to see if the number ! comes out to the number you are un factorialing. I am not going to show the code here….Too Lazy.
Can one trick a calculator into using binary? Converting?