samedi 7 avril 2018

How to hand out a number randomly between variables in Java?

I want to hand out the number 5 randomly between 4 variables.

e.g:

BEFORE:

int a = 0;
int b = 0;
int c = 0;
int d = 0;

AFTER:

int a = 2;
int b = 0;
int c = 1;
int d = 2;

or

int a = 0;
int b = 3;
int c = 0;
int d = 2;

or anything, but the most important is that the a+b+c+d has to equal 5 .

Thank you for your answer!




Aucun commentaire:

Enregistrer un commentaire