mardi 10 novembre 2020

D&D Dice simulator

I've come up with a rolling strategy where you roll 4d6 and reroll any duplicates. This results in a number between 10 and 18 this results in 14 being the most common and 10 and 18 the least common. To specify, you leave 1 of the duplicates and reroll the other(s). And I can't find this method on any dice rolling apps/online. I'm trying in PowerShell to run:

$A = Get-Random -Maximum 6 -Minimum 1
$B = Get-Random -Maximum 6 -Minimum 1
$C = Get-Random -Maximum 6 -Minimum 1
$D = Get-Random -Maximum 6 -Minimum 1

While ($A = $B) {
$B = Get-Random -Maximum 6 -Minimum 1
}
... 
...

$Stat = $A+$B+$C+$D

But $A and $B are always the same and $C and $D are always the same. Can anyone explain how Get-Random works and propose a solution for why my loop becomes infinite?




Aucun commentaire:

Enregistrer un commentaire