2d4+10 2(q(+~~rand($')+d)x$`)4+10 2(q(+int(rand($'))+d)x$`)4+10 2(q(+int(rand('4+10'))+d)x2)4+10 2('+int(rand('4+10'))+d'x2)4+10 2('+int(rand('4+10'))+d'.'+int(rand('4+10'))+d')4+10 2+int(rand(4))+d+int(rand(4))+d4+10 # or looking at each term 2 # since rand return 0..N-1 instead on 1..N, we add one for every die +int(rand(4)) # int in 0..3 +d # 0 +int(rand(4)) # int in 0..3 +d4 # also 0, the 'd' are here to help ignore the 4 +10 # desired extra # then eval that :)