 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Bernard fait la java ! Guest
|
Posted: Mon May 07, 2007 4:56 am Post subject: Petit coup de pouce java |
|
|
Pour sortir de la semoule et bien comprendre,
poucez vous me donner des pistes pour programmer un code pour créer un
programme qui simule un lancer de deux dés, et qui compte combien de lancers
sont nécessaires avant d'obtenir un double six. (voir la méthode
Math.random( ) dans la référence)
Merci de vos avis
Bernard |
|
| Back to top |
|
 |
Lew Guest
|
Posted: Mon May 07, 2007 5:30 pm Post subject: Re: Petit coup de pouce java |
|
|
Bernard fait la java ! wrote:
| Quote: | Pour sortir de la semoule et bien comprendre,
poucez vous me donner des pistes pour programmer un code pour créer un
programme qui simule un lancer de deux dés, et qui compte combien de lancers
sont nécessaires avant d'obtenir un double six. (voir la méthode
Math.random( ) dans la référence)
Merci de vos avis
|
Break the problem down into smaller pieces. How would you simulate the roll
of one die? How would you combine that with the roll of a second die? How
would you simulate a series of rolls of both dice?
Write code at each step, make sure it compiles and runs correctly, then add
the code for the next step.
--
Lew |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|