Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double t3 = 1.0/1296.0;
- double t4 = 4.0/1296.0;
- double t5 = 10.0/1296.0;
- double t6 = 21.0/1296.0;
- double t7 = 38.0/1296.0;
- double t8 = 62.0/1296.0;
- double t9 = 91.0/1296.0;
- double t10 = 122.0/1296.0;
- double t11 = 148.0/1296.0;
- double t12 = 167.0/1296.0;
- double t13 = 172.0/1296.0;
- double t14 = 160.0/1296.0;
- double t15 = 131.0/1296.0;
- double t16 = 94.0/1296.0;
- double t17 = 54.0/1296.0;
- double t18 = 21.0/1296.0;
- double total = 0;
- long[] all = new long[109];
- double[] all2 = new double[109];
- int d1 = 3;
- int d2 = 3;
- int d3 = 3;
- int d4 = 3;
- int d5 = 3;
- int d6 = 3;
- void setup() {
- }
- void draw() {
- println(d1 + ", " + d2 + ", " + d3 + ", " + d4 + ", " + d5 + ", " + d6);
- for (int i = 0; i < 100000; i++) {
- all[d1+d2+d3+d4+d5+d6]++;
- all2[d1+d2+d3+d4+d5+d6]+= tc(d1, d2, d3, d4, d5, d6);
- next(15);
- if (d1 == 18 && d2 == 18 && d3 == 18 && d4 == 18 && d5 == 18 && d6 == 18) {
- all[d1+d2+d3+d4+d5+d6]++;
- all2[d1+d2+d3+d4+d5+d6]+= tc(d1, d2, d3, d4, d5, d6);
- println(all);
- println(all2);
- noLoop();
- break;
- }
- }
- }
- void next(int i) {
- if (d1 == 18) {
- d1 = 3;
- if (d2 == 18) {
- d2 = 3;
- if (d3 == 18) {
- d3 = 3;
- if (d4 == 18) {
- d4 = 3;
- if (d5 == 18) {
- d5 = 3;
- if (d6 == 18) {
- d6 = 3;
- } else {
- d6++;
- }
- } else {
- d5++;
- }
- } else {
- d4++;
- }
- } else {
- d3++;
- }
- } else {
- d2++;
- }
- } else {
- d1++;
- }
- }
- double tc(int r1, int r2, int r3, int r4, int r5, int r6) {
- return c(r1)*c(r2)*c(r3)*c(r4)*c(r5)*c(r6);
- }
- double c(int d) {
- switch(d) {
- case 3:
- return t3;
- case 4:
- return t4;
- case 5:
- return t5;
- case 6:
- return t6;
- case 7:
- return t7;
- case 8:
- return t8;
- case 9:
- return t9;
- case 10:
- return t10;
- case 11:
- return t11;
- case 12:
- return t12;
- case 13:
- return t13;
- case 14:
- return t14;
- case 15:
- return t15;
- case 16:
- return t16;
- case 17:
- return t17;
- case 18:
- return t18;
- default:
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement