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.

32 lines
473 B

  1. function coupon5() {
  2. int coup0 := 0;
  3. int coup1 := 0;
  4. int coup2 := 0;
  5. int coup3 := 0;
  6. int coup4 := 0;
  7. int draw := 0;
  8. int numberDraws := 0;
  9. while (!(coup0 = 1) | !(coup1 = 1) | !(coup2 = 1) | !(coup3 = 1) | !(coup4 = 1)) {
  10. draw := unif(0,4);
  11. numberDraws := numberDraws + 1;
  12. if(draw = 0) {
  13. coup0 := 1;
  14. }
  15. if(draw = 1) {
  16. coup1 := 1;
  17. }
  18. if(draw = 2) {
  19. coup2 := 1;
  20. }
  21. if(draw = 3) {
  22. coup3 := 1;
  23. }
  24. if(draw = 4) {
  25. coup4 := 1;
  26. }
  27. }
  28. }