Skip to content

Instantly share code, notes, and snippets.

@ilpropheta
Created June 23, 2015 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilpropheta/b0513014e9e67779624a to your computer and use it in GitHub Desktop.
Save ilpropheta/b0513014e9e67779624a to your computer and use it in GitHub Desktop.
#include <random>
#include <iostream>
namespace boost
{
namespace mario
{
enum class Mano
{
Piuma=0, Fero=1
};
std::ostream& operator<<(std::ostream& os, Mano m)
{
switch (m)
{
case Mano::Piuma:
os << "Piuma";
break;
case Mano::Fero:
os << "Fero";
break;
}
return os;
}
Mano come_po_esse()
{
std::default_random_engine eng;
return static_cast<Mano>(std::uniform_int_distribution<int>(0,1)(eng));
}
}
}
int main()
{
std::cout << boost::mario::come_po_esse() << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment