You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
855 B
44 lines
855 B
function coupon7() {
|
|
int coup0 := 0;
|
|
int coup1 := 0;
|
|
int coup2 := 0;
|
|
int coup3 := 0;
|
|
int coup4 := 0;
|
|
int coup5 := 0;
|
|
int coup6 := 0;
|
|
|
|
int draw1 := 0;
|
|
int draw2 := 0;
|
|
int draw3 := 0;
|
|
|
|
int cost := 1;
|
|
|
|
while (!(coup0 = 1) | !(coup1 = 1) | !(coup2 = 1) | !(coup3 = 1) | !(coup4 = 1) | !(coup5= 1) | !(coup6 = 1)) {
|
|
draw1 := unif(0,6);
|
|
draw2 := unif(0,6);
|
|
draw3 := unif(0,6);
|
|
cost := ceil(1.02 * cost);
|
|
|
|
if(draw1 = 0 | draw2 = 0 | draw3 = 0) {
|
|
coup0 := 1;
|
|
}
|
|
if(draw1 = 1 | draw2 = 1 | draw3 = 1) {
|
|
coup1 := 1;
|
|
}
|
|
if(draw1 = 2 | draw2 = 2 | draw3 = 2) {
|
|
coup2 := 1;
|
|
}
|
|
if (draw1 = 3 | draw2 = 3 | draw3 = 3) {
|
|
coup3 := 1;
|
|
}
|
|
if (draw1 = 4 | draw2 = 4 | draw3 = 4) {
|
|
coup4 := 1;
|
|
}
|
|
if (draw1 = 5 | draw2 = 5 | draw3 = 5) {
|
|
coup5 := 1;
|
|
}
|
|
if (draw1 = 6 | draw2 = 6 | draw3 = 6) {
|
|
coup6 := 1;
|
|
}
|
|
}
|
|
}
|