
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/System.hpp>
#include <iomanip>
#include <iostream>


////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Get the initial seed
    unsigned int InitialSeed = sf::Randomizer::GetSeed();
    std::cout << "Initial seed : " << InitialSeed << std::endl << std::endl;

    // Generate a few ints between 0 and 100
    std::cout << "Generating 10 random integers between 0 and 100 :" << std::endl;
    for (int i = 0; i < 10; ++i)
        std::cout << sf::Randomizer::Random(0, 100) << " ";
    std::cout << std::endl << std::endl;

    // Generate a few floats between -1 and 1
    std::cout << "Generating 10 random floats between -1 and 1 :" << std::endl;
    std::cout << std::fixed << std::setprecision(2);
    for (int i = 0; i < 10; ++i)
        std::cout << sf::Randomizer::Random(-1.f, 1.f) << " ";
    std::cout << std::endl << std::endl;

    // Put back the initial seed : we should get the same sequence
    std::cout << "Resetting to the initial seed..." << std::endl
              << "(generated numbers should be the same as before)" << std::endl << std::endl;
    sf::Randomizer::SetSeed(InitialSeed);

    // Generate a few ints between 0 and 100
    std::cout << "Generating 10 random integers between 0 and 100 :" << std::endl;
    for (int i = 0; i < 10; ++i)
        std::cout << sf::Randomizer::Random(0, 100) << " ";
    std::cout << std::endl << std::endl;

    // Wait until the user presses enter key
    std::cout << "Press enter to exit...";
    std::cin.ignore(10000, '\n');

    return EXIT_SUCCESS;
}

