samedi 6 janvier 2018

How do I randomly assign variables to a 2D array in C++?

I've been working on a project for about a week now that involves throwing pennies in a 2D array by which 15 spots (of 20) are 5 different prizes. Right now, I have a board (all labeled with O to represent an empty spot).

O O O O O

O O O O O

O O O O O

O O O O O

How do I put random objects at different spots so that the board displays it and stores it in the 2D array so that it looks like this?

X O E O E

O J W J O

E W D X O

O D W O O

O J X O D

Aucun commentaire:

Enregistrer un commentaire