61.4k views
4 votes
Hunt the Wumpus Game c++ The game is played on a 5x5 grid. The grid contains a player (you), a wumpus (the enemy!), a pot of gold (reward) and some pits (random number from 5 - 10). Moving over a pit or onto a wumpus loses the game. Moving over the gold wins you the game.

User Alechan
by
5.9k points

1 Answer

2 votes

Answer:

//size indicated the rows.. assuming 5 cols. as the game has5*5grids

class Gameworld {

int gamestate [5][5 ];

public:

Gameworld(){};

.

.

.

}

Write all the function .For defining functions use gamestate array for every user input and store the game state in each cell.

You can use hard coding for moving up down in 5*5 grid.

Mapping keyboard keys will require event for each key press event and addfunctionality to move up down right left

User Tomasito
by
5.6k points