- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrisk.php
More file actions
Latest commit
29 lines (22 loc) · 566 Bytes
/
Copy pathrisk.php
File metadata and controls
29 lines (22 loc) · 566 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
$count = 10;
$def_lost = 0;
$att_lost = 0;
for ($i = 0; $i < $count; $i++):
$a = mt_rand(1,6);
$b = mt_rand(1,6);
$c = mt_rand(1,6);
$def_d1 = mt_rand(1,6);
$def_d2 = mt_rand(1,6);
if ($a > $def_d1 || $b > $def_d1 || $c > $def_d1)
$def_lost++;
else
$att_lost++;
if ($a > $def_d2 || $b > $def_d2 || $c > $def_d2)
$def_lost++;
else
$att_lost++;
endfor;
echo"Rundor: ".$count ."\n";
echo"Förluster som försvarare: ".$def_lost ."\n";
echo"Förluster som anfallare: ".$att_lost ."\n";