This is a simple Bean machine program done in C++ for KTSI.
This is how it works, you drop 100 balls and they fall in 6 different boxes.

#include#include #include using namespace std; int main (int argc, char * const argv[]) { // initial int ballCount = 100; int box[6] = { 0, 0, 0, 0, 0 }; string line = " +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-->"; string numbers = " 0 5 10 15 20 25 30 35 40 45 50"; int leftorright = 0; // Need for Random Numbers srand ( time(NULL) ); // Rund ballCount (100) zahl = rand() % 2; for (int i=0; i I also did this program in Powershell


