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.

58 lines
942 B

  1. function coupon10() {
  2. int coup0 := 0;
  3. int coup1 := 0;
  4. int coup2 := 0;
  5. int coup3 := 0;
  6. int coup4 := 0;
  7. int coup5 := 0;
  8. int coup6 := 0;
  9. int coup7 := 0;
  10. int coup8 := 0;
  11. int coup9 := 0;
  12. int coup10 := 0;
  13. int draw := 0;
  14. int numberDraws := 0;
  15. while (!(coup0 = 1) | !(coup1 = 1) | !(coup2 = 1) | !(coup3 = 1) | !(coup4 = 1) | !(coup5= 1) | !(coup6 = 1) | !(coup7 = 1) | !(coup8 = 1) | !(coup9 = 1) | !(coup10 = 1)) {
  16. draw := unif(0,10);
  17. draw2 := unif(0,10);
  18. draw3 := unif(0,10);
  19. numberDraws := numberDraws + 1;
  20. if(draw = 0) {
  21. coup0 := 1;
  22. }
  23. if(draw = 1) {
  24. coup1 := 1;
  25. }
  26. if(draw = 2) {
  27. coup2 := 1;
  28. }
  29. if(draw = 3) {
  30. coup3 := 1;
  31. }
  32. if(draw = 4) {
  33. coup4 := 1;
  34. }
  35. if(draw = 5) {
  36. coup5 := 1;
  37. }
  38. if(draw = 6) {
  39. coup6 := 1;
  40. }
  41. if(draw = 7) {
  42. coup7 := 1;
  43. }
  44. if(draw = 8) {
  45. coup8 := 1;
  46. }
  47. if(draw = 9) {
  48. coup9 := 1;
  49. }
  50. if(draw = 10) {
  51. coup10 := 1;
  52. }
  53. }
  54. }