Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Jun 2010
Offline Last Active Aug 22 2012 01:26 PM

Posts I've Made

In Topic: [SFML] random number generator

17 December 2010 - 11:06 PM

You probably do not want to seed the random number generator with GetElapsedTime(). This function will give you the time since the application has started, which should be approximately the same number every time.

Instead, you could use:

#include <iostream>
#include <time>
#include <SFML/System.hpp>

int main(int argc, char**argv)
int _random = sf::Randomizer::Random(0,100);

std::cout << _random << std::endl;

return 0;

.. which would give you the number of seconds since 1970, and is always unique.

Hope it helps, cheers!

In Topic: Is there a way to calculate interior angles of a triangle with side lengths?

16 June 2010 - 10:40 PM


You should be able to solve this problem using the rule of cosine first and then the rule of sine. The rule of cosine can be used to get one of the angles, by knowing two sides, and then you can use the rule of sine to get the rest of them.

Hope this helps and that you solve your problem. Cheers! - Rarosu