Created
June 23, 2015 12:54
-
-
Save ilpropheta/b0513014e9e67779624a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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