diff --git a/code/do_strange_stuff.cpp b/code/do_strange_stuff.cpp new file mode 100644 index 0000000..839e928 --- /dev/null +++ b/code/do_strange_stuff.cpp @@ -0,0 +1,40 @@ +#include +#include +#include + +template +void swapThem(T* a, T* b) +{ + T c = *b; + *b = *a; + *a = c; +} + +// a strange implementation of the fibonacci algorithm, because why not ! + +int main(void) +{ + using bigint_t = unsigned long long int; + + // setting the seed for rand + srand(static_cast(time(0))); + // some variables to store the fibonacci serie + bigint_t a = 1, b = 0; + // find a limit + unsigned c = 0, limit = (rand() % 30) + 10; + + while (true) + { + // calculating the fibonacci serie and displaying it + a += b; + std::cout << a << " "; + swapThem(&a, &b); + c++; // so much fun ^^ + + if (c == limit) + break; + } + std::cout << std::endl; + + return 0; +} diff --git a/code/helloworld.php b/code/helloworld.php new file mode 100644 index 0000000..b0ff2f4 --- /dev/null +++ b/code/helloworld.php @@ -0,0 +1,3 @@ +