//Dice throwing with array - use 8X12 fonts #include "stdafx.h" #include #include #include #include using namespace System; //needs clr support using namespace std; int throw_n_dice(int n) //sum of n dice outcomes { int sum=n; while(n--)sum+=rand()%6; return sum; } const int DICE=2; //2-4 const int OUTCOMES=(DICE*6)-DICE+1; //number of different outcomes void main(void) { srand(time(NULL)); Console::SetWindowSize(80,50); // use 8X12 fonts int outcome[OUTCOMES]={0}; //2-12 while(1) { int x,space=3; //space between bars for(int i=0 ; i<200 ; i++) outcome[throw_n_dice(DICE)-DICE]++; //play Console::Clear(); x=1; int y; for(int i=0 ; i