C++ 在这次独家新闻发布会上没有宣布掷骰子

C++ 在这次独家新闻发布会上没有宣布掷骰子,c++,C++,我有我的.hpp: #include <vector> #include <iostream> #include <ctime> #include <random> #ifndef ECHELLE #define ECHELLE struct Player{ int position; int n_step; Player(): position(0), n_step(0) {}; }; class SnakesAnd

我有我的.hpp:

#include <vector>
#include <iostream>
#include <ctime>
#include <random>

#ifndef ECHELLE
#define ECHELLE

struct Player{
    int position;
    int n_step;
    Player(): position(0), n_step(0) {};
};

class SnakesAndLadders{
    private:
        int n_players;
        int n_board;
        std::vector<Player> players;
        std::vector<int> board;
    public:
        SnakesAndLadders() : n_players(0), n_board(0), players(), board() {}
        SnakesAndLadders(int n,int N) : n_players(n), n_board(N), players(n), board(N) {for(int i =0; i<N; i++) {board[i]=i;} }
        int roll_die(std::mt19937 &) const;
};



#endif
#包括
#包括
#包括
#包括
#伊芬德夫埃谢尔酒店
#定义埃谢尔
结构播放器{
内部位置;
内n_步;
Player():位置(0),n_步(0){};
};
蛇梯类{
私人:
国际n_球员;
国际董事会;
向量机;
矢量板;
公众:
蛇梯():n_玩家(0),n_棋盘(0),玩家(),棋盘(){}

SnakesAndLadders(intn,intn):n个玩家(n),n个棋盘(n),玩家(n),棋盘(n){for(inti=0;i
roll\u die
被声明为
SnakesAndLadders
对象函数。要使用它,首先必须创建一个
SnakesAndLadders
对象

SnakesAndLadders snl;
snl.roll_die(G);

roll\u die
snakesandgraddes
classOh!谢谢!
snl->roll\u die(G);
,应该是
snl.roll\u die(G);
#include "blabla.hpp"
#include <fstream>
#include <string>


int main() {
     std::mt19937 G(time(NULL));
    double moy=0;
    for(int i=0; i<100; i++) {
        moy+=roll_die(G);
    }
    moy=moy/100;
    return 0;
}
SnakesAndLadders snl;
snl.roll_die(G);