tsp_cpp/snippets/Coinche.h

30 lines
887 B
C
Raw Permalink Normal View History

#pragma once
#include <vector>
#include <random>
#include <iostream>
#include <string>
#include <ctime>
#include <algorithm>
enum Couleur {coeur, carreau, pique, trefle, last};
enum Force { sept, huit, neuf, valet, dame, roi, dix, as, dernier };
struct card {
Couleur couleur;
Force force;
int value;
};
std::ostream& operator << (std::ostream& ostream,const Couleur& couleur);
std::ostream& operator << (std::ostream& ostream, const Force& force);
std::ostream& operator << (std::ostream& ostream, const card& card);
static std::random_device randomDevice;
static std::default_random_engine engine(randomDevice());
std::vector<card> generate_cards();
void update_values(Couleur atout , std::vector<card> &deck, std::vector<card> &jeu);
Couleur pick_atout();
bool WonOrLost(card played, card chosen, Couleur atout);
card play(card played, std::vector<card> &jeu, Couleur atout);