« Programmation objet et géométrie/Programmation avec DrGeoII » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 220 :
stats:=Array new: 12.
2 to: 12 do: [:i | stats at: i put: 0].
gobelet:=[(1 to: 6) atRandom].
 
1 to: 100 do: [:i|
de1:=[(1 to: 6) atRandom]gobelet value.
de2:=[(1 to: 6) atRandom]gobelet value.
s:=de1+de2.
stats at: s put: ((stats at: s)+1).
Ligne 238 ⟶ 239 :
 
<source lang="smalltalk">
|figure gobelet de1 de2 s stats a b|
stats:=Array new: 12.
2 to: 12 do: [:i | stats at: i put: 0].
gobelet:=[(1 to: 6) atRandom].
figure := DrGeoCanvas new.
1 to: 10000 do: [:i|
de1:=[(1 to: 6) atRandom]gobelet value.
de2:=[(1 to: 6) atRandom]gobelet value.
s:=de1+de2.
stats at: s put: ((stats at: s)+1).