vendredi 27 novembre 2020

Fill an array[][] with either X or 'c'

i have an array the size 200200 filled all with the letter 'c'. Now I have to fill randomly in the middle of the array with the size of 1010 either the letter 'c' (which is already inside) or the letter 'x'.

So my guess was to solve it with a for-loop starting for both brackets [] at 94 to 104 and then use a random method to insert the value 'x'. But what random method is there, for something like this. I can not use Math.random for this right?




Aucun commentaire:

Enregistrer un commentaire