-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
1510 lines (1485 loc) · 344 KB
/
test.html
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!-- Script BZo5Rzph2FZIv2B2Br3aQbhuw compiled from /var/www/torbenm/troll.msp on Mon Oct 12 14:06:17 2020 -->
<html>
<head>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<title>Troll dice roller and probability calculator</title>
</head>
<body style="background-color:#F9F5D1";>
<h1>Troll dice roller and probability calculator</h1>
<hr>
<form method=post action=troll.msp>
<a href="forums.msp">News and discussion forum</a>
Last posting: Wed Nov 4 11:04:07 2020.<br/>
<br/>
<!-- Select predefined rolls from list -->
<SELECT NAME="selectExp" onchange="this.form.submit()"><option value="">Select roll from list or type Troll expression below </option><option value="\ d20 attribute sum largest 3 4d6">
d20 attribute
</option>
<option value="\ WoD dice pool with N dice N:=1; \ Change N to alter the number of dice count 7< N#(accumulate x:=d10 while x=10)">
WoD dice pool with N dice
</option>
<option value="\ Median of 3 d20 median 3d20">
Median of 3 d20
</option>
<option value="\ d20 character "Str |>Dex|>Con|>Int|>Wis|>Chr" || 6'sum largest 3 4d6">
d20 character
</option>
<option value="\ Eliminate duplicates from 4d6 and add sum different 4d6">
Eliminate duplicates from 4d6 and add
</option>
<option value="\ Britannia battle simulation \ Simulates battle without retreat \ positive result is number of surviving attackers \ negative result is number of surviving defenders \ does not handle mixed forces A := 4; \ Number of attacking armies B := 3; \ Number of defending armies TA := 5; \ Target number of attacker TB := 5; \ Target number of defender call brit(A,B,TA,TB) function brit(a,b,ta,tb) = if a=0 then -b else if b=0 then a else ah := count ta <= a d6; bh := count tb <= b d6; call brit(max{0,a-bh},max{0,b-ah},ta,tb) ">
Britannia battle simulation
</option>
<option value="\ Dark Coast dice pool T := 4; \ Talent level C := 3; \ Challenge level \ the choices below yield the same results, but calculation is optimised for T<C or T>C, respectively. if T<C then max least (T+1) (T+1+C)d6 else min largest (C+1) (T+1+C) d6">
Dark Coast dice pool
</option>
<option value="\ Britannia battle resolver Terrain := 1; \ 0 for clear, 1 for difficult AttackerElite := 0; \ # of attacker cavalry or Roman armies AttackerArmies := 3; \ # of attacker normal armies AttackerLeader := 0; \ 1 if attacker leader present, 0 if not DefenderElite := 0; \ # of defender cavalry or Roman armies DefenderArmies := 1; \ # of defender normal armies/burhs DefenderLeader := 1; \ 1 if defender leader present, 0 if not DefenderFort := 0; \ 1 if there is a Roman fort, 0 if not Rounds := 2; \ 1: one round, 2: until any loss, 3: until completion \ Do not touch anything below this line ("Battle in " || (if Terrain = 0 then "clear" else "difficult") || " terrain.") |> ((if AttackerElite > 0 then 'AttackerElite || "Roman/cavalry " else "") || (if AttackerElite > 0 & AttackerArmies > 0 then "and " else "") || (if AttackerArmies > 0 then 'AttackerArmies || " armies " else "") || (if AttackerLeader = 1 then "with leader " else "") || "against " || (if DefenderElite > 0 then 'DefenderElite || "Roman/cavalry " else "") || (if DefenderElite > 0 & (DefenderArmies + DefenderFort) > 0 then "and " else "") || (if DefenderFort = 1 then "Roman fort" else if DefenderArmies > 0 then 'DefenderArmies || " armies " else "") || (if DefenderLeader = 1 then "with leader" else "")) |> "---------------" |> call BritanniaBattle(AttackerArmies, AttackerElite, AttackerLeader, if DefenderFort = 1 then 1 else DefenderArmies, DefenderElite, DefenderLeader, DefenderFort, Rounds, Terrain) function BritanniaBattle(AA, AE, AL, DA, DE, DL, DF, R, T) = AAd := AA#(d6 + AL); AEd := AE#(d6 + AL); DAd := DA#(d6 + DL); DEd := DE#(d6 + DL); stringA := "Attacker: " || (if AE>0 then 'AEd || "/ "else "") || 'AAd; stringD := " Defender: " || (if DE>0 then 'DEd || "/ " else "") || 'DAd; AErest := max{0, AE - (count 5 < (DAd U DEd))}; AArest := max{0, AA - (count 4 < DAd) - (count 3 < DEd) + (AE - AErest)}; DErest := max{0, DE - (count 5 < (AAd U AEd))}; DArest := if (DF = 1) & (DErest > 0) then DA else if T = 0 then max{0, DA - (count 4 < AAd) - (count 3 < AEd) + (DE - DErest)} else max{0, DA - (count 5 < (AAd U AEd)) + (DE - DErest)}; stringAR := "Remaining attackers: " || (if AE>0 then 'AErest || "/ " else "") || 'AArest; stringDR := " Remaining defenders: " || (if DE>0 then 'DErest || "/ " else "") || 'DArest; stringAll := (stringA || stringD) |> (stringAR || stringDR); if (R = 1) U (R = 2 & ((AArest < AA) U (AErest < AE) U (DArest < DA) U (DErest < DE))) U ((AArest + AErest) = 0) U ((DArest + DErest) = 0) then stringAll else stringAll |> "---------------" |> call BritanniaBattle(AArest, AErest, AL, DArest, DErest, DL, DF, R, T) ">
Britannia battle resolver
</option>
<option value="\ Maximum and number of different dice in 6d6 x := 6d6; [max x, count different x]">
Maximum and number of different dice in 6d6
</option>
<option value="\ Subset and set equality functions \ Testing if a collection is a (multiset) subset of another or if two collections are the same function msubset(A,B) = if A--B then {} else 1 function msetEqual(A,B) = if (A--B) U (B--A) then {} else 1 \ Examples of use (if call msubset({1,2}, {1,2,2}) then "O.K." else "Error") |> (if call msubset({1,2,2}, {1,2}) then "Error" else "O.K.") |> (if call msetEqual({1,2,2}, {1,2,2}) then "O.K." else "Error") |> (if call msetEqual({1,2,2}, {1,1,2}) then "Error" else "O.K.")">
Subset and set equality functions
</option>
</SELECT>
<!-- Select user-contributed rolls from list -->
<SELECT NAME="userExp" onchange="this.form.submit()"><option value="">Or select user-contributed roll </option><option value="\ L5R roll with best 2 of 3 sum (largest 2 3#(sum accumulate x := d10 while x=10))">
L5R roll with best 2 of 3
</option>
<option value="\ d12+d8 d12+d8">
d12+d8
</option>
<option value="\ max of d8 and d12 max {d8,d12}">
max of d8 and d12
</option>
<option value="\ Savage World (d4) max { sum (accumulate x:=d6 while x=6), sum (accumulate y:=d4 while y=4) }">
Savage World (d4)
</option>
<option value="\ Savage World (d6) max { sum (accumulate x:=d6 while x=6), sum (accumulate y:=d6 while y=6) }">
Savage World (d6)
</option>
<option value="\ Savage World (d8) max { sum (accumulate x:=d6 while x=6), sum (accumulate y:=d8 while y=8) }">
Savage World (d8)
</option>
<option value="\ Savage World (d10) max { sum (accumulate x:=d6 while x=6), sum (accumulate y:=d10 while y=10) }">
Savage World (d10)
</option>
<option value="\ Savage World (d12) max { sum (accumulate x:=d6 while x=6), sum (accumulate y:=d12 while y=12) }">
Savage World (d12)
</option>
<option value="\ Risk roll a:=3d6;b:=2d6; count {(max a)>(max b),(min largest 2 a)>(min b)}">
Risk roll
</option>
<option value="\ min of 2z5 and 3z4 min {sum 2z5, sum 3z4}">
min of 2z5 and 3z4
</option>
<option value="\ Pick two numbers between 1 and 6 {1..6} pick 2">
Pick two numbers between 1 and 6
</option>
<option value="\ Shadowrun Dice Pool D6 N:=1; \ Change N to alter the number of dice count 4< N#(accumulate x:=d6 while x=6)">
Shadowrun Dice Pool D6
</option>
<option value="\ Project Euler problem #205 count (sum 9d4) > (sum 6d6)">
Project Euler problem #205
</option>
<option value="\ Fudge dice (4dF) sum 4d3-8">
Fudge dice (4dF)
</option>
<option value="\ Alternative Fudge dice definition sum 4#choose{-1,0,1}">
Alternative Fudge dice definition
</option>
<option value="\ Sicherman-dice choose {1,2,2,3,3,4} + choose {1,3,4,5,6,8}">
Sicherman-dice
</option>
<option value="\ D&D 4e average weapon damage calculator (v1) \ **** NOTE: This script has many configuration options. \ **** Scroll down to see them all \ Email bugs to: [email protected] (remove the capital letters) \ ******************** \ Weapon configuration \ ******************** \ Number of dice your weapon throws for 1W damage. Usually 1. WeaponDice:=1; \ Die size of your weapon WeaponDie:=6; \ Size of the bonus dice you throw when you crit CritDie:=6; \ Enchantment bonus of your weapon Enchant:=3; \ Set this to the Brutal value of your weapon (if any) Brutal:=0; \ Set to 1 if your weapon has High Crit HighCrit:=0; \ Set to 1 if you're using a Versatile weapon two-handed Versatile:=0; \ Set to 1 if your weapon is a Supremely Vicious weapon SupremelyVicious:=0; \ *********************** \ Character configuration \ *********************** \ Set to your tier: Heroic = 1, Paragon = 2, Epic = 3 Tier:=2; \ The lowest roll you score a crit on. Set to 21 to disable crits. CritRange:=20; \ Set this to your mod with the stat used for damage. StatMod:=4; \ Set this to 1 if you have the Weapon Focus feat for your weapon WeaponFocus:=0; \ Set this to 1 if you have the Devastating Critical feat DevastatingCritical:=0; \ ******************** \ END OF CONFIGURATION \ ******************** W:=WeaponDice d WeaponDie; CW:=WeaponDice * WeaponDie; \ Maximized damage CD:=Enchant d CritDie; BAve:=(WeaponDice * (WeaponDie-Brutal) / 2) + Brutal; \ Brutal average if d20 >= CritRange then 	if SupremelyVicious = 1 	then 		CW+Enchant+StatMod+Versatile 		+sum(foreach x in CD do 			(if x < (CritDie / 2) then d CritDie else x)) 		+sum(foreach w in 1..Tier do 			(foreach y in (sum(repeat x:= WeaponDice d WeaponDie until (min x)>Brutal)) do 				(if y < BAve then 					sum(repeat x:= WeaponDice d WeaponDie until (min x)>Brutal) 				else y) 			))*HighCrit 		\+(x:= 1d10; if x < 5.5 then 1d10 else x)*DevastatingCritical 		+WeaponFocus*Tier 		 	else 		CW+sum(CD)+Enchant+StatMod+Versatile 		+sum(foreach y in 1..Tier do 			repeat x:= WeaponDice d WeaponDie until (min x)>Brutal)*HighCrit 		+1d10*DevastatingCritical 		+WeaponFocus*Tier else 	sum(repeat x:= WeaponDice d WeaponDie until (min x)>Brutal) 	+Enchant+StatMod+Versatile 	+WeaponFocus*Tier ">
D&D 4e average weapon damage calculator (v1)
</option>
<option value="\ WEG D6 with wild die \\\\\\\\\\\\\\\\\\\\\\\ Functions \\\\\\\\\\\\\\\\\\\\\\\ \ Returns final value of a wild die roll. \ The die is rerolled until different of 6. \ Rerolls are added if initial value is 6, substracted if initial value is 1. \ WildDieInit : Initial wild die value function WildDieValue(WildDieInit) = if WildDieInit = 6 then WildDieInit + sum accumulate x:=d6 while x=6 else if WildDieInit = 1 then -(WildDieInit + sum accumulate x:=d6 while x=6) else WildDieInit \ Returns the result of a skill roll. \ Dice : Dice number in skill roll (4d+2 --> 4) \ Pips : Pips number in skill roll (4d+2 --> 2) \ UseWd : Player chooses to use wild die in skill roll? 0 --> false function SkillRoll(Dice, Pips, UseWd) = \ Calc wild die value WD := if Dice <= 0 then 0 \ No die rolled else if UseWd = 0 then 1d6 \ No wild die in roll else call WildDieValue(1d6); \ Uses wild die \ Calc remaining dice sum RD := if Dice > 1 then sum (Dice - 1)d6 \ sum dice except wild die else 0; \ no more die to roll \ Return result WD + RD + Pips \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ Change SkillDice, SkillDice and SkillPips to use \ Ex: 3d+2 --> SkillDice=3, SkillPips=2 UseWildDie := 1; \ Player chooses to use wild die in skill roll? 0 --> false SkillDice := 3; \ Dice number in skill roll (4d+2 --> 4) SkillPips := 0; \ Pips number in skill roll (4d+2 --> 2) call SkillRoll(SkillDice, SkillPips, UseWildDie) ">
WEG D6 with wild die
</option>
<option value="\ Sum of floating reroll on d6 N:=3; \ Change N to alter the number of dice sum N#(accumulate x:=d6 while x=6)">
Sum of floating reroll on d6
</option>
<option value="\ Shadowrun 4E Dice Pool D6, No Edge N:=12; \ Change N to alter the number of dice count 4< N#(d6)">
Shadowrun 4E Dice Pool D6, No Edge
</option>
<option value="\ Exploding D6 sum (accumulate y:=d6 while y=6)">
Exploding D6
</option>
<option value="\ Exploding D4 sum (accumulate y:=d4 while y=4)">
Exploding D4
</option>
<option value="\ Exploding 2D6 sum 2#(accumulate x:=d6 while x=6)">
Exploding 2D6
</option>
<option value="\ Exploding 2D4 sum 2#(accumulate x:=d4 while x=4)">
Exploding 2D4
</option>
<option value="\ Fudge Adventure Story Telling dice \ Fudge Adventure Story Telling dice a:=3#choose{-1,0,1};b:=3#choose{-1,0,1}; count {(min a)>=(min b),(min largest 2 a)>=(min b)} ">
Fudge Adventure Story Telling dice
</option>
<option value="\ Exalted damage dice \Target number is 7, 10s aren't doubled N:=1; \ Change N to alter the number of dice count 6< N#d10">
Exalted damage dice
</option>
<option value="\ (2d2)d6 sum (sum 2d2)d6">
(2d2)d6
</option>
<option value="\ Roll from the Swedish game Eon N:=1; \ Change N to alter the number of dice sum N#call explode(d6) function explode(x) = if x=6 then sum 2 # call explode(d6) else x">
Roll from the Swedish game Eon
</option>
<option value="\ 2d6, funky doubles. \ Space Infantry dice variant. Roll two dice, red and black: Ignore the black unless it makes a pair with the red (Two 1s, Two 2s, etc). 2x1: 0. 2x2: 0. 2x3: 4. 2x4: 5. 2x5: reroll 2d6, floor 5. 2x6: reroll 2d6, floor 6. if d6=1 then choose {0,0,3,4,max {5,sum 2d6}, max {6,sum 2d6}} else d6">
2d6, funky doubles.
</option>
<option value="\ Exploding 2D8 sum 2#(accumulate x:=d8 while x=8)">
Exploding 2D8
</option>
<option value="\ Max of 2d20 max 2d20">
Max of 2d20
</option>
<option value="\ Fudge dice alt (starblazer adventures) \ Alternative Fudge dice definition 1d6-1d6">
Fudge dice alt (starblazer adventures)
</option>
<option value="\ WoD with N dice and botches \ WoD dice pool with N dice; counting botches \ Botches are rolls of one or more 1s when there are NO 8/9/0's. N:=4; \ Change N to alter the number of dice POOL:=N#(accumulate x:=d10 while x=10); if (7< POOL) then (count 7< POOL) else (-count 1= POOL)">
WoD with N dice and botches
</option>
<option value="\ CrovaX \ Shadowrun 4E Dice Pool D6, No Edge N:=12; \ Change N to alter the number of dice count 4< N#(d6)">
CrovaX
</option>
<option value="\ WoD w/Fudge Dice \ WoD dice pool with N dice N:=3; \ Change N to alter the number of dice count 2< N#(accumulate x:=d3 while x=3)">
WoD w/Fudge Dice
</option>
<option value="\ Exalted dice pool \ wyrdR 14.10.10 \ Reduced memory usage and response time \Target number is 7, 10s are doubled N:=9; \ Change N to alter the number of dice x:= N d10 drop {1..6}; \ Modified to make s and c count from the same dice s:=count x; c:=count (x keep 10); \ doubles tens s+c">
Exalted dice pool
</option>
<option value="\ Singularity Dice \\ Singluarity Dice \\ Roll 2d10, one is positive, the other negative. \\ Take the result of the die with lowest value. \\ On doubles, explode from -10/10 or fold. function BladeRoll(Level, Iteration) = Positive:= d10; Negative:= d10; if Positive = Negative then if Iteration > 3 then Level \\ Fold else call BladeRoll(Level+10, Iteration+1) else if Positive < Negative then Level + Positive else \\ Negative < Positive -(Level + Negative) call BladeRoll(0,0)">
Singularity Dice
</option>
<option value="\ lizardmen leadership sum least 2 3d6">
lizardmen leadership
</option>
<option value="\ Shadowrun 4E Dicepool d6, with Edge N:=10; \ Change N to alter the number of dice count 4< N#(accumulate x:=d6 while x=6)">
Shadowrun 4E Dicepool d6, with Edge
</option>
<option value="\ WHFB 8th Cavalry Charge \Warhammer 8th Cavalry Charge sum largest 2 3d6 ">
WHFB 8th Cavalry Charge
</option>
<option value="\ Soft Horizon A:=2d6; max A - min A">
Soft Horizon
</option>
<option value="\ JAGS sum 4#choose{0..5}">
JAGS
</option>
<option value="\ JTest \ d20 attribute sum largest 3 5d6">
JTest
</option>
<option value="\ 3d6 12 times sum (largest 6 12#(sum 3d6))">
3d6 12 times
</option>
<option value="\ Fudgish simulator using 4d6 min 2d6 - min 2d6">
Fudgish simulator using 4d6
</option>
<option value="\ Indie RTS Game Unit Accuracy Check sum 3d33">
Indie RTS Game Unit Accuracy Check
</option>
<option value="\ Dragon Age x := 2d6; y := d6; sum (x U y) U if (count different (x U y)) < 3 then 1000+y else 1000">
Dragon Age
</option>
<option value="\ Roller for Impetus \ Impetus Dice Pool \ By John Acar \ Version 1 10/12/2010 \ Modified from Exalted Roller N:=6; \ Change N to alter the number of dice (ie Strength) x:= N d6; \ Modified to make s and c count from the same dice s:=count 6= x; \ count 6 c:=count 5= x; \ count 5 s+c/2">
Roller for Impetus
</option>
<option value="\ DSA - Das Schwarze Auge (The Dark Eye) \ Interpretation of result: \ "Value" is the amount of remaining skill points, known as TaP* in the german version. (If theres an expression for it in the english translation I don't know it, sorry) skill := 10; \ Your skill attributeA := 10 - d20 ; \ First attribute relevant to roll attributeB := 10 - d20 ; \ Second attribute relevant to roll attributeC := 10 - d20 ; \ Third attribute relevant to roll skill + min{attributeA,0} + min{attributeB,0} + min{attributeC,0}">
DSA - Das Schwarze Auge (The Dark Eye)
</option>
<option value="\ Alternate FUDGE/FATE with 4d6 \For humans, use two pairs of differently-coloured d6. Pick one colour to be the \"high" pair and the other the "low." Roll all together, and count the difference \in each pair (higher minus lower). Then subtract the high pair difference from \the low pair difference. One fast sort (the two colours) and two difference \computations seems to be actually faster than 4dF in practice. A := 2d6; B := 2d6; C := max A - min A; E := max B - min B; C - E">
Alternate FUDGE/FATE with 4d6
</option>
<option value="\ One Roll Engine \ Sets displayed as (width * 100) + height \ Displays loose dice as value \ Probably not suitable for calculating probabilities! roll := 4d10; vals := different roll; foreach x in vals do if (count x= roll) >= 2 then (100 * (count x= roll)) + x else x">
One Roll Engine
</option>
<option value="\ ORE Probabilities \ One Roll Engine \ For calculating probabilities \ Shows width of sets (equal chance of each height) roll := 5d10; vals := different roll; foreach x in vals do if (count x= roll) >= 2 then (count x= roll) else {}">
ORE Probabilities
</option>
<option value="\ Rolemaster double open-ended d% y:=d100; y+( if y <= 5 then - sum (accumulate x:=d100 while x>=96) else ( if y >= 96 then sum (accumulate x:=d100 while x>=96) else 0 ) ) ">
Rolemaster double open-ended d%
</option>
<option value="\ Rally Round the King Roller \ Rally Round the King Shooting \ By John Acar \ Version 1 11/30/2010 A:=4; \ Change A to armor value F:=2; \ Change F to the bonus based on figures per stand N:=2; \ Number of units firing x:= sum (N#(d6+d6+F)); \ Count up hits. c:= x / (A+1); c">
Rally Round the King Roller
</option>
<option value="\ Rally Round the King Roller Alternate \ Rally Round the King Shooting (Alternate) \ By John Acar \ Version 1 11/30/2010 A:=4; \ Change A to armor value F:=2; \ Change F to the bonus based on figures per stand N:=3; \ Number of units firing x:= sum (N#(d6+F)); \ Count up hits. c:= x / (A+1); c">
Rally Round the King Roller Alternate
</option>
<option value="\ Dystopian Wars n:= 1; \number of dice, result is number of "hits". sum n# x := (accumulate y:=d6 while y=6); ra := count 6 = x; rb := count (3< x); rc := 2*ra+rb-ra; rc">
Dystopian Wars
</option>
<option value="\ Earthdawn step 14 with T'Skrang karma sum { sum (accumulate x:=d20 while x=20), sum (accumulate y:=d4 while y=4), sum (accumulate w:=d6 while w=6)}">
Earthdawn step 14 with T'Skrang karma
</option>
<option value="\ random one-dimensional walk - number of steps function walk(s,t) = s := s + choose{-1,1} + choose{-1,1}; if s=0 then t+1 else call walk(s,t+1) call walk(0,0)">
random one-dimensional walk - number of steps
</option>
<option value="\ Toss 12 coins sum 12#choose{-1,1} ">
Toss 12 coins
</option>
<option value="\ SIP Shooting \ Simplicity in Practice Shooting \ By John Acar 12/23/2010 \ Version 1 x:= 4 d6; \Always roll 4 dice y:=d6; a:= count 3<=x; \Change digit to "hit" number b:=6-a; c:= count b<=y; if a=0 then 0 else c ">
SIP Shooting
</option>
<option value="\ SIP Melee \ Simplicity in Practice Melee \ By John Acar 12/23/2010 \ Version 1 x:= sum 4d6; \Change this to increase melee power for attacker. y:= sum 4d6; \Change this to increase melee power for defender c:=count y>x; c">
SIP Melee
</option>
<option value="\ wod with d6 (alternative) \ WoD dice pool with N dice N:=1; \ Change N to alter the number of dice count 4< N#(accumulate x:=d6 while x=6)">
wod with d6 (alternative)
</option>
<option value="\ 12 6 theme count 2<D6 + count 2<D6 + count 2<d8 + count 2<D10 +count 2<d12">
12 6 theme
</option>
<option value="\ 4df FUDGE DICE sum 4d3-8">
4df FUDGE DICE
</option>
<option value="\ TSOY/Solar System bonus dice \TSOY bonus dice (4dF, keep 3 best) sum largest 3 (4 #choose{-1,0,1})">
TSOY/Solar System bonus dice
</option>
<option value="\ TSOY/Solar System penalty dice \TSOY penalty dice (4dF, keep 3 worst) sum least 3 (4 #choose{-1,0,1})">
TSOY/Solar System penalty dice
</option>
<option value="\ Savage Worlds trait := 6 ; mod := 0 ; max { sum (accumulate x:=d6 while x=6), sum (accumulate y:=d(trait) while y=trait) } - mod">
Savage Worlds
</option>
<option value="\ Dragon Age x := 2d6; y := d6; sum (x U y) U if (count different (x U y)) < 3 then 1000+y else 1000 ">
Dragon Age
</option>
<option value="\ Tunnels and Trolls (triples add and roll over sum{accumulate x:=3d6 while (min x) = (max x)}">
Tunnels and Trolls (triples add and roll over
</option>
<option value="\ 4d6, drop lowest unless 4 of a kind x:=4d6;if (min x) = max(x) then sum(x) else sum(largest 3 x)">
4d6, drop lowest unless 4 of a kind
</option>
<option value="\ Highest of open polyhedrals max { sum (accumulate a:=d4 while a=4), sum (accumulate b:=d6 while b=6), sum (accumulate c:=d8 while c=8), sum (accumulate e:=d10 while e=10), sum (accumulate f:=d12 while f=12) }">
Highest of open polyhedrals
</option>
<option value="\ Generic pool of mixed dice with bonus/penalty \\ Generic dice pool of mixed dice; eg d12+d10 dicepool := {12,10}; \\ a bonus applied to the whole roll. \\ Use negatives for penalties bonus := 0; \\ rolls each die separately and sums them sum (foreach die in dicepool do d die) + bonus ">
Generic pool of mixed dice with bonus/penalty
</option>
<option value="\ Highest unique value in 6d6 x := 6d6; max (foreach i in 1..6 do if (count i=x)=1 then i else 0)">
Highest unique value in 6d6
</option>
<option value="\ d6-d6, without math \ roll d6 (negative) and d6 (positive), \ but don't subtract or add. Instead \ select the least of the two (absolute value) \ if doubles, then zero x:=d6; y:=d6; if (x=y) then 0 else if (x < y) then 0-x else y ">
d6-d6, without math
</option>
<option value="\ Sorcerer-style opposed rolls \ Too slow for large dice pools; try with d6 or smaller \ If all paired dice tie, opponent with dice remaining gets 1 victory a:= 3d10; b:= 2d10; c:= min (foreach x in (1..(min {(count a), (count b)})) do (if (min (largest x a))=(min (largest x b)) then 20 else x)); if c=20 then (if (count a)>(count b) then 1 else if (count b)>(count a) then -1 else 0) else (count (min (largest c b)) < least ((count a)-c+1) a)-(count (min (largest c a)) < least ((count b)-c+1) b)">
Sorcerer-style opposed rolls
</option>
<option value="\ Old Style WoD with catastrophic failures \ Old Style WoD dice pool. \ Straight 1's reduce number of successes. \ Roll equal to difficulty wins \ Doesn't accumulate 10's \ (Corrected by TM) N:=1; \ Change N to alter the number of dice x := N#d10; count 7<=x - count 1=x">
Old Style WoD with catastrophic failures
</option>
<option value="\ Italia battle simulation A := 6; \ Number of attacking armies B := 4; \ Number of defending armies TA := 7; \ Target number for attacker TB := 5; \ Target number for defender call brit(A,B,TA,TB) \ battle is fought to completion \ positive result is number of surviving attackers \ negative result is number of surviving defenders function brit(a,b,ta,tb) = if a=0 then -b else if b=0 then a else ah := count ta <= a d10; bh := count tb <= b d10; call brit(max{0,a-bh},max{0,b-ah},ta,tb) ">
Italia battle simulation
</option>
<option value="\ Focus d10 pool Numberdice := 1; Target := 6; die := {1,(Target-2)#2,(10-Target)#Target,10}; pool := Numberdice#(accumulate x:=choose die while x=10); successes := count Target<=pool; successes">
Focus d10 pool
</option>
<option value="\ ±d10 with Exploding Fluke and Botch rolls \ Roll 2d10 (different colors) \ One die is predetermined positive and one negative \ An exclusive roll of 10 on + die gives a Fluke exploding result \ An exclusive roll of -10 on - die gives a Botch exploding result pos:=d10; neg:=d10; fluke:=sum(accumulate x:=d10 while x=10); botch:=sum(accumulate y:=d10 while y=10); if pos=10 & pos>neg then sum((pos+fluke)-neg) else if neg=10 & neg>pos then sum(pos-(neg+botch)) else sum(pos-neg)">
±d10 with Exploding Fluke and Botch rolls
</option>
<option value="\ ±10(4d6) with Exploding Fluke and Botch rolls \ Roll 4d6 (2 color sets of 2 dice) \ One die is predetermined positive and one negative \ An exclusive roll of 12 on + die gives a Fluke exploding result \ An exclusive roll of -12 on - die gives a Botch exploding result pos:=sum(2d6); neg:=sum(2d6); fluke:=sum(accumulate x:=sum(2d6) while x=12); botch:=sum(accumulate y:=sum(2d6) while y=12); if pos=12 & pos>neg then sum((pos+fluke)-neg) else if neg=12 & neg>pos then sum(pos-(neg+botch)) else sum(pos-neg)">
±10(4d6) with Exploding Fluke and Botch rolls
</option>
<option value="\ ±d10 with Exploding Fluke and Botch rolls \ Roll 2d10 (different colors) \ One die is predetermined positive and one negative \ A composite roll of +d10=10 & -d10=1 gives a Fluke exploding result \ An exclusive roll of -d10=-10 & d10=1 gives a Botch exploding result pos:=d10; neg:=d10; exp:=sum(accumulate x:=d10 while x=10); if pos=10 & neg=1 then sum((pos+exp)-neg) else if neg=10 & pos=1 then sum(pos-(neg+exp)) else sum(pos-neg)">
±d10 with Exploding Fluke and Botch rolls
</option>
<option value="\ Lucid Gaming System Attack Roll call LGSattack( 12, \Total Attack Bonus of attacker 16, \Total Defense Bonus of defender 4, \Total Damage Reduction of defender 2, \Total Toughness of defender 7, \The Critical Score of the attacker (sum 2d6 + 10), \Physical Damage 1d6, \Elemental Damage 0 \Superior Damage ) function LGSattack(atk,def,DR,TR,crit,Physical,Elemental,Superior) = (x:=(1d10+atk-def);if x>0 then (1+x/crit) else 0)* (max{(max {(Physical - DR), 0} + Elemental - TR), 0} + Superior)">
Lucid Gaming System Attack Roll
</option>
<option value="\ DARO & 6's. sum accumulate x:=2d6 while (max x) = {6, min x}">
DARO & 6's.
</option>
<option value="\ Tunnels and Trolls solution to combat \Tunells and Trolls solution to combat. +/- 3 adds per point of weapon dice over/under 3. Result is damage. Yields much more satisfying game play. (((d6) * 6 ) + d6) - (((d6) * 6 ) + d6) ">
Tunnels and Trolls solution to combat
</option>
<option value="\ Blue Planet (Synergy system) normal aptitude TN 5 N:=1; \ Change N to alter the number of dice count 5>= N#(d10) \ Change count to alter Target Number">
Blue Planet (Synergy system) normal aptitude TN 5
</option>
<option value="\ Blue Planet (Synergy system) strong aptitude TN 5 N:=2; \ Change N to alter the number of dice count 5>= N#(d10) \ Change count to alter Target Number">
Blue Planet (Synergy system) strong aptitude TN 5
</option>
<option value="\ Blue Planet (Synergy system) superior aptitude TN 5 N:=3; \ Change N to alter the number of dice count 5>= N#(d10) \ Change count to alter Target Number">
Blue Planet (Synergy system) superior aptitude TN 5
</option>
<option value="\ Reroll Duplicates. function rerollduplicates(n) = x := n d6; c := count different x; if c=3 then sum x else if n=3 & c=1 then (sum x) + call rerollduplicates(3) else if n=3 & c=2 then (sum x) + call rerollduplicates(2) else if n=2 & c=1 then (sum x) + call rerollduplicates(2) else (sum x) call rerollduplicates(3)">
Reroll Duplicates.
</option>
<option value="\ T&T idea for 3d Saving Rolls & Saving Roll Combat. (d6*d6+d6) - (d6*d6+d6)">
T&T idea for 3d Saving Rolls & Saving Roll Combat.
</option>
<option value="\ Crap with 2 loaded dice function throw(m) = choose {1,2,4} + choose {2,4,6} n := call throw(1); if n = {7,11} then 1 else if n = {2,3,12} then 0 else count n = (repeat p := call throw(1) until p={7,n}) ">
Crap with 2 loaded dice
</option>
<option value="\ Crap with 2 fair dice function throw(m) = d6 + d6 n := call throw(1); if n = {7,11} then 1 else if n = {2,3,12} then 0 else count n = (repeat p := call throw(1) until p={7,n}) ">
Crap with 2 fair dice
</option>
<option value="\ Exploding 4z9 with 2 positive and 2 negative dice \ Roll 4d10 where 2 dice are positive and two are negative. \ The face values, however, are 0-9 rather than 1-10, i.e., \ the dice are z9. 9s on any dice explode. The positive dice \ become more positive, and the negative more negative. \ This produces a beautiful bell curve centered on zero. (sum 2#(accumulate x:=z9 while x=9)) - (sum 2#(accumulate y:=z9 while y=9))">
Exploding 4z9 with 2 positive and 2 negative dice
</option>
<option value="\ Torg \ Roll a d20 and reroll on 10s and 20s. sum (accumulate x:=d20 while (x=10 U x=20))">
Torg
</option>
<option value="\ MasterBook \ Roll 2d10 and reroll on 10s. sum 2#(accumulate x:=d10 while x=10)">
MasterBook
</option>
<option value="\ MasterBook variant \ My variation on the MasterBook method. Roll 2d10 as usual, \ but consider the values being 0 to 9 rather than 1 to 10. \ That is, utilize the dice as z9s rather than d10s. \ Reroll on 9s. This smooths out the irregularities in the \ original MasterBook curve, and produces a more desirable \ distribution. However, the Bonus Chart needs slight \ adjusting (which is a simple task). sum 2#(accumulate x:=z9 while x=9)">
MasterBook variant
</option>
<option value="\ Trollhammer \ pool of d10s, spend zeroes N:=4; \ Change N to alter the number of dice count 9< N#(d10)">
Trollhammer
</option>
<option value="\ Roll less than the number of sixes on nD6 to score a Kill \ 1 = Kill, 0 = Miss X := 6; \ Number of Dice call kill (X) function kill (x) = a:=count 6 <= x d6; if 1d6 <= a then 1 else 0">
Roll less than the number of sixes on nD6 to score a Kill
</option>
<option value="\ D&D - More Average NPCs sum largest 3 least 4 5d6">
D&D - More Average NPCs
</option>
<option value="\ nWoD with 10/9/8 again rule and optional contestet action A:=1; \ Number of dice in your pool rA:=10; \ Set to 10/9/8 to use 10/9/8 again for your roll \ For a contestet action set the following two variables. \ A negative result means your opponent rolled more successes. B:=0; \ Number of dice in your opponent's pool rB:=10; \ Set to 10/9/8 to use 10/9/8 again for your opponent's roll sA:=count 7< A#(accumulate x:=d10 while x>=rA) ; sB:=count 7< B#(accumulate x:=d10 while x>=rB) ; sA - sB">
nWoD with 10/9/8 again rule and optional contestet action
</option>
<option value="\ Savage World \ Roll with extras' additional d6 trait := 6 ; \ value of your trait modif := 0 ; \ modifier to roll max { sum (accumulate x:=d6 while x=6), sum (accumulate y:=d(trait) while y=trait) } - modif">
Savage World
</option>
<option value="\ Horizons dice pool a := 4; \ change 4 to attacker's dice pool size aRF := 1; \change 1 to attackers number for RF aST := 1; \change 1 to attackers number for ST f := 4; \ change 4 to defender's dice pool size fDg := 1; \change 1 to defender's number for Dodge fAv := 1; \change 1 to defender's number for Av \ count natural successes, 6s counted twice aNS := (aa := a d6; (count 4<=aa) + (count 6=aa)); fNS := (ff := f d6; (count 5<=ff) + (count 6=ff)); \ count skill successes aRFs := (count 4<= aRF d6); \ change 4 to degree of skill aSTs := (count 5<= aST d6); \ change 5 to degree of skill fDgs := (count 4<= fDg d6); \ change 4 to degree of skill fAvs := (count 5<= fAv d6); \ change 5 to degree of skill \ If aRFs equals 1 or more then do not add fDgs to successes fDgr := if 0<aRFs then 0 else fDgs; \ If aSTs equals 1 or more then do not add fAvs to successes fAvr := if 0<aSTs then 0 else fAvs; \ If fDgs equals 1 or more then do not add aSTs to successes aSTr := if 0<fDgs then 0 else aSTs; \ If fAvs equals 1 or more then do not add aRFs to successes aRFr := if 0<fAvs then 0 else aRFs; aTotal := aNS + aSTr + aRFr; fTotal := fNS + fDgr + fAvr; aTotal - fTotal">
Horizons dice pool
</option>
<option value="\ DnD4 Damage per Round defenseA :=25; \target's defense toHitA :=19; \bonus to attack roll damageA :=d8+12; \damage on hit damageMissA :=0; \damage on miss damageCritA :=8+12+sum(3d6); \total damage on crit damagePassiveA:=0; \damage the attack always deals whether it hits or misses (e.g. an aura or zone) critRangeA :=20; \lowest number on d20 that crits attackRollA :=d20; \what you roll to attack \ assign one of the following values to secondAttack: saNever := 0; \do not make a second attack saHit := 1; \attack again if first attack hit saMiss := 2; \attack again if first attack missed saAlways := 3; \always attack a second time secondAttack:= 0; \determines if/when you do a second attack defenseB :=25; toHitB :=16; damageB :=d12+5; damageMissB :=0; damageCritB :=17; damagePassiveB :=0; critRangeB :=20; attackRollB :=d20; \ damage depending on how often you hit damageExtraBAH := 0; \damage if Both Attacks Hit damageExtraLOAH:= 0; \damage if at Least One Attack Hits damageExtraNAH := 0; \damage If Neither Attack Hits \----------------------------------------------------- \ --- no further user input needed below this line --- \----------------------------------------------------- hitMiss := 0; \assigned to hitA/B if attack missed hitNormal := 1; \assigned to hitA/B if attack hit hitCrit := 2; \assigned to hitA/B if attack hit critical hitNA :=-1; \assigned to hitB if attack didn't occure \ determine if first attack hits hitA:= (if (attackRollA+toHitA) >= defenseA then (if attackRollA >= critRangeA then hitCrit else hitNormal) else hitMiss); hitA:=(if attackRollA = 1 then hitMiss else hitA); \ determine damage from first attack hitDamageA:= (if hitA >= hitNormal then (if hitA = hitCrit then damageCritA else damageA) else damageMissA) + damagePassiveA; \ determine if second attack should be done saYes :=1; \added to saDo to enable second attack saNoChange:=0; \added to saDo to change nothing saDo := \if >= saYes do the second attack (if secondAttack = saAlways then saYes else saNoChange) + (if secondAttack = saHit then (if hitA >= hitNormal then saYes else saNoChange) else saNoChange) + (if secondAttack = saMiss then (if hitA = hitMiss then saYes else saNoChange) else saNoChange); \ determine if second attack hits hitB:= (if saDo >= saYes then (if (attackRollB+toHitB) >= defenseB then (if attackRollB >= critRangeB then hitCrit else hitNormal) else hitMiss) else hitNA); hitB:= (if saDo >= saYes then (if attackRollB = 1 then hitMiss else hitB) else hitNA); \ determine damage from second attack hitDamageB:= (if hitB =/= hitNA then (if hitB >= hitNormal then (if hitB = hitCrit then damageCritB else damageB) else damageMissB) + damagePassiveB else 0); damageExtra:= (if saDo >= saYes then (if (hitA >= hitNormal) & (hitB >= hitNormal) then damageExtraBAH else 0) else 0) + (if saDo >= saYes then (if (hitA >= hitNormal) U (hitB >= hitNormal) then damageExtraLOAH else 0) else 0) + (if saDo >= saYes then (if (hitA = hitMiss) & (hitB = hitMiss) then damageExtraNAH else 0) else 0) ; hitDamageA + hitDamageB + damageExtra">
DnD4 Damage per Round
</option>
<option value="\ Number of same-suit cards in a hand of 5 hand := (13#{1..4}) pick 5; max foreach i in 1..4 do count i=hand">
Number of same-suit cards in a hand of 5
</option>
<option value="\ Horizons dice pool Edit \ Horizons dice pool a := 4; \ change 4 to attacker's dice pool size aRF := 1; \change 1 to attackers number for RF aST := 1; \change 1 to attackers number for ST f := 4; \ change 4 to defender's dice pool size fDg := 1; \change 1 to defender's number for Dodge fAv := 1; \change 1 to defender's number for Av \ count natural successes, 6s counted twice aNS := (aa := a d6; (count 4<=aa) + (count 6=aa)); fNS := (ff := f d6; (count 5<=ff) + (count 6=ff)); \ count skill successes aRFs := (count 4<= aRF d6); \ change 4 to degree of skill aSTs := (count 5<= aST d6); \ change 5 to degree of skill fDgs := (count 4<= fDg d6); \ change 4 to degree of skill fAvs := (count 5<= fAv d6); \ change 5 to degree of skill \ Each skill success cancels one opposing skill success and adds to total aRFr := aRFs - fAvs; aSTr := aSTs - fDgs; fDgr := fDgs - aRFs; fAvr := fAvs - aSTs; aTotal := aNS + aSTr + aRFr; fTotal := fNS + fDgr + fAvr; \ if aTotal>fTotal then "attacker wins" else "defender wins" aTotal - fTotal">
Horizons dice pool Edit
</option>
<option value="\ GURPS4 Attack \calculates the remaining hp of target \config attacker attack :=12; \effective skill of attacker damageD :=2; \damage dice (e.g. 2 in case of 2d6+3) damageO :=3; \damage offset (e.g. 3 in case of 2d6+3) shots :=2; \shots you actually fire (not maximum rof) recoil :=2; \recoil of weapon armordiv:=1; \armor divisor (e.g. 2 in case of 3d(2)) armormul:=1; \armor divisor for armordiv < 1 \config target defense :=10; \effective skill of defender hp :=12; \hit points of target dr :=6; \target's damage reduction outputMinimum:=-hp; \don't show results below this number to shorten the result table \----------------------------------------------------- \ --- no further user input needed below this line --- \----------------------------------------------------- failure:=-1; \assign to xxxDegree if roll failed \determine hits depending on attacker attackDegree:=max{attack-sum(3d6),failure}; hits:= (if attackDegree > failure then (min{shots,(1 + (attackDegree/recoil))}) else 0); \determine hits depending on defender defenseDegree:=max{defense-sum(3d6),failure}; hits:= (if defenseDegree > failure then (hits-(defenseDegree+1)) else hits); hits:=(if hits < 0 then 0 else hits); \calculate effective dr with armor divisor dr:= (if armormul > 1 then dr*armormul else dr ); dr:= (if armordiv > 1 then (if dr = 0 then (1 / armordiv) else (dr / armordiv)) else dr ); \calculate damage as sum of each hit damageTotal:=sum(hits#max{(sum(damageD)d6+damageO-dr),0}); max{(hp-damageTotal),outputMinimum}">
GURPS4 Attack
</option>
<option value="\ The One Ring TN Calculator \Beating a TN Calculator for The One Ring, from Cubicle 7 \****TN probability***** \Change TN below to the desired Target Number \Change S below to be the skill level in d6's TN := 14; S :=3d6; count TN <= sum ((choose {0,1,2,3,4,5,6,7,8,9,10,500}) U S) ">
The One Ring TN Calculator
</option>
<option value="\ Fudge sum 4d3-8">
Fudge
</option>
<option value="\ Hit/Save Roller \ Hit/Save \ By John Acar \ Version 1 12/23/2011 N:=3; \ Change N to alter the number of dice (ie Strength) P:=5; \ The protection. A save on a d6. M:=4; \ Chance to hit x:= N d6; s:=count M<= x; \ count Count hits O:=s d6; t:=count P>O; \Count missed saves t \Number of hits scored">
Hit/Save Roller
</option>
<option value="\ Sample Songs of Fire and Ice - Ability of 4, 2 bonus dice sum ( largest 4 (6d6))">
Sample Songs of Fire and Ice - Ability of 4, 2 bonus dice
</option>
<option value="\ Tunnels and Trolls 2D6 DARO (Doubles Add and Roll Over) sum{accumulate x:=2d6 while (min x) = (max x)}">
Tunnels and Trolls 2D6 DARO (Doubles Add and Roll Over)
</option>
<option value="\ Crow of Sturmholdt A:=3; \ Change A to alter the number of d10 dice - abilities S:=4; \ Change S to alter the number of d6 dice - skills T:=4; \ Modifies the "to hit" number sum ((count T< A#(d10)) U (count T< S#(d6))) ">
Crow of Sturmholdt
</option>
<option value="\ Risk Legacy Fortification Attack a:=3d6;b:=2d6; count {(max a)>((max b) + 1),(min largest 2 a)>((min b) + 1)}">
Risk Legacy Fortification Attack
</option>
<option value="\ After Sundown Dice Pool d6 \ After Sundown Dice Pool D6, No Edge N:=12; \ Change N to alter the number of dice count 4< N#(d6)">
After Sundown Dice Pool d6
</option>
<option value="\ Deadlands Classic N:=4; \ Number of dice S:=8; \ Sides MOD:=0; \ Optional mod sum {max N#(sum (accumulate x:=d(S) while x=S)),MOD}">
Deadlands Classic
</option>
<option value="\ Marvel Heroic Roleplaying Result with Burst and Plot-Point A:=0; \ Change to # of d4s in roll B:=0; \ Change to # of d6s in roll C:=1; \ Change to # of d8s in roll E:=0; \ Change to # of d10s in roll F:=0; \ Change to # of d12s in roll Burst:=0; \ Change to 1 if using the Burst SFX (however named on datafile) PPforResult:=0; \ Number of extra dice added to your result calculation because you spent Plot Points sum largest (2+Burst+PPforResult) least (A+B+C+E+F-Burst) {A d4,B d6,C d8,E d10,F d12} - count(1 = largest (2+Burst+PPforResult) least (A+B+C+E+F-Burst) {A d4,B d6,C d8,E d10,F d12})">
Marvel Heroic Roleplaying Result with Burst and Plot-Point
</option>
<option value="\ Marvel Heroic RP Opportunities A:=1; \ Change to # of d4s in roll B:=1; \ Change to # of d6s in roll C:=1; \ Change to # of d8s in roll E:=1; \ Change to # of d10s in roll F:=1; \ Change to # of d12s in roll count(1 = {A d4,B d6,C d8,E d10,F d12})">
Marvel Heroic RP Opportunities
</option>
<option value="\ Kerberos Club (FATE) probability calculator \Change F to be the number of fudge dice, and S to be the number of normal six-sided dice \Calculates the curve compared to a normal 4dF roll, slide this curve up and down based on the difference in actual value between the higher power tier skill and the lower. F := 3; S := 1; sum ({F#(choose {-1,0,1}), S d6}) - sum 4#(choose {-1,0,1}) ">
Kerberos Club (FATE) probability calculator
</option>
<option value="\ Ars Magica Quality Die function qd(x) = if x=1 then 2 * call qd(d10) else x call qd(d10) ">
Ars Magica Quality Die
</option>
<option value="\ Feng Shui Open-ended Roll (simplified) \ Roll 2d6 (different colors) \ One die is predetermined positive and one negative \ A result of 6 is open-ended and rerolls. \ A roll of 6 & 6 is actually discarded, but for simplicity we'll call it zero. \ Because of the 6 & 6 rule, you can only explode either positive or negative. pos:=d6; neg:=d6; exp:=sum(accumulate x:=d6 while x=6); if pos=6 & neg=6 then sum(0) else if pos=6 then sum((pos+exp)-neg) else if neg=6 then sum(pos-(neg+exp)) else sum(pos-neg)">
Feng Shui Open-ended Roll (simplified)
</option>
<option value="\ 4d6, drop lowest x:=4d6;sum(largest 3 x)">
4d6, drop lowest
</option>
<option value="\ 3d6k2H sum largest 2 {2d6, 1d6}">
3d6k2H
</option>
<option value="\ 3d6k2L sum least 2 {2d6, 1d6}">
3d6k2L
</option>
<option value="\ HackMaster Exploding Die n:=6; \Set n to the type of die to be rolled x:=d n; x+( if x<n then 0 else sum (accumulate y:=z(n-1) while y=(n-1)) )">
HackMaster Exploding Die
</option>
<option value="\ Phoenix xd10 exploding A:=4; \ number of dice rolled B:=10; \ smallest exploding number sum(largest 2 A#(sum accumulate x:=d10 while x>=B))">
Phoenix xd10 exploding
</option>
<option value="\ DC Heroes 2d10 (adding and rerolling doubles) sum(accumulate x:=2d10 while (min x) = (max x))">
DC Heroes 2d10 (adding and rerolling doubles)
</option>
<option value="\ Sicherman dice choose {1, 2, 2, 3, 3, 4} + choose {1, 3, 4, 5, 6, 8}">
Sicherman dice
</option>
<option value="\ Shadowrun 4E drain from spirit binding Spirit := 6; \ Change to alter the spirit's force DrainPool := 17; \ Change to alter the drain resistance dice GreatForm := 1; \ 1 if binding a great form spirit, 0 if not Edge := 0; \ 1 if spending edge on drain resist, 0 if not SpiritHits := count 4 < (2*Spirit)#(d6); DrainHits := if Edge = 1 then count 4 < DrainPool#(accumulate x:=d6 while x = 6) else count 4 < DrainPool#(d6); Drain := if GreatForm = 1 then (3 * SpiritHits) - DrainHits else (2 * SpiritHits) - DrainHits; Drain">
Shadowrun 4E drain from spirit binding
</option>
<option value="\ 3d6, reroll lowest sum {d6,largest 2 3d6}">
3d6, reroll lowest
</option>
<option value="\ Warmachine attack rolls function hit(t, wa) = h := sum(t)d6; if h=t then 0 else if ((t*6)=h&t>1) then 1 else if (h>=wa) then 1 else 0 function damage(f, xr) = h := sum(f)d6; if (xr>=h) then 0 else (h-xr) n := 2; \number of attacks sum n# t := 2; \number of dice on attack rolls f := 4; \number of dice on damage rolls. x := 21; \ enemy armour w := 11; \enemy defense a := 6; \attack stat. r := 11; \power of attacker's weapon wa := w-a; \defense minus attack, in one variable. xr := x-r;\ armour minus power, in one variable. hitcheck := call hit(t, wa); q := (if (hitcheck=1) then (call damage (f, xr)) else 0); q">
Warmachine attack rolls
</option>
<option value="\ 4d6, dropping lowest, rerolling if below 11, adding 9 \ 4d6, reroll lowest x:=4d6; if (sum(largest 3 x)) < 13 then sum(4d6) - (least 1 x) + 9 else sum(largest 3 x) + 9">
4d6, dropping lowest, rerolling if below 11, adding 9
</option>
<option value="\ 1d20, reroll if below 9 x:=1d20; if x < 9 then sum(1d12+8) else x">
1d20, reroll if below 9
</option>
<option value="\ 1d20, reroll if below 8 x:=1d20; if x < 8 then sum(1d13+7) else min(x)">
1d20, reroll if below 8
</option>
<option value="\ Dreadball, rolling 5 d6 needing 4+, roll up on 6s N:=5; \ Change N to alter the number of dice S:=3; \ Change S to alter the target number to beat count S< N#(accumulate x:=d6 while x=6)">
Dreadball, rolling 5 d6 needing 4+, roll up on 6s
</option>
<option value="\ The Whispering Vault \ Whispering Vault with N dice N:=3; \ Change N to alter the number of dice c := N#d6; max (foreach x in 1..6 do sum (x = c))">
The Whispering Vault
</option>
<option value="\ D&D random Height & Weight (default: Human Male) x := sum 2d10; y := sum 2d4; ("HtMod:" || x || "Ht:" || 58 + x) |> ("WtMod:" || y || "Wt:" || 120 + x*y)">
D&D random Height & Weight (default: Human Male)
</option>
<option value="\ D66 d6 * 10 + d6">
D66
</option>
<option value="\ Melee Twin Strike, Hunter's Quarry, target has DR r := sum 1d20+8; \ vanguard roll s := sum 1d20+8; \ spellbond roll h := if r >= 20 then 1 else 0; \ vanguard hit i := if s >= 20 then 1 else 0; \ spellbond hit j := h + i; \ number of hits a := if r = 28 then 1 else 0; \ vanguard crit b := if s = 28 then 1 else 0; \ spellbond crit vandam := if a=1 then 11+1d8 else 1d10+1; spldam := if b=1 then 11+1d6 else 1d10+1; hq := 1d8; vandamq := if a=1 then vandam+8 else vandam+hq; spldamq := if b=1 then spldam+8 else spldam+hq; if j=0 then 0 else if j=2 then max {max {0, sum vandamq - 5} + max{0, sum spldam - 5}, max {0, sum vandam - 5} + max{0,spldamq - 5}} else if h=1 then max {0,sum vandamq-5} else max {0,sum spldamq - 5} ">
Melee Twin Strike, Hunter's Quarry, target has DR
</option>
<option value="\ Basketball using Troll \ Welcome to Basketball: Troll Style \ This is a way to determine games with user-selected stats \ and a random process. \ ************ \ INSTRUCTIONS \ ************ \ Go to VARIABLES and follow the instructions provided there. \ Click Make random rolls to determine games randomly. \ Do not edit FUNCTIONS or calculate probabilities. \ ********* \ FUNCTIONS \ ********* function game(Sht,TriSht,FT,Def,Foul,Stl) = call quarter(Sht,TriSht,FT,Def,Foul,Stl) + call quarter(Sht,TriSht,FT,Def,Foul,Stl) + call quarter(Sht,TriSht,FT,Def,Foul,Stl) + call quarter(Sht,TriSht,FT,Def,Foul,Stl) function quarter(Sht,TriSht,FT,Def,Foul,Stl) = call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) + call posession(Sht,TriSht,FT,Def,Foul,Stl) function posession(Sht,TriSht,FT,Def,Foul,Stl) = x:=1d2+1; if d100<=Stl then 0 else if d100<=Foul then call freeThrow(FT) + call freeThrow(FT) else if d100>Def then call shoot(x,Sht,TriSht) else 0 function freeThrow(FT) = if d100<=FT then 1 else 0 function shoot(x,Sht,TriSht) = acc:=d100; if x=3 & acc<=TriSht then 3 else if x=2 & acc<=Sht then 2 else 0 \ ********* \ VARIABLES \ ********* \ These are the variables for the first team hSht:=74; hTriSht:=46; hFT:=87; hDef:=16; hFoul:=10; hStl:=11; \ These are the variables for the second team rSht:=61; rTriSht:=37; rFT:=73; rDef:=19; rFoul:=4; rStl:=13; \ This is how the score is determined. You can change A and B to whatever team names you want. Do not modify anything else. "A <|B "||'call game(hSht,hTriSht,hFT,rDef,rFoul,rStl)<|""||'call game(rSht,rTriSht,rFT,hDef,hFoul,hStl) \ The below call can be used to determine a team's win probability given the variables. To calculate probabilities, comment the above call and uncomment the below call. If the below call is used, the number is the margin from the perspective of the first team. That means a positive value indicates a win by the first team, while a negative value indicates a win by the second team. \call game(hSht,hTriSht,hFT,rDef,rFoul,rStl) - call game(rSht,rTriSht,rFT,hDef,hFoul,hStl)">
Basketball using Troll
</option>
<option value="\ Football using Troll \ Welcome to Troll Football! \ From the creator of Basketball using Troll, this program allows you to simulate football games using user-defined variables and a random process. \ You can use this program to help you predict a football game at any level provided you know certain stats for both teams. \ ************ \ INSTRUCTIONS \ ************ \ Go to VARIABLES and edit them as you wish. \ Go to MAIN METHOD and edit Away and Home to any team name you want. \ Do not edit the FUNCTIONS, variable names, or any other part of the MAIN METHOD. \ ********* \ FUNCTIONS \ ********* function game(YPP,Comp,YPR,FG,passDef,rushDef) = call quarter(YPP,Comp,YPR,FG,passDef,rushDef) + call quarter(YPP,Comp,YPR,FG,passDef,rushDef) + call quarter(YPP,Comp,YPR,FG,passDef,rushDef) + call quarter(YPP,Comp,YPR,FG,passDef,rushDef) function quarter(YPP,Comp,YPR,FG,passDef,rushDef) = call drive(YPP,Comp,YPR,FG,passDef,rushDef) + call drive(YPP,Comp,YPR,FG,passDef,rushDef) + call drive(YPP,Comp,YPR,FG,passDef,rushDef) function drive(YPP,Comp,YPR,FG,passDef,rushDef) = call down(YPP,Comp,YPR,FG,passDef,rushDef,80,10,1) function down(YPP,Comp,YPR,FG,passDef,rushDef,yn,ync,dwn) = sel:=1d2; if dwn<4 & sel=1 then call rush(YPP,Comp,YPR,FG,passDef,rushDef,yn,ync,dwn) else if dwn<4 & sel=2 then call pass(YPP,Comp,YPR,FG,passDef,rushDef,yn,ync,dwn) else if yn>40 then 0 else call fieldGoal(FG,yn+18) function rush(YPP,Comp,YPR,FG,passDef,rushDef,yn,ync,dwn) = AvgRush:=(YPR+rushDef)/2; yards:=(sum 50d2-75) + AvgRush; if yards>=yn then 7 else if yards<ync then call down(YPP,Comp,YPR,FG,passDef,rushDef,yn-yards,ync-yards,dwn+1) else call down(YPP,Comp,YPR,FG,passDef,rushDef,yn-yards,10,1) function pass(YPP,Comp,YPR,FG,passDef,rushDef,yn,ync,dwn) = AvgPass:=(YPP+passDef)/2; yards:=(sum 50d2-75) + AvgPass; if d100>Comp then call down(YPP,Comp,YPR,FG,passDef,rushDef,yn,ync,dwn+1) else if yards>=yn then 7 else if yards<ync then call down(YPP,Comp,YPR,FG,passDef,rushDef,yn-yards,ync-yards,dwn+1) else call down(YPP,Comp,YPR,FG,passDef,rushDef,yn-yards,10,1) function fieldGoal(FG,length) = Chance:=(40*FG)/length; if d100<=Chance then 3 else 0 \ ********* \ VARIABLES \ ********* \ These are the variables for the away team: aYPP:=10; \ Yards per completed pass aComp:=50; \ Completion percentage aYPR:=5; \ Yards per rush aFG:=75; \ Chance to make a 40 yard field goal aPassDef:=10; \ Yards allowed per completed pass by the opponent aRushDef:=5; \ Yards allowed per rush by the opponent \ These are the variables for the home team: hYPP:=10; \ Yards per completed pass hComp:=50; \ Completion percentage hYPR:=5; \ Yards per rush hFG:=75; \ Chance to make a 40 yard field goal hPassDef:=10; \ Yards allowed per completed pass by the opponent hRushDef:=5; \ Yards allowed per rush by the opponent \ *********** \ MAIN METHOD \ *********** "Away <|Home "||'call game(aYPP,aComp,aYPR,aFG,hPassDef,hRushDef)<| "" ||'call game(hYPP,hComp,hYPR,hFG,aPassDef,aRushDef)">
Football using Troll
</option>
<option value="\ The Wending Way - Nd10 accumulated count \ Was crashing the page so removed ">
The Wending Way - Nd10 accumulated count
</option>
<option value="\ Grim'N'Gritty Fighter Strike vs sample dragon \ Grim'N'Gritty Fighter Strike vs sample dragon A := sum 2d10 + 18; B := sum 2d10 + 14; C := sum (A - B)/2; E := sum d8 + 10; F := sum E+C; G := sum F-18; "Attack Roll |>Defence Roll |>Difference|>Roll|>Damage|>Total Damage" || 'A|>'B|>'C|>'E|>'F|>'G">
Grim'N'Gritty Fighter Strike vs sample dragon
</option>
<option value="\ how many rolls does it take to get to a number function Target(n) = 	x := d6; 	if x>=n then 1 else 1 + call Target(n-x) sum 3+call Target(20-sum 3d6)">
how many rolls does it take to get to a number
</option>
<option value="\ Status Die \ (fudge) * Magnitude (d6) choose{-1,0,1} * d6">
Status Die
</option>
<option value="\ D6 System with Wild Die N := 1; \Number of Dice P := 0; \Number of Pips R := (N-1)d6; sum {R,P,choose {if d6=1 then -(sum {R,P,100}) else -sum (largest (min {1,N-1}) R),2..5,6+sum accumulate x:=d6 while x=6}}">
D6 System with Wild Die
</option>
<option value="\ 2d6+6 Stat Roll sum 2d6+6">
2d6+6 Stat Roll
</option>
<option value="\ Variety X dicepool baseroll N:=1; \ Number of rolls count 2<= N#(d6)+ count 2<= N#(d6)+ count 6<= N#(d6)+ count 6<= N#(d6)+ count 4<= N#(d6)">
Variety X dicepool baseroll
</option>
<option value="\ Warhammer 40k Unsaved wounds calculator \ e.g punixher cannon 20 attacks at 4+ to hit with target armor save of 3+ \ Set DICE = 20, TOHIT = 3, TOWOUND = 2 and TOSAVE = 2 DICE:=20; \ Change DICE to alter the number of dice TOHIT:=3; \ Change TOHIT to alter the target number to beat to hit TOWOUND:=2; \ Change TOWOUND to alter the target number to beat to wound TOSAVE:=2; \ Change TOSAVE to alter the target number to beat to save count TOSAVE>= (count TOWOUND< (count TOHIT< DICE # d6) # d6) # d6 ">
Warhammer 40k Unsaved wounds calculator
</option>
<option value="\ 3d6 - check for doubles function doubles(v) = s := count(v); r := count(different(v)); if s=r then 0 else 1 call doubles(3d6) ">
3d6 - check for doubles
</option>
<option value="\ Strat-O-Matic Baseball \ First digit is white die, next two digits is coloured \ dice, last two digits is 20-sided die d6*10000+ sum 2d6*100+ d20">
Strat-O-Matic Baseball
</option>
<option value="\ Splittermond Test 1 \ Test Pool:=4d10; High:=sum largest 2 Pool; Low:=sum least 2 Pool; if Low >= 4 then High else Low ">
Splittermond Test 1
</option>
<option value="\ Exploding D10 sum (accumulate y:=d10 while y=10)">
Exploding D10
</option>
<option value="\ even number \ less than 2 sum 3d6">
even number \ less than 2
</option>
<option value="\ The Queen's Cavaliers Dice Rolls \ \ TQC uses a dice pool system that adds together the two \ highest dice to get a total to compare, and then uses \ the lowest of those two dice as the number of success \ points earned. A:=0; \ Change to # of d4s in roll B:=1; \ Change to # of d6s in roll C:=2; \ Change to # of d8s in roll E:=1; \ Change to # of d10s in roll F:=0; \ Change to # of d12s in roll S:=0; \ Change to 1 to count success points instead of total sum(least (2 - S) (largest 2 { A d4, B d6, C d8, E d10, F d12} ))">
The Queen's Cavaliers Dice Rolls
</option>
<option value="\ IChing \ 6: moving yin \ 7: stable yang \ 8: stable yin \ 9: moving yang 6#choose{6,7,7,7,7,7,8,8,8,8,8,8,8,9,9,9}">
IChing
</option>
<option value="\ WH40K Necron Tesla ToHit Roll function rolls(n) = TOHIT:= 3; TWIN:= 0; count(n # (x:= d6; if x < 6 then if TWIN > 0 then if TOHIT<=x then x else y:= d6; if y < 6 then TOHIT<=y else TOHIT<={2d6,y} else TOHIT<=x else TOHIT<={2d6,x})) N:= 1; \ Number of guns S:= 4; \ Number of shoots NS:= N*S; call rolls(NS)">
WH40K Necron Tesla ToHit Roll
</option>
<option value="\ LCR function lcr (dor) = x:= dor d6; if x<4 then "Dot" else if x=4 then "Star" else if x=5 then "Left" else "Right" 3'call lcr(1)">
LCR
</option>
<option value="\ Exploding z9 + partial dice sum { sum (accumulate x:=z9 while x=9), min{z9,4} \ Loadstar roll for skill 13 exploding z9 + up to 4 on a z9 \ to change the skill adjust the number in the min \ to add a second die for skill over 18 \ remove the \ on the next line \ , z9 }">
Exploding z9 + partial dice
</option>
<option value="\ Exploding N d10 holding # N:=3; \ Change N to alter the number of dice rolled \ Change number after "largest" to alter number of dice held sum largest 2 N#(accumulate x:=d10 while x=10)">
Exploding N d10 holding #
</option>
<option value="\ sum of 2 average 6-sided dice (2,3,3,4,4,5) sum {{{2,3,3,4,4,5} pick 1},{{2,3,3,4,4,5} pick 1}}">
sum of 2 average 6-sided dice (2,3,3,4,4,5)
</option>
<option value="\ Fatestorm: 3 FateCard Draw \ Make random rolls only - Too many combinations! \ Useful to generate SCM or quick-start Avatars \ http://www.fatestorm.com/index.php/gametester-dispatches/generating-scm-on-the-fly/#comment-72 function fatecard(x)=if (x = 1) then ' x ||"The Fool" else if (x = 2) then ' x || "The Master" else if (x = 3) then ' x ||"The Mother" else if (x = 4) then ' x ||"The Liberator" else if (x = 5) then ' x ||"The Emperor" else if (x = 6) then ' x ||"The Empress" else if (x = 7) then ' x ||"The Foreigner" else if (x = 8) then ' x ||"The Fanatic" else if (x = 9) then ' x ||"The Judge" else if (x = 10) then ' x ||"The Hermit" else if (x = 11) then ' x ||"The Wanderer" else if (x = 12) then ' x ||"The Thief" else if (x = 13) then ' x ||"The Philosopher" else if (x = 14) then ' x ||"The Crone" else if (x = 15) then ' x ||"The Muse" else if (x = 16) then ' x ||"The Intellectual" else if (x = 17) then ' x ||"The Prisoner" else if (x = 18) then ' x ||"The Hero" else if (x = 19) then ' x ||"The Orphan" else if (x = 20) then ' x ||"The Child" else if (x = 21) then ' x ||"The Father" else if (x = 22) then ' x ||"Saedizac/Zaussean" else "--" draw:={1..22} pick 3; cardA:= (choose draw); cardB:=choose (draw -- cardA); cardC:=draw -- cardA -- cardB; "Archetype: |>Element: |>Past-Life: " || call fatecard (cardA) |> call fatecard (cardB) |> call fatecard (cardC) ">
Fatestorm: 3 FateCard Draw
</option>
<option value="\ Roll 100 5d6 and add up the sums sum{5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6,5d6}">
Roll 100 5d6 and add up the sums
</option>
<option value="\ Project Euler #389 T:=1d4; C:=sum (T # 1d6); O:=sum (C # 1d8); DD:=sum (O # 1d12); I:=sum (DD # 1d20); I ">
Project Euler #389
</option>
<option value="\ d66 lowest die as tenths a:=1d6;b:=1d6; if (a < b) then sum(a * 10 + b) else (b * 10 + a) \ An alternative formulation (by Torben): \ \ x := 2d6; \ 10*(min x) + (max x)">
d66 lowest die as tenths
</option>
<option value="\ Battle Sworn hit calculator N:=2; \ Change N to alter the number of dice x:= N d6; \ Count hits and misses s:=count 6= x; \ count 6 hit c:=count 5= x; \ count 5 hit m:=count 1= x; \ count 1 miss h:=s+c; if h<m then 0 else h-m">
Battle Sworn hit calculator
</option>
<option value="\ Roll 1 on d10 then under luck value for success luck:=6; x:=1d10; if x > 1 then 1 else y:=1d10; if y < luck then 1 else 0">
Roll 1 on d10 then under luck value for success
</option>
<option value="\ Roll d24 (tesseract) with 4d6 and a d4 (sum 4d6)-(d4-1)">
Roll d24 (tesseract) with 4d6 and a d4
</option>
<option value="\ "Blackjack" game, roll 2d24 under sum of 25. sum ((sum 4d6)-(d4-1)+(sum 4d6)-(d4-1))">
"Blackjack" game, roll 2d24 under sum of 25.
</option>
<option value="\ 3d6, drop the highest ("Cold Blooded") x:=3d6;sum(least 2 x)">
3d6, drop the highest ("Cold Blooded")
</option>
<option value="\ DSA Talentprobe / TDE skill test skill := 10; \ Der TaW / The skill attributeA := 10; \ Erstes Attribut / The first attribute attributeB := 10; \ Zweites Attribut / The second attribute attributeC := 10; \ Drittes Attribut / The third attribute rollA := d20; \ W20 für das erste Attribut / d20 for the first attribute rollB := d20; \ W20 für das zweite Attribut / d20 for the second attribute rollC := d20; \ W20 für das dritte Attribut / d20 for the third attribute resultA := attributeA - rollA; resultB := attributeB - rollB; resultC := attributeC - rollC; \ Nur wenn der W20 über der Eigenschaft ist, wird etwas abgezogen \ Only when the d20 is higher then the Attribute you lose skill points finalResult := skill + min{resultA,0} + min{resultB,0} + min{resultC,0}; \ Glücklicher Erfolg und Patzer wird berücksichtigt \ Lucky success and unlucky failure factored in if (rollA = 1 & rollB = 1) then skill else if (rollA = 1 & rollC = 1) then skill else if rollB = 1 & rollC = 1 then skill else if rollA = 20 & rollB = 20 then -100 else if rollA = 20 & rollC = 20 then -100 else if rollB = 20 & rollC = 20 then -100 else if finalResult = 0 then 1 else finalResult">
DSA Talentprobe / TDE skill test
</option>
<option value="\ DSA Talentprobe mit Unterwürfeln (Yinan-Alternative) \ DSA Talentprobe / TDE skill test skill := 0; \ Der TaW / The skill attributeA := 10; \ Erstes Attribut / The first attribute attributeB := 10; \ Zweites Attribut / The second attribute attributeC := 10; \ Drittes Attribut / The third attribute rollA := d20; \ W20 für das erste Attribut / d20 for the first attribute rollB := d20; \ W20 für das zweite Attribut / d20 for the second attribute rollC := d20; \ W20 für das dritte Attribut / d20 for the third attribute resultA := attributeA - rollA; resultB := attributeB - rollB; resultC := attributeC - rollC; finalResult := skill + resultA + resultB + resultC; \ Glücklicher Erfolg und Patzer wird berücksichtigt \ Lucky success and unlucky failure factored in if (rollA = 1 & rollB = 1) then 100 else if (rollA = 1 & rollC = 1) then 100 else if rollB = 1 & rollC = 1 then 100 else if rollA = 20 & rollB = 20 then -100 else if rollA = 20 & rollC = 20 then -100 else if rollB = 20 & rollC = 20 then -100 else if finalResult = 0 then 1 else if finalResult < 0 then -1 else if skill = 0 then 1 else if finalResult > skill then skill else finalResult">
DSA Talentprobe mit Unterwürfeln (Yinan-Alternative)
</option>
<option value="\ 4d6 reroll 1s drop lowest \ 4d6, reroll 1s, drop lowest x:=4z4;sum(largest 3 x)+6">
4d6 reroll 1s drop lowest
</option>
<option value="\ AD&D 1e Attribute Gen. Method III: best of 6 3d6 \ 3d6, choose best roll of 6. largest 1 6#(sum 3d6)">
AD&D 1e Attribute Gen. Method III: best of 6 3d6
</option>
<option value="\ Shadowrun5 Opposed test with Limit \ Shadowrun5 Opposed test \ NumL is the number of dice to roll for the left test \ LimL is the Limit for the left test \ NumR is the number of dice to roll for the right test \ LimR is the Limit for the right test NumL := 10; LimL := 4; NumR := 7; LimR := 10; x := count 4< NumL d6; y := count 4< NumR d6; (if x > LimL then LimL else x) - (if y > LimR then LimR else y) ">
Shadowrun5 Opposed test with Limit
</option>
<option value="\ Sum least two dice of a group sum (least 2 {2d6, 1d4})">
Sum least two dice of a group
</option>
<option value="\ Sum largest two dice of a group sum (largest 2 {2d6, 1d4})">
Sum largest two dice of a group
</option>
<option value="\ Combat Simulator \ Welcome to the Combat Simulator. \ Do not mess with anything below the stars. \ Also, you cannot calculate probabilities with this simulator. \ You can only make random rolls. \ What you are about to see are the static variables. \ You may set them to whatever you want. \ Comments are included to explain what each does. \ Below are the static variables. aHP:=80; \Player a's HP. aChance:=95; \Player a's chance to hit. An error occurs if this is not between 0 and 100. aDR:=0; \Player a's damage reduction. This is an integer. aMinDmg:=6; \Player a's minimum damage. aMaxDmg:=10; \Player a's maximum damage. Make sure this is larger than the minimum. bHP:=80; \Player b's HP. bChance:=95; \Player b's chance to hit. An error occurs if this is not between 0 and 100. bDR:=0; \Player b's damage reduction. This is an integer. bMinDmg:=6; \Player b's minimum damage. bMaxDmg:=10; \Player b's maximum damage. Make sure this is larger than the minimum. \ HOW COMBAT WORKS \ The combat begins with player a making an attack on player b. \ Then player b makes an attack on player a. \ This repeats until one player goes to 0 HP or lower (dies). \ Again, do not mess with anything below the stars. \ That's just the code to run the actual combat. \ Also, the combat is run twice, but roles are switched the second time. \ This makes it fair by giving both players the opportunity to go first. \ When making random rolls, the winners will be displayed as "a" or "b" \ depending on the winner. \ ************************************************ call combat (aHP, aChance, aDR, aMinDmg, aMaxDmg, bHP, bChance, bDR, bMinDmg, 10, 0) <> call combat (aHP, aChance, aDR, aMinDmg, aMaxDmg, bHP, bChance, bDR, bMinDmg, 10, 1) function combat (ah, acth, ad, amin, amax, bh, bcth, bd, bmin, bmax, aAttacks) = if ah<1 then "b" else if bh<1 then "a" else if aAttacks=0 then call attack (ah, acth, ad, amin, amax, bh, bcth, bd, bmin, bmax, 1) else call attack (ah, acth, ad, amin, amax, bh, bcth, bd, bmin, bmax, 2) function attack (apts, ach, admgred, aminDam, amaxDam, bpts, bch, bdmgred, bminDam, bmaxDam, attacker) = if attacker=4 then call combat (apts, ach, admgred, aminDam, amaxDam, bpts, bch, bdmgred, bminDam, bmaxDam, 0) else if attacker=3 then call combat (apts, ach, admgred, aminDam, amaxDam, bpts, bch, bdmgred, bminDam, bmaxDam, 1) else if attacker=2 then call resolve (apts, bch, admgred, bminDam, bmaxDam, 2, bpts, ach, bdmgred, aminDam, amaxDam) else call resolve (bpts, ach, bdmgred, aminDam, amaxDam, 1, apts, bch, admgred, bminDam, bmaxDam) function resolve (hitPoints, chan, DR, minimum, maximum, act, inHitPoints, inChan, inDR, inMin, inMax) = atkRoll:=d100; dealt:=choose(minimum..maximum); taken:=dealt-DR; newHP:=hitPoints-taken; if atkRoll>chan & act=1 then call attack (inHitPoints, chan, inDR, minimum, maximum, hitPoints, inChan, DR, inMin, inMax, 3) else if atkRoll>chan & act=2 then call attack (hitPoints, inChan, DR, inMin, inMax, inHitPoints, chan, inDR, minimum, maximum, 4) else if atkRoll<chan & act=1 then call attack (inHitPoints, chan, inDR, minimum, maximum, newHP, inChan, DR, inMin, inMax, 3) else call attack (newHP, inChan, DR, inMin, inMax, inHitPoints, chan, inDR, minimum, maximum, 4)">
Combat Simulator
</option>
<option value="\ Star wars EotE white := choose{0,0,1,2,10,11}; green := choose{0,1,1,2,10,10,11,20}; yellow := choose{0,1,2,2,10,10,11,11,11,20,20,100}; black := choose{0,0,-1,-1,-10,-10}; purple := choose{0,-1,-1,-1,-2,-10,-11,-20}; red := choose{0,-1,-1,-2,-2,-10,-10,-11,-11,-20,-20,-100}; sum 1#green + 1#yellow">
Star wars EotE
</option>
<option value="\ Best 4 out of 5 dF sum (largest 4 5#(d3 - 2))">
Best 4 out of 5 dF
</option>
<option value="\ Firestorm Armada exploding dice (10d6) expdie := {0,0,0,1,1,2}; numdice := 10; sum (numdice # sum (accumulate y:=choose expdie while y=2))">
Firestorm Armada exploding dice (10d6)
</option>
<option value="\ BATS - Exertion Roll \ wyrdR 14.06.06 R:=1; \1 - See Outcomes, 0 - See all dice rolls and notes [Make random rolls.] only Fac:=3; \ FACET Dom:=4; \ DOMAIN - Exploding d6 A:=(Fac+Dom)#(accumulate x:=d6 while x=6); FU:=3#(accumulate v:=d6 while v=6); \Fumble? \\ TOTAL 6s Ax:=A keep 6; FUx:=FU keep 6; \\ Comment the next line to see dice rolls but only use [Make random rolls] button if (R=1) then (if Ax then count Ax else - count FUx) else ("Click [ Make random rolls ] to see dice rolls..." |> "Comment this line and uncomment last line") \\ Uncomment the next line to see dice but only use [Make random rolls] button \((if Ax then '(count Ax) || ": " || '(A drop 6) else '(-count FUx) ||": " || 'A |> "{ " ||'(FU drop 6)|| "}" ) <> ( if (count Ax) >=3 then "Exertion" else (count Ax) = 0 &(count FUx) >=3 & "Exertion" ))">
BATS - Exertion Roll
</option>
<option value="\ ORE with reroll M unmatched \ One Roll Engine matching dice with a limited number of rerolls \ for unmatched dice. Only N, S, and rerolls need to be set. (NdS is the pool) function run(v) = max foreach x in different v do count x=v N := 5; S := 6; rerolls:=1; roll:= N d S; sets := roll -- different roll; if (0 = count sets) then toreroll:= roll pick rerolls; call run((count toreroll) d6 U (roll -- toreroll)) else if ((N-1) = count sets) then call run(roll) else toreroll:=(roll drop sets) pick rerolls; call run((count toreroll) d6 U (roll -- toreroll))">
ORE with reroll M unmatched
</option>
<option value="\ Blue Planet (Synergy) Damage Roll - Rating 5 N:=3; count 5>= N#(d10) \ Change count to alter Damage Rating">
Blue Planet (Synergy) Damage Roll - Rating 5
</option>
<option value="\ O:CotEC Match/Highest D10 Dice mechanic P := 2;\Number of Positive Dice (2 + Positive Attribute) N := 2;\Number of Negative Dice (2 + Negative Attribute) \action modifier function proll := P#(accumulate x:=d10 while x=10); nroll := N#(accumulate x:=d10 while x=10); if (min proll) = (max proll) then ( ((count (proll)-1)*10) + (min proll) ) - (max nroll) else if (min nroll) = (max nroll) then (max proll) - ( ((count (nroll)-1)*10) + (max nroll) ) else if (min proll) = (max proll) & (min nroll) = (max nroll) then ( ((count (proll)-1)*10) + (max proll) ) - ( ((count (nroll)-1)*10) + (max nroll) ) else max proll - max nroll \\if (min proll) =/= (max proll) & (min nroll) =/= (max \\nroll) then (max proll) - (max nroll) \\ else if (min proll) = (max proll) & (min nroll) \\=/= (max nroll) then (sum proll) - (max nroll) \\ else if (min proll) =/= (max proll) & (min nroll) = \\(max nroll) then (max proll) - (sum nroll) \\else (sum proll) - (sum nroll) ">
O:CotEC Match/Highest D10 Dice mechanic
</option>
<option value="\ Deadzone, rolling 3 d8 needing 6+, roll up on 8s N:=3; \ Change N to alter the number of dice S:=5; \ Change S to alter the target number to beat count S< N#(accumulate x:=d8 while x=8)">
Deadzone, rolling 3 d8 needing 6+, roll up on 8s
</option>
<option value="\ O:CotEC Match/Highest 2D10-2D10 Dice mechanic function pool(n) = roll := n#(accumulate x:=d10 while x=10); if (count roll) = (count different roll) \ all different then max roll else max (foreach i in roll do ((count i = roll)-2)*10+i) P := 3; N := 2; call pool(P) - call pool(N) \ 2d10-2d10 count matches/highest with 10s vs 1s open ending \function pool(n) = \ roll := n d10; \ ones := count 1 = roll; \ tens := count 10 = roll; \ if tens > ones then roll U call pool(tens - ones) else \roll \ \function value(roll) = \ if (count roll) = (count different roll) \ all different \ then max roll \ else max (foreach i in roll do ((count i = roll)-2)*10+i) \P := 3; \N := 2; \call value(call pool(P)) - call value(call pool(N))">
O:CotEC Match/Highest 2D10-2D10 Dice mechanic
</option>
<option value="\ Star Wars: Edge of the Empire Dice Success Probs Vs 1 \Star Wars Edge of the Empire Dice Success Probability \This will only give you probability of success/failure \Define custom dice, value is number of successes on each side of the die A :=choose {0, 0, 0, 0, 1, 1, 1, 2}; \Advantage I := choose {0, 0, 0, 0, 0, -1, -1, -2}; \dIfficulty (D is reserved) P := choose {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2}; \Proficiency C :=choose {0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -2, -2}; \Challenge B :=choose {0, 0, 0, 0, 1, 1}; \Boost S :=choose {0, 0, 0, 0, -1, -1}; \Setback \calculate for a particular roll by typing in "sum x#d1 + sum y#d2 + sum z#d3..." where x, y, z are number of dice, and d1, d2, d3 are the letter code for that particular type of dice \for example, "sum 2#A + sum 1#P + sum 2#I" will give the probabilities for rolling 2 Advantage dice, 1 Proficiency, and 2 Difficulty sum 1#A + sum 2#P + sum 2#I">
Star Wars: Edge of the Empire Dice Success Probs Vs 1
</option>
<option value="\ Best 6 of 8 (3d6) sum (largest 6 8#(sum 3d6))">
Best 6 of 8 (3d6)
</option>
<option value="\ Fudge roll, with the occurrence of each symbol \ Displays how many +, 0 and - are in a Fudge roll dice:=4#(d3); minus:= (count 1 = dice); zero:= (count 2 = dice); plus:= (count 3 = dice); (sum (sum dice) - 8) || "<br>-: " || minus || "<br>0: " || zero || "<br>+: " || plus">
Fudge roll, with the occurrence of each symbol
</option>
<option value="\ Occurrence of one symbol in a Fudge roll \ How many of one particular sign (+, 0 or -) are there \ in a Fudge dice count 3 = 4#(d3)">
Occurrence of one symbol in a Fudge roll
</option>
<option value="\ D12 + exploding D6 sum { d12, sum (accumulate y:=d6 while y=6) }">
D12 + exploding D6
</option>
<option value="\ D12 + exploding D6, with 1 rerolled \ D12 + exploding D6 \ with 1 rerolled on both dice sum { repeat x:=d12 while x=1, sum (accumulate y:=(repeat y:=d12 while y=1) while y=6) }">
D12 + exploding D6, with 1 rerolled
</option>
<option value="\ D12 + exploding D8 sum { d12, sum (accumulate y:=d8 while y=8) }">
D12 + exploding D8
</option>
<option value="\ Fudge roll with symbols a:=d3-2; b:=d3-2; c:=d3-2; e:=d3-2; sum (a+b+c+e) || " " || "<br>" || call display (a) || " " || call display (b) || " " || call display (c) || " " || call display (e) function display (x) = if x=-1 then "-" else if x=1 then "+" else "o"">
Fudge roll with symbols
</option>
<option value="\ Fudge roll using a table for 3d6 \ Fudge dice using a table for 3d6 \ Suggested in the Fate System Toolkit \ as a possible replacement for Fudge dice a:=sum 3d6; if a=3 then -4 else if a=4 then -3 else if a=5 then -2 else if a=6 then -2 else if a=7 then -1 else if a=8 then -1 else if a=9 then 0 else if a=10 then 0 else if a=11 then 0 else if a=12 then 0 else if a=13 then 1 else if a=14 then 1 else if a=15 then 2 else if a=16 then 2 else if a=17 then 3 else if a=18 then 4 else "error : " || a">
Fudge roll using a table for 3d6
</option>
<option value="\ The Regiment VOF attack players := 1; \ number of times to reroll attack damage := 3; \ number of damage dice incidental := choose{0,0,1,1,1,10}; scattered := choose{0,1,1,1,10,10}; direct := choose{1,1,1,10,10,10}; focused := choose{1,1,10,10,10,100}; concentrated := choose{1,10,10,10,100,100}; max players#(sum damage#direct)">
The Regiment VOF attack
</option>
<option value="\ Match Different/Highest 2d-2d +Die Step Mechanic function ppool(n,m,o) = roll := n#(accumulate x:=d10 while x=10) U m#(accumulate x:=d8 while x=8) U o#(accumulate x:=d12 while x=12); if (count different roll) = 0 \ all the same then roll = 0 else if (count different roll) = 1 \ 2 different RB 1 then max roll else max (foreach i in roll do ((count i = roll)-1)*5+i) function npool(n,m,o) = roll := n#(accumulate x:=d10 while x=10) U m#(accumulate x:=d4 while x=4) U o#(accumulate x:=d12 while x=12); if (count different roll) = 0 \ all the same then roll = 0 else if (count different roll) = 1 \ 2 different RB 1 then max roll else max (foreach i in roll do ((count i = roll)-1)*5+i) P := 1; N := 1; call ppool(2,0,2) - call npool(2,0,0) ">
Match Different/Highest 2d-2d +Die Step Mechanic
</option>
<option value="\ roll 3 dice and keep ones - do it three times ones := 0; ones := ones + count 1 = (3-ones)d6; ones := ones + count 1 = (3-ones)d6; ones := ones + count 1 = (3-ones)d6; ones ">
roll 3 dice and keep ones - do it three times
</option>
<option value="\ Marvel Heroic Roleplay w Burst and PP CORRECTED \ Marvel Heroic Roleplaying Result with Burst and Plot-Point CORRECTED see notes at bottom A:=0; \ Change to # of d4s in roll B:=0; \ Change to # of d6s in roll C:=0; \ Change to # of d8s in roll E:=5; \ Change to # of d10s in roll F:=0; \ Change to # of d12s in roll Burst:=0; \ Change to 1 if using the Burst SFX (however named on datafile) PPforResult:=0; \ Number of extra dice added to your result calculation because you spent Plot Points sum largest (2+Burst+PPforResult) least (A+B+C+E+F-Burst) {A d4 drop 1,B d6 drop 1,C d8 drop 1,E d10 drop 1,F d12 drop 1} \Note: this is a correction to the other user-contributed roll, which was using "count" to get rid of the 1s, but this was leading to some strange and unexpected results. "Drop" is the better choice, I think. \Note: this does not take into account a desire to keep the largest die by sides out for the Effect Die. It assumes you always choose to get the highest total. \Note: with the Burst option, it doesn't take many dice to make Troll give invocation errors, even if you aren't using it. If you don't need Burst, see the other version of this, or delete those bits of code.">
Marvel Heroic Roleplay w Burst and PP CORRECTED
</option>
<option value="\ Marvel heroic Roleplay w/o Burst \ Marvel Heroic Roleplay w/o Burst \ Marvel Heroic Roleplaying Result w/o Burst A:=0; \ Change to # of d4s in roll B:=0; \ Change to # of d6s in roll C:=0; \ Change to # of d8s in roll E:=5; \ Change to # of d10s in roll F:=0; \ Change to # of d12s in roll Burst:=0; \ Change to 1 if using the Burst SFX (however named on datafile) PPforResult:=0; \ Number of extra dice added to your result calculation because you spent Plot Points sum largest (2+PPforResult) {A d4 drop 1,B d6 drop 1,C d8 drop 1,E d10 drop 1,F d12 drop 1} \Note: this does not take into account a desire to keep the largest die by sides out for the Effect Die. It assumes you always choose to get the highest total. ">
Marvel heroic Roleplay w/o Burst
</option>
<option value="\ VtM probabilities calculator diff := diff ; nofd := nofd ; (count (diff <= nofd d10) - count (1 = nofd d10) + count (10 = nofd d10)) \Replace ":= nofd" with ":= number of dice". Replace ":= diff" with ":= success difficulty". Delete " + count (10=nofd d10)" if attribute level is <4 \botch chance on next line (must add \ after nofd above) \(count (diff <= nofd d10) + count (10 = nofd d10)) \Normal (factoring in 10s & 1s): (count (diff >= nofd d10) - count (1 = nofd d10) + count (10 = nofd d10)) \Normal (10s don't double): (count (diff >= nofd d10) - count (1 = nofd d10)) \Single attribute: (count (diff >= nofd d10))">
VtM probabilities calculator
</option>
<option value="\ Attempt an attack multiple times function attempt (prob, numm, effec) = if d100<=prob then sum numm d6 + effec else 0 md := 0; dc := 10; chc := 75; sum (10 # (call attempt (chc, dc, md)))">
Attempt an attack multiple times
</option>
<option value="\ Roll d20 for success, compromise, trouble function gogogo(twenty, sixes, dir) = if (dir = 1) then if (twenty > (20-sixes)) then 1 else 0 else if (twenty <= sixes) then -1 else 0 function autoroll(roll, good, bad) = if (roll = 20) then 1 else if (roll = 1) then -1 else sum {call gogogo(roll, good, 1), call gogogo(roll, bad, -1)} S := 4; F := 4; succ := sum (S)d6; fail := sum (F)d6; result := 0; roll := sum 1d20; call autoroll(roll, succ, fail)">
Roll d20 for success, compromise, trouble
</option>
<option value="\ Dominions 4 \ Dominion 4 : \ 2d6, relaunch a d6-1 for each 6 (including on new launches) sum 2#(accumulate x:=z6 while x=6) + 2">
Dominions 4
</option>
<option value="\ D4 Dice Pool \ D4 dice pool, no rerolls N:=1; \ Change N to alter the number of dice count 3< N#(accumulate x:=d4 while x=5)">
D4 Dice Pool
</option>
<option value="\ test \ DO NOT TRY TO CALC PROBS \ Count sixes as 1 \ If roll is all sixes or if 3+ sixes, roll additional dice, +1 per six, re-rolling for every six \ If roll contains a single dice <= Foci, +Foci \ (Not yet implemented) If secondary (lesser) Foci apply, +1 per Foci (up to 3 more). Fac:=11; \ FACET Dom:=2; \ DOMAIN Foci:=3; \ Foci applied (singleton for now) N:=Fac + Dom; \ Number of Dice Fmax:=max(Foci); \ Will be multiple Foci later A:=N#d6; \ Main Roll cAH:=(count (A keep 6)); cAH:=if ((cAH>2) U (cAH=N)) then cAH+count((accumulate j:=d6 while j=6) keep 6) else cAH; cAH+ max ( (A keep {0..Fmax}) U 0) || "<br>Rolled: " || A">
test
</option>
<option value="\ Assign a pool of d3's call assign (0, 0, 0, 18) function assign (a, b, c, dc) = hw:=d3; if dc=0 then 'a |>'b|>'c else if hw=1 then call assign (a+1, b, c, dc-1) else if hw=2 then call assign (a, b+1, c, dc-1) else call assign (a, b, c+1, dc-1)">
Assign a pool of d3's
</option>
<option value="\ BATS - Increment Roll \ wyrdR - 14.08.03 \ Given a number of dice, chances of improving to a given level Num:=3; \ Number of Dice Start:=0; \ Current Level Roll:=Num#(accumulate x:=d6 while x=6); max (Start U call increment(Roll,Start) ) function increment(R,A)= Ax:=A+1; imp:=min (Ax<=R); Rem:=(R--imp); imp & Ax U (Rem & call increment(Rem,Ax) )">
BATS - Increment Roll
</option>
<option value="\ BATS - Sequence Roll \ wyrdR - 14.08.03 \ To get a given score, every number up to that score must appear in the roll \ But 6s are counted as wildcards above that score \ e.g. If you roll 1 2 4 5 6 6 the base result is 2 but you can add 2 (one for each 6) for an end result of 4 Num:=3; \ Number of Dice Start:=0; \ Current Level Roll:=(Num#(accumulate x:=d6 while x=6)); P:= call straight(Roll,Start); max (Start U P) + count (Roll keep 6) function straight(R,A)= R:=different (R drop 6); Ax:=A+1; imp:=if (Ax <6) then (Ax=R) else (R keep 6); Rem:=(R -- imp); imp & Ax U (Rem & call straight(Rem,Ax) )">
BATS - Sequence Roll
</option>
<option value="\ Donjon character "Str |>Dex|>Con|>Int|>Wis|>Chr" || 6' median 3d6">
Donjon character
</option>
<option value="\ Golf Hole using Troll - Par 4/5 Version call drive (350, 10, 10, 10, 10, 0) \ Note: The function call is at the top. These are the parameters: \ yds: The number of yards in the hole. \ str: Strength is used to determine driving and layup distance. \ dex: Dexterity is used to determine driving accuracy. \ chp: Chipping ability is used to determine chipping accuracy. \ put: Putting ability is used to determine putting accuracy. \ shots: Leave this at 0 in the function call. \ The parameters are ordered (yds, str, dex, chp, put, shots). \ Don't mess with anything below the function call or these instructions. \ The output is the number of shots it takes to complete the hole. \ Due to Troll limitations, this is not usable for par 3's. \ If you see the message "An error occurred during calculation", you need to increase the yds or decrease str. \ Alternatively, you could use the parameters in the Par 3 Version. function drive (yds, str, dex, chp, put, shots) = minDist:=150 + (8*str); maxDist:=180 + (10*str); actualDist:=choose (minDist..maxDist); accRoll:=d20+dex; if accRoll>=20 then call iron (yds-actualDist, str, dex, chp, put, shots+1, 0) else if accRoll>=15 then call iron (yds-actualDist, str, dex, chp, put, shots+1, 5) else if accRoll>=10 then call iron (yds-actualDist, str, dex, chp, put, shots+1, 10) else call iron (yds-actualDist, str, dex, chp, put, shots+1, 20) function iron (yds, str, dex, chp, put, shots, pen) = thresh:=120 + (6*str); maxDev:=((30+pen-dex)*yds)/100; actualDev:=choose (0..maxDev); if yds>thresh then call layup (yds, str, dex, chp, put, shots) else if actualDev>30 then call iron (actualDev, str, dex, chp, put, shots+1, 0) else if actualDev>14 then call chip (actualDev*3, str, dex, chp, put, shots+1) else call putt (actualDev*3, str, dex, chp, put, shots+1) function layup (yds, str, dex, chp, put, shots) = minDistn:=100 + (6*str); maxDistn:=140 + (7*str); actualDistn:=choose (minDistn..maxDistn); accuRoll:=d20+dex; newYdg:=yds-actualDistn; if newYdg>30 then call iron (newYdg, str, dex, chp, put, shots+1, 0) else if newYdg<-30 then call iron (-1*newYdg, str, dex, chp, put, shots+1, 0) else if newYdg<-14 then call chip (-3*newYdg, str, dex, chp, put, shots+1) else if newYdg<0 then call putt (-3*newYdg, str, dex, chp, put, shots+1) else if newYdg<=14 then call putt (newYdg*3, str, dex, chp, put, shots+1) else call chip (newYdg*3, str, dex, chp, put, shots+1) function chip (ft, str, dex, chp, put, shots) = maxDevn:=((30-chp)*ft)/100; actualDevn:=choose (0..maxDevn); if actualDevn=0 then shots+1 else call putt (actualDevn, str, dex, chp, put, shots+1) function putt (ft, str, dex, chp, put, shots) = if ft>=25 then call lagOnly (ft, str, dex, chp, put, shots) else if ft>=15 then call lagPutt (ft, put, shots) else if ft>=8 then call longPutt (ft, put, shots) else if ft>=4 then call midPutt (ft, put, shots) else if ft>=1 then call shortPutt (ft, put, shots) else shots function lagOnly (ft, str, dex, chp, put, shots) = maxDevtn:=((25-put)*ft)/100; actualDevtn:=choose (0..maxDevtn); if actualDevtn=0 then shots+1 else call putt (actualDevtn, str, dex, chp, put, shots+1) function lagPutt (ft, put, shots) = chanceLag:=10+put; if d100<=chanceLag then shots+1 else call shortPutt (3, put, shots) function longPutt (ft, put, shots) = chanceLong:=25+put; if d100<=chanceLong then shots+1 else call shortPutt (2, put, shots) function midPutt (ft, put, shots) = chanceMid:=20+put; if d50<=chanceMid then shots+1 else call shortPutt (1, put, shots) function shortPutt (ft, put, shots) = chanceShort:=35+put; if d50<=chanceShort then shots+1 else shots+2">
Golf Hole using Troll - Par 4/5 Version
</option>
<option value="\ Golf Hole using Troll - Par 3 Version call iron (225, 10, 10, 10, 10, 0, 0) \ Note: The function call is at the top. These are the parameters: \ yds: The number of yards in the hole. \ str: Strength is used to determine driving and layup distance. \ dex: Dexterity is used to determine driving accuracy. \ chp: Chipping ability is used to determine chipping accuracy. \ put: Putting ability is used to determine putting accuracy. \ shots: Leave this at 0 in the function call. \ pen: Leave this at 0 in the function call. \ The parameters are ordered (yds, str, dex, chp, put, shots, pen). \ Don't mess with anything below the function call or these instructions. \ The output is the number of shots it takes to complete the hole. \ This roll is only intended for par 3's. For longer holes, use the Par 4/5 Version. function iron (yds, str, dex, chp, put, shots, pen) = thresh:=120 + (6*str); maxDev:=((30+pen-dex)*yds)/100; actualDev:=choose (0..maxDev); if yds>thresh then call layup (yds, str, dex, chp, put, shots) else if actualDev>30 then call iron (actualDev, str, dex, chp, put, shots+1, 0) else if actualDev>14 then call chip (actualDev*3, str, dex, chp, put, shots+1) else call putt (actualDev*3, str, dex, chp, put, shots+1) function layup (yds, str, dex, chp, put, shots) = minDistn:=100 + (6*str); maxDistn:=140 + (7*str); actualDistn:=choose (minDistn..maxDistn); accuRoll:=d20+dex; newYdg:=yds-actualDistn; if newYdg>30 then call iron (newYdg, str, dex, chp, put, shots+1, 0) else if newYdg<-30 then call iron (-1*newYdg, str, dex, chp, put, shots+1, 0) else if newYdg<-14 then call chip (-3*newYdg, str, dex, chp, put, shots+1) else if newYdg<0 then call putt (-3*newYdg, str, dex, chp, put, shots+1) else if newYdg<=14 then call putt (newYdg*3, str, dex, chp, put, shots+1) else call chip (newYdg*3, str, dex, chp, put, shots+1) function chip (ft, str, dex, chp, put, shots) = maxDevn:=((30-chp)*ft)/100; actualDevn:=choose (0..maxDevn); if actualDevn=0 then shots+1 else call putt (actualDevn, str, dex, chp, put, shots+1) function putt (ft, str, dex, chp, put, shots) = if ft>=25 then call lagOnly (ft, str, dex, chp, put, shots) else if ft>=15 then call lagPutt (ft, put, shots) else if ft>=8 then call longPutt (ft, put, shots) else if ft>=4 then call midPutt (ft, put, shots) else if ft>=1 then call shortPutt (ft, put, shots) else shots function lagOnly (ft, str, dex, chp, put, shots) = maxDevtn:=((25-put)*ft)/100; actualDevtn:=choose (0..maxDevtn); if actualDevtn=0 then shots+1 else call putt (actualDevtn, str, dex, chp, put, shots+1) function lagPutt (ft, put, shots) = chanceLag:=10+put; if d100<=chanceLag then shots+1 else call shortPutt (3, put, shots) function longPutt (ft, put, shots) = chanceLong:=25+put; if d100<=chanceLong then shots+1 else call shortPutt (2, put, shots) function midPutt (ft, put, shots) = chanceMid:=20+put; if d50<=chanceMid then shots+1 else call shortPutt (1, put, shots) function shortPutt (ft, put, shots) = chanceShort:=35+put; if d50<=chanceShort then shots+1 else shots+2">
Golf Hole using Troll - Par 3 Version
</option>
<option value="\ 4x4 Matrix 4'(sum 3d6 ||" ") || 4'(sum 3d6 ||" ") || 4'(sum 3d6 ||" ") || 4'(sum 3d6 ||" ")">
4x4 Matrix
</option>
<option value="\ BATS - Foci Roll \ wyrdR 2014.09.12 \ May time out with large values of F, Fac or Dom \ Try reducing Iteration bound or using offline version if timeouts occur \---------------------------------- Online Variables Only \ Comment these out for Offline Version R:=1; \1 - See Successes Only, 0 - See all dice rolls and notes [Make random rolls.] only Fac:=3; \ FACET Dom:=3; \ DOMAIN Foci:={3,3,3,3,1}; \ Modified below in Offline Version \---------------------------------- Offline Variation \\ Foci applied - e.g. If 6, 2, 1 then type 060201 \\ e.g. For the Foci 12,2,3 use \\ F=120203 on the command line \\ Uncomment the line below \Foci:=F>0 & call split(F,2); \---------------------------------- End Offline Variables N:=Fac + Dom; \ Number of Dice \ Empty Unused Variabvles F:={}; Fac:={}; Dom:={}; Fmax:=max(Foci); A:=N#(accumulate x:=d6 keep (6 U {0..Fmax}) while 6=x); \ Main Roll Ax:=A keep 6; FU:={}; FUx:={}; \ Comment following to exclude optional negatives \FU:=if (count Ax)=0 then 3#(accumulate v:=d6 keep (6 U {0..Fmax}) while 6=v) else {}; \Fumble? \FUx:=FU keep 6; Marks:={}; AFU:=(A U FU) drop 6; Marks:=Foci & AFU & call BATS(AFU,Foci); \ ^ denotes Exertion if R=1 then (count(Marks) + count Ax -count FUx) else '(count Marks + count Ax - count FUx)||": "||(((count Ax)+(count FUx)) >=3 & "^")||'A||(FU&("{ "||'FU||"}")) || (Marks &(" | M [ "||'count Marks||"]")) function BATS(AA,F)= Me:={}; Fe:=max F; Me:=AA & max (Fe>=AA); Ff:=F--Fe; Ab:=Ff & (AA--Me); Me U Ff & Ab & call BATS(Ab,Ff) \---------------------------------- Functions for Offline Version Only \ Function too demanding for online version \ Split Digits to Sets ----------------------------------------------- \ Convert form XYZ into {X,Y,Z} \ Numbers must not be greater than 10 \ To allow 2 digit number, t=2, for 3 digits t=3 etc \ 2 digits enough for simulation but left here for re-use in other functions function split(x,t)= Base:=call power(10,t); if x>Base then {call split(x mod Base,t), call split(x/Base,t)} drop 0 else {(x/5)#{5}, (x mod 5)} drop 0 \ Raise X to the power of Y ------------------------------------------ \ i.e. X^Y function power(X,Y)= pwr:=if ((X=0) U (Y<0)) then 0 else if (Y=0) then 1 else X; if (pwr=X & Y>1) then pwr*(call power(pwr,Y-1)) else pwr ">
BATS - Foci Roll
</option>
<option value="\ King Of Tokyo dice! \KING OF TOKYO DICE \ See what's the probability to get how many "Energy", "Claw", "Heart" and "VP" faces \ I would like to have it calculate the actual final VP also... \ I'm @tizcon on Twitter \PREMISE: you are rolling from the first roll with the precise intent to maximize a given face count (you don't change strategy between rolls) \COOL: you have only 49,98% chance to get at least 3 faces of the same type T := 1; \ target face, since all faces are represented only once on the die, we can just target a "1" on a die with just one "1" and five "0" N := 6; \ dice pool size, modify if you have special bonus FirstRoll := count T = N # choose{1,0,0,0,0,0}; SecondRoll := count T = (N - FirstRoll) # choose{1,0,0,0,0,0}; ThirdRoll := count T = (N - FirstRoll - SecondRoll) # choose{1,0,0,0,0,0}; FirstRoll + SecondRoll + ThirdRoll ">
King Of Tokyo dice!
</option>
<option value="\ X to the Power Y \ wyrdR 2015.10.06 function power(X,Y)= \ X to the Power Y \ i.e. X^Y pwr:=if ((X=0) U (Y<0)) then 0 else if (Y=0) then 1 else X; if (pwr=X & Y>1) then pwr*(call power(pwr,Y-1)) else pwr function root(x,n)= \ Get the nth root of x (rounded down) \ Returned in the form [root, remainder] \ where remainder will be 0 if it is an integer root 	if x=0 then 	 [0,0] 	else 	 if x>0 @ (n mod 2)=1 then 	 call rootu(1,x,n) 	 else 	 [{},{}] 	 function rootu(i,s,t)= v:=if s<0 then -1 else 1; 	if t=0 then [{},{}] else 	 if t=1 then [s,0] else 	 if (call power(i+1,t)) > (v*s) then 	 [v*i,v*(v*s-(call power(i,t)))] else call rootu(i+1,s,t) P:=d100 - d100; N:=(d10); Q:=call root(P,N); if (%2 Q) then if (%2 Q)=0 then P||"^ <sup>1/"||N||"</sup> is "||%1 Q||" exactly" else P||"^ <sup>1/"||N||"</sup> is between "||%1 Q||"to "||(%1 Q)+if (%1 Q)>0 then 1 else -1 else P||"^ <sup>1/"||N||"</sup>: <b>ERROR</b>"">
X to the Power Y
</option>
<option value="\ Assign a pool of d4's call assign (0, 0, 0, 0, 18) function assign (a, b, c, g, dc) = hw:=d4; if dc=0 then 'a |>'b|>'c|>'g else if hw=1 then call assign (a+1, b, c, g, dc-1) else if hw=2 then call assign (a, b+1, c, g, dc-1) else if hw=4 then call assign (a, b, c, g+1, dc-1) else call assign (a, b, c+1, g, dc-1)">
Assign a pool of d4's
</option>
<option value="\ WoDu healing roll, keep current HP HP:=11; HD:=5; Level:=2; max{max {sum largest Level HD d6, HP}-HP, 0} ">
WoDu healing roll, keep current HP
</option>
<option value="\ plop? 1d6">
plop?
</option>
<option value="\ Shadowrun 5 with glitches and opt. rule of 6 pool:= 6 ; \ set this to your dice pool size edgeUse:= 0 ; \ set to >0: reroll sixes and add this value to pool. Set to -1: reroll any non-hits once. Set to 0: not using edge showGlitches:= 1 ; \ set to 1: show glitches. Any other value: omit glitches \--- user input end --- pool:=if edgeUse > 0 then pool+edgeUse else pool; sixes:=count 5<pool#(d6); fives:=count 4<(pool-sixes)#(d5); ones:=count 1=(pool-sixes-fives)#(d4); edgeHits:= if edgeUse > 0 then count 4<(sixes)#(accumulate x:=d6 while x=6) else if edgeUse = -1 then count4<(pool-sixes-fives)#(d6) else 0; hits:=sixes+fives+edgeHits; hitsText:=if hits < 10 then " "||hits else ""||hits; result:= if showGlitches=1 then if ones > (pool/2) then if hits = 0 then hitsText||"hits (critical glitch)" else hitsText||"hits (glitch)" else hitsText||"hits" else hitsText||"hits"; result">
Shadowrun 5 with glitches and opt. rule of 6
</option>
<option value="\ Opposed Pool Probabilities for The Queen's Cavaliers \ \ By Caoimhe Ora Snow ([email protected]) \ http://queenscavaliers.com/ \ \ This calculates the chance of success with opposing dice pools. \ For example, if you are rolling 2d10+1d8+1d6 keep the highest 2 \ (not uncommon in The Queen's Cavaliers) versus a standard difficulty \ of moderate (3d8 keep 2 highest), what are your chances of success? \ \ The answer can be found by subtracting one pool's result from the other. \ If the result is positive, the acting party succeeds; if the result is \ negative, the opposing party succeeds. A result of zero means a tie \ between the two pools, and thus it's up to the rule system to define \ if that means tie goes to the acting party or the opposing party. You \ can read the "% >" column to determine what the exact percentage is. \ \ As it turns out, the answer to question is that 2d10+1d8+1d6 vs 3d8 \ has a 64.7% chance of going to the acting party, another 8.1% chance \ of a tie, and a 27.2% of the acting party losing to the standard \ opposition. If the roll were instead hard (3d10), the odds would be \ almost exactly even. Try it out! \ *********************************************************************** \ Set the acting party here Ax:=0; \ Change to # of d4s in acting pool Bx:=1; \ Change to # of d6s in acting pool Cx:=1; \ Change to # of d8s in acting pool Ex:=2; \ Change to # of d10s in acting pool Fx:=0; \ Change to # of d12s in acting pool \ *********************************************************************** \ Set the opposing party here. In TQC, standard oppostion is easy (3d6), \ moderate (3d8), hard (3d10) or very difficult (3d12). \ Ay:=0; \ Change to # of d4s in opposing pool By:=0; \ Change to # of d6s in opposing pool Cy:=3; \ Change to # of d8s in opposing pool Ey:=0; \ Change to # of d10s in opposing pool Fy:=0; \ Change to # of d12s in opposing pool \ *********************************************************************** \ Don't change anything below this line. This is where the magic happens. \ *********************************************************************** sum(largest 2 { Ax d4, Bx d6, Cx d8, Ex d10, Fx d12} ) - sum(largest 2 { Ay d4, By d6, Cy d8, Ey d10, Fy d12} )">
Opposed Pool Probabilities for The Queen's Cavaliers
</option>
<option value="\ Opposed d12 system dice := d12-d12; skill := 0; a := dice + skill*3; \ The character at the start is to keep the display in (alphabetic) order if a<-40 then "a -6 Total failure" else if a<-30 then "b -5 Catastrophic failure" else if a<-20 then "c -4 Crushing failure" else if a<-10 then "d -3 Grave failure" else if a<-5 then "e -2 Light failure" else if a<0 then "f -1 Close failure" else if a<3 then "g 0 Tie" else if a<6 then "h +1 Near success" else if a<11 then "i +2 Minor success" else if a<21 then "j +3 Major success" else if a<31 then "k +4 Greater success" else if a<41 then "l +5 Critical success" else "m +6 Absolute success"">
Opposed d12 system
</option>
<option value="\ Opposed d12 system (numeric only) dice := d12-d12; skill := 0; a := dice + skill*3; if a<-40 then -6 else if a<-30 then -5 else if a<-20 then -4 else if a<-10 then -3 else if a<-5 then -2 else if a<0 then -1 else if a<3 then 0 else if a<6 then 1 else if a<11 then 2 else if a<21 then 3 else if a<31 then 4 else if a<41 then 5 else 6">
Opposed d12 system (numeric only)
</option>
<option value="\ Median d6 - FUDGE/Fate dice alternative \ Roll 3d6 and keep the medium one \ This is for opposed rolls, with a table of results based on Fate and extended \ Keep in mind that the medium value is 3.5 instead of 0 if you are using passive opposition dice := median 3d6 - median 3d6; \ Replace the second dice roll by a number \ for passive opposition skill := 0; \ Change to indicate the difference in skills between the opponents a := dice + skill; \ a || " " || \ Uncomment the above to see the result of the dice \ prevents the result to be shown in the right order \ The character at the start is to keep the display in (alphabetic) order if a<-15 then "a -6 Total failure" else if a<-12 then "b -5 Catastrophic failure" else if a<-9 then "c -4 Crushing failure" else if a<-6 then "d -3 Grave failure" else if a<-3 then "e -2 Clear failure" else if a<0 then "f -1 Failure" else if a=0 then "g 0 Tie" else if a<4 then "h +1 Success" else if a<7 then "i +2 Success with Style" else if a<10 then "j +3 Major success" else if a<13 then "k +5 Greater success" else if a<16 then "l +5 Critical success" else "m +6 Absolute success"">
Median d6 - FUDGE/Fate dice alternative
</option>
<option value="\ Median d6 (numeric only) dice := median 3d6 - median 3d6; skill := 0; a := dice + skill; if a<-15 then -6 else if a<-12 then -5 else if a<-9 then -4 else if a<-6 then -3 else if a<-3 then -2 else if a<0 then -1 else if a=0 then 0 else if a<4 then 1 else if a<7 then 2 else if a<10 then 3 else if a<13 then 4 else if a<16 then 5 else 6">
Median d6 (numeric only)
</option>
<option value="\ Median d6 : probabilities of doubles dice := {d6, d6, d6}; \ Uncomment to see results only for one particular dice result \ and change the variable 'result' accordingly \ result := 1; \ dice := (repeat x:={d6, d6, d6} until (median x) = result); low:=min(dice); med:=median(dice); high:=max(dice); \ med || " :" || \ Uncomment to see probabilities for each result if (low=high) then "d: triple" else if (low=med) then "b: low = med" else if (med=high) then "c: med = high" else "a: no double"">
Median d6 : probabilities of doubles
</option>
<option value="\ 2d6, max - min a:={d6,d6}; max a - min a">
2d6, max - min
</option>
<option value="\ 2d8, max - min a:={d8,d8}; max a - min a">
2d8, max - min
</option>
<option value="\ D&D 5e Great Weapon Fighting \ Rerolls die once if less than rerollBelow value and must take second result (even if worse). Configurable options below. Default is 2d6 weapon (ie: Greatsword) with 2d8 bonus damage (ie: Divine Smite). weaponDie := 6; weaponDiceCount := 2; \ Bonus damage (ie: divine smite). Set bonusDiceCount to 0 for no bonus. bonusDie := 8; bonusDiceCount := 2; \ Set rerollBelow to high value (ie: 999) to disable reroll (for comparison, etc) rerollBelow := 3; \ Min roll to qualify as critical attack roll (roll double # of dice) minCrit := 20; sum( attack := d20; critRollMultiplier := if attack >= minCrit then 2 else 1; (weaponDiceCount*critRollMultiplier)#( wr := d weaponDie; if wr < rerollBelow then d weaponDie else wr ) U (bonusDiceCount*critRollMultiplier)#( br := d bonusDie; if br < rerollBelow then d bonusDie else br ) )">
D&D 5e Great Weapon Fighting
</option>
<option value="\ Here I Stand, Diet of Worms, rolling N d6 needing 5+ N:=3; \ Change N to alter the number of dice S:=4; \ Change S to alter the target number to beat count S< N#(accumulate x:=d6 while x=6)">
Here I Stand, Diet of Worms, rolling N d6 needing 5+
</option>
<option value="\ Ars Magica Quality Roll function quality(x) = if x=1 then 2 * call quality(z9) else x call quality(z9) ">
Ars Magica Quality Roll
</option>
<option value="\ Burning Wheel open-ended roll \ Burning Wheel Open-Ended Roll with N dice N:=1; \ Change N to alter the number of dice count 3< N#(accumulate x:=d6 while x=6)">
Burning Wheel open-ended roll
</option>
<option value="\ The Glorious Bell Curve \ wyrdR 20141024 \ A bell curve extending to infinity in both directions \ with the median set to a known value \ Median value; \ Change to skew to a greater or lesser amount Med:=3; \ Roll 6 six sided dice Rl:=6d6; \ If there are 3+ sixes reduce the result \ If there are 3+ ones increase the result Rf:=if ({6,6,6} -- Rl) then ( if ({1,1,1} -- Rl) then 0 \ Normal else 1 \ 3+ ones ) else -1 \ 3+ sixes ; if Rf then count (Med>=Rl) + (Rf*count(accumulate x:=d6 while x=6)) \ Exploding dice else count (Med>=Rl) \ Normal result ">
The Glorious Bell Curve
</option>
<option value="\ Sort Descending \ Sort Descending \ wyrdR 2014.10.26 \ Sort a collection of numbers in Descending order \ N.B. Converts to a String so no longer useful in calculations function desc(X)= \Sort Descending Xmax:=max X; Xrem:=X drop Xmax; 'Xmax & X keep Xmax || Xrem & call desc(Xrem) \ Test call desc(6d6)">
Sort Descending
</option>
<option value="\ Poker Dice \ wyrdR 2015.08.21 \ http://en.wikipedia.org/wiki/Poker_dice ShowHand:=1; \ 0: Show Rank Only \ 1: Show Rank & Full Hand \ 2: Show Rank Code and Highest of Winning Rank Only IgnoreStraight:=0; \ Some versions acknowledge Straights \ 0: Straights are OK \ 1: No Straights please Y:=5d6; M:=foreach X in Y do X + 10*count(Y keep X); Mx:=max M; Mxx:=max (M drop Mx); \ Check for later Pair Ys:=({1..6} -- Y); \ Check for Straight Mc:= if (Mx/10)=2 then ( 	if (Mxx/10)=2 then 200 	else 100 ) else ( 	if (Mx/10)=3 & (Mxx/10)=1 then 300 \ Three of Kind 	else ( 		if (Mx/10)=4 then 600 \ Four of Kind 		else ( 			if (Mx/10)=3 & (Mxx/10)>=2 then 500 \ Full House 			else ( 				if (count Ys)=1 then \ No Repeats 				( 				if (IgnoreStraight<1) & ((count(Ys keep {1,6}))=1) then 400 \ Straight 				else 0 \ Bust 				) 				else ( 				if (Mx/10)>=5 then 700 \ Five of a Kind 				else 0 \ Bust 				) 			) 		) 	) ) ; Mct:= if Mc=100 then "One Pair" else 	if Mc=200 then "Two Pair" else 		if Mc=300 then "Three of a Kind" else 			if Mc=400 then "Straight" else 				if Mc=500 then "Full House" else 					if Mc=600 then "Four of a Kind" else 						if Mc=700 then "Five of a Kind" else 							"Bust" ; Mcc:=if IgnoreStraight=1 & Mc>300 then Mc-100 else Mc; if ShowHand=1 then "<noscript>" || Mcc / 100 || "</noscript>"||"<em><small><small>"|| Mct || "</small></small></em><br>" || "<big><big>"||'call PokerRank(M) ||"</big></big>" else if ShowHand=2 then Mcc + Mx else Mcc / 100 || "<em><small><small>" || Mct || "</small></small></em>" \ Sort Descending \ Sort a collection of numbers in Descending order \ N.B. Converts to a String so no longer useful in calculations function PokerRank(X)= \Sort Descending Xmax:=max X; Xrem:=X drop Xmax; Xmax & call RealDice(foreach W in (X keep Xmax) do W mod 10) || Xrem & (" " || 'call PokerRank(Xrem)) \ RealDice \ wyrdR 2014.10.30 function RealDice(R)= \ &#9856; &#9857; &#9858; &#9859; &#9860; &#9861; X:=choose R; Dice:= 	if X=1 then "<font class=1 color=black>&#9856;</font>" else 	if X=2 then "<font class=2 color=red>&#9857;</font>" else 	if X=3 then "<font class=3 color=green>&#9858;</font>" else 	if X=4 then "<font class=4 color=green>&#9859;</font>" else 	if X=5 then "<font class=5 color=red>&#9860;</font>" else 	if X=6 then "<font class=6 color=black>&#9861;</font>" else {} ; Ra:=R--X; Dice || Ra & call RealDice(Ra) ">
Poker Dice
</option>
<option value="\ Power Dice \ wyrdR 2014.12.10 beta 4.0 \\ Specified Foci Foci:={1,2,3}; \ Randomised Foci for demo purposes [too slow for probabilities] \ Foci:=5z6; \---------------------------------- Online Variables Only \ Comment these out for Offline Version Simple:=1; \ 0 - Show Dice Rolls and notes [ May Break Calculate probabilities function ] \ 1 - Hide Dice Rolls and Notes [ Simplified for Calculate probabilities function ] Drop:=1; \ 0 - Ignore Dropped Dice; \ 1 - Include Dropped Dice; \---------------------------------- Offline Variation \\ Foci applied - e.g. If 6, 2, 1 then type 060201 \\ e.g. For the Foci 12,2,3 use \\ F=120203 on the command line \\ Uncomment the line below \Foci:=F>0 & call split(F,2); \---------------------------------- End Offline Variables \ Empty Unused Variables F:={}; FaDo:=5; \ FACET + DOMAIN A:=FaDo#d6; \ Main Roll [Constant] Red:="<font color=red>"; xF:="</font>"; Marks:={}; Marks:=call STAB(A,Foci); Pk:=call Poker(Marks,0); Pa:=count(A keep 6); \\ RESULTS \\ A||"<br>"||Marks||"<hr>"||Pa+Pk||"<hr><table><tr><td>Raw</td><td>" || Pa || "</td></tr><tr><td>Focused</td><td>" || Pk||"</td></tr></table>" Result:=Pa+Pk; if (Result<FaDo) then if Result=0 & Pa=0 then -(count(d6 keep 6)) else Result else if Pa=FaDo then 0 else Result + count((accumulate x:=d6 while (x keep 6)) keep 6) \\ End Main function STAB(AA,F)= Me:={}; \ Keep largest less than or equal to max F Fe:=max F; \ Keep the largest of AA less than or equal to Fe Me:=max(Fe>=AA); \ The remaining F after removing Fe Ff:=F--Fe; \ The remaining AA after removing all Me or greater Ab:=Ff & Me & (Me>AA); \ Keep any in AA matching Me \ plus keep any after repeating with Ab and Ff \ (AA keep {Me}) U Ff & Ab & call STAB(Ab,Ff) ((AA keep {Me})) U Ff & Ab & call STAB(Ab,Ff) function split(x,t)= \---------------------------------- For Offline Version Only \ Function too demanding for online version \ Split Digits to Sets ----------------------------------------------- \ Convert form XYZ into {X,Y,Z} \ Numbers must not be greater than 10 \ To allow 2 digit number, t=2, for 3 digits t=3 etc \ 2 digits enough for simulation but left here for re-use in other functions Base:=call power(10,t); if x>Base then {call split(x mod Base,t), call split(x/Base,t)} drop 0 else {(x/5)#{5}, (x mod 5)} drop 0 function power(X,Y)= \ Raise X to the power of Y ------------------------------------------ \ Required by Split Function \ i.e. X^Y pwr:=if ((X=0) U (Y<0)) then 0 else if (Y=0) then 1 else X; if (pwr=X & Y>1) then pwr*(call power(pwr,Y-1)) else pwr \ Work out Poker Dice ------------------------------------------ function Poker(Y,ShowHand)= 	if Y then \ Some dice remain 		 M:=foreach X in Y do X+10*count(Y keep X); 		 Mx:=max M; 		 \Mxx:=(max (M drop Mx))/10; \ Check for later Pair Mx/10 else 0 \ RealDice \ wyrdR 2014.10.30 function RealDice(R)= \ &#9856; &#9857; &#9858; &#9859; &#9860; &#9861; 	R & ( 	X:=choose R; 	Dice:= 		if X=1 then "&#9856;" else 		if X=2 then "&#9857;" else 		if X=3 then "&#9858;" else 		if X=4 then "&#9859;" else 		if X=5 then "&#9860;" else 		if X=6 then "&#9861;" else {} 	; 	Ra:=R--X; 	"<font size=7>"|| Dice || "</font>" || Ra & call RealDice(Ra) 	) ">
Power Dice
</option>
<option value="\ Sort Descending \ wyrdR 2014.10.26 \ Sort a collection of numbers in Descending order \ N.B. Converts to a String so no longer useful in calculations function desc(X)= \Sort Descending Xmax:=max X; Xrem:=X drop Xmax; 'Xmax & X keep Xmax || Xrem & call desc(Xrem) \ Test call desc(6d6)">
Sort Descending
</option>
<option value="\ Encounters (Major / Minor) per 25-mile hex water := 1d100; wM := 1d6; swamp := 1d100; sM := {1d6, 1d6}; desert := 1d100; dM := {1d6, 1d6}; plains := 1d100; pM := {1d6, 1d6, 1d6, 1d6, 1d6, 1d6}; forest := 1d100; fM := {1d6, 1d6, 1d6, 1d6}; hills := 1d100; hM := {1d6, 1d6, 1d6, 1d6}; mountains := 1d100; mM := {1d6, 1d6}; ("Water: " || count 11> water || "Minor: " || count 2> wM) |> ("Swamp: " || count 21> swamp || "Minor: " || count 2> sM) |> ("Desert: " || count 21> desert || "Minor: " || count 2> dM) |> ("Plains: " || count 61> plains || "Minor: " || count 2> pM) |> ("Forest: " || count 41> forest || "Minor: " || count 2> fM) |> ("Hills: " || count 41> hills || "Minor: " || count 2> hM) |> ("Mountains: " || count 21> mountains || "Minor: " || count 2> mM)">
Encounters (Major / Minor) per 25-mile hex
</option>
<option value="\ FUDGE/FATE roll with 3d6 (drop medium) -7 a := 3d6; sum (max a) + (min a) - 7">
FUDGE/FATE roll with 3d6 (drop medium) -7
</option>
<option value="\ RealDice \ wyrdR 2017.09.17 \ Function you can re-use Roll:=d10#d6; "<div style='font-size:320%;x-width:3.5ex;word-break: break-all;text-align:center;'>"||call RealDice(Roll)||"</div>" function RealDice(R)= \ &#9856; &#9857; &#9858; &#9859; &#9860; &#9861; starting at U2680 or Dec 9856 X:=R&min R; Xs:=X&X+9855; Xs:="&#"||Xs||";"; H:=6*z60; S:=50+10*z5; L:=z50; A:=20+z80; Tx:=( X keep {1..6})&"<span class='d-"||X||"'>"|| Xs ||"</span>"; Dice:=if X keep {1..6} then 'Tx else {}; Ra:=R--X; Dice||(Ra & call RealDice(Ra)) ">
RealDice
</option>
<option value="\ QUANTUM Board Game - Ships Combat \\ Modify attack and defense dice values below (you may also put "d6" for both value and see stats for all combinations) ATTACK := 3; DEFENSE := 4; \ For all combinations \ATTACK := d6; \DEFENSE := d6; \\ These are the rolls you make for the combat ATTACKROLL := d6; DEFENSEROLL := d6; \\ WIN = 1 attacker wins, WIN = 0 attacker loses WIN := count 0 >= ((ATTACK + ATTACKROLL) - (DEFENSE + DEFENSEROLL)); "ATTACK: " || 'ATTACK||", DEFENSE: " || 'DEFENSE || "= WIN " || 'WIN \\ I'm a wannabe game designer, follow me @tizcon :D">
QUANTUM Board Game - Ships Combat
</option>
<option value="\ Poker Cards \ wyrdR 2015.01.16 beta8.2 \ Start of Main Players:=4; \ Number of players incJokers:=2; \ Include 1 or 2 jokers? 1,2: Yes; 0: No. \\ TO DO \ JokersWild:=1; \ 1: Jokers are treated as Fully Wild, \ 0: Jokers are Bugs Rank:={0..12}; Suite:={1..4}; Jokers:={5,6}; Diamonds:=foreach R in Rank do R*10+4; Clubs:=foreach R in Rank do R*10+3; Spades:=foreach R in Rank do R*10+2; Hearts:=foreach R in Rank do R*10+1; Deck:=least incJokers Jokers@Spades@Hearts@Diamonds@Clubs; Deal:=Deck pick (5*Players); call GetHands(Deal) \ \ End of Main \ function GetHands(Deal)= 	Hand:=Deal pick 5; 	Deal:=Deal -- Hand; 	Split:="<hr>"; 	SF:=call isStraight(Hand); 	FL:=call isFlush(Hand); 	Kd:=call isKind(Hand); 	SFx:=max(SF); 	FLx:=max(FL); 	Kdx:=max(Kd); 	draw:=if (SFx>FLx) & (SFx>Kdx) then SF else if FLx>Kdx then FL else Kd; 	\ Result 	"<font size=4>"||call GetCards(draw) ||"</font>" || ("<font size=0><br>"|| call GetRankName(draw) || "</font>") || Deal & (Split|| call GetHands(Deal)) \GetHands function GetCards(H)= H & (	 		\Qx:=foreach T in H do ((T/1000) keep (max H)/1000) & T; \ Keep the highest ranking 		BustStraightFlush:={0,4,5,6,9}; 		Hxt:=(max H)/1000; 		Hx:=if Hxt keep BustStraightFlush then min(H) else max(H); 		Hrx:=(Hx/10) mod 100; 		Hrx:=if Hrx<0 then Hrx*Hrx/Hrx else Hrx; \ Absolute Value 		Hsx:=Hx mod 10; 		Hsx:=if Hsx<0 then Hsx*Hsx/Hsx else Hsx; \ Absolute Value 		Hrem:=H--Hx; 		Hxx:=min (Hrem); 		Hrxx:=Hxx/10; 		Hsxx:=Hxx mod 10; 		Sc:= 			if Hsx=4 then "red" else 			if Hsx=3 then "black" else 			if Hsx=2 then "black" else 			if Hsx=1 then "red" else 			if Hsx=5 then "black" else 			if Hsx=6 then "red" else 			"lightgray" 		; 		St:= 			if Hsx=4 then "&#9830;" else 			if Hsx=3 then "&#9827;" else 			if Hsx=2 then "&#9824;" else if Hsx=1 then "&#9829;" else 			if Hsx=5 then "&#9787;" else 			if Hsx=6 then "&#9787;" else 			"?"; 		Rk:= 			if Hsx<5 then 				if Hrx=0 then "A" else 				if Hrx=1 then "K" else 				if Hrx=2 then "Q" else 				if Hrx=3 then "J" else 				if Hrx=4 then "10" else 				if Hrx=5 then "9" else 				if Hrx=6 then "8" else 				if Hrx=7 then "7" else 				if Hrx=8 then "6" else 				if Hrx=9 then "5" else 				if Hrx=10 then "4" else 				if Hrx=11 then "3" else 				if Hrx=12 then "2" else 				if Hrx=13 then "A" else 				" " 			else 				"?" 		; 			"<font color="||Sc||">"||Rk || "<big><sub>"||St ||"</sub></big></font>"||Hrem & call GetCards(Hrem) 	) 		 function GetRankName(H)= 	Quints:=10000; 	StraightFlush:=9000; 	Quads:=7000; 	Full:=6000; 	Flush:=5000; 	Straight:=4000; 	Trips:=3000; 	Twups:=2000; 	Pair:=1000; 	Bust:=0; 	 	BustStraightFlush:={0,4,5,6,9}; 	Hxt:=(max H)/1000; 	R:=if Hxt keep BustStraightFlush then min(H) else max(H); 	 	Q:=R mod 1000; 	Hlow:=foreach C in H do (10*(C/10))=/=(10*(R/10))&C; 	\Hnt:=R & if ((max Hlow)/1000) = 0 then R<H else R>H; 	Rn:=Hlow & if ((max Hlow)/1000) keep {0,5} then min Hlow else max Hlow; 	 	\Qn:=max(Hlow) mod 1000; 	\Rn:=min((500+(Qn*1000))>H); 	 	Qn:=Rn mod 1000; 	Rk:=call GetCardName(Q, 2); 	Rkn:=call GetCardName(Qn, 2); 	 	Rks:=if (Q/10)=8 then Rk||"es" else Rk||"s"; 	Rkns:=if (Qn/10)=8 then Rkn||"es" else Rkn||"s"; 	\\b:="<br>"; 	\\||b||Hlow||b|| 	\ Result	 	"<noscript>"||R||": </noscript>"||(if R>=Quints then "Five " || Rks else 	if R>=StraightFlush then Rk ||"-"||Rkn|| " <br>Straight Flush" else 	if R>=Quads then "Four " || Rks else 	if R>=Full then Rk||"s Full of " || Rkns else 	if R>=Flush then Rk ||"-"||Rkn|| " High <br>Flush" else 	if R>=Straight then Rk ||"-"||Rkn|| " <br>Straight" else 	if R>=Trips then "Three "||Rks else 	if R>=Twups then Rks ||" and "||Rkns else 	if (R>=Pair) & (R>Bust) then "A Pair of "||Rks else 	Rk||"-"||Rkn||" High") 	 function GetCardName(Cn,Ds)= 	Hrx:=(Cn mod 1000)/10; 	Hsx:=Cn mod 10; 	St:= 		if Hsx=4 then "Diamonds" else 		if Hsx=3 then "Clubs" else 		if Hsx=2 then "Spades" else 		if Hsx=1 then "Hearts" else 		if Hsx=5 then "Black Joker" else 		if Hsx=6 then "Red Joker" else 		" " ; 	Rk:= 			if Hrx=0 then "Ace" else 			if Hrx=1 then "King" else 			if Hrx=2 then "Queen" else 			if Hrx=3 then "Jack" else 			if Hrx=4 then "Ten" else 			if Hrx=5 then "Nine" else 			if Hrx=6 then "Eight" else 			if Hrx=7 then "Seven" else 			if Hrx=8 then "Six" else 			if Hrx=9 then "Five" else 			if Hrx=10 then "Four" else 			if Hrx=11 then "Three" else 			if Hrx=12 then "Two" else 			if Hrx=13 then "Ace" else 			"?" 		 ; 		if Ds=0 then 			if (Rk<14) then Rk ||" of "|| St 		else Rk 		else 			if Ds=1 then St else Rk 			 function isStraight(H)= 	\ Check for Straight 	\ Had it working then I broke it!!! 	Straight:=4000; Bust:=0; 	Hs:=H drop {5,6}; \Remove Jokers 	Hsj:=H keep {5,6}; \ Note Jokers 	Xg:=Hsj & call GetGaps(Hs); 	Xg:=Hsj & call EnumJoker(Xg,Hsj); 	Xn:=Xg @ Hs; 	Xnr:=foreach R in Xn do R/10; 	Hrc:=count (different Xnr); \Number of different ranks 	\Result 	Hrx:=max Xnr; 	Hrn:=min Xnr; 	Hrr:=Hrx-Hrn; 	Xt:= 		if Hrr=4 & Hrc=5 then 			Straight 		else 			Bust 	; 	Result:=foreach S in Xn do Xt+S; 	if Xt=Straight then 		call isFlush(Result) \ Check if Flush as well 	else 		Result function isFlush(H)= 	\ Check for Flush or Straight Flush 	Flush:=5000; 	Bust:=0; 		\ Hand with No Jokers 	Hnj:=H drop {5,6}; 		\ Hand with only Jokers 	Hj:=H keep {5,6}; 		\ Get Suites 	Hs:=foreach C in (H drop {5,6}) do C mod 10; 		\ Number of Suites 	Hsc:=count (different Hs); 	\ Get Best Rank for any jokers Jokers 	Xg:=Hj & call GetBest(H); 	Xg:=Hj & call EnumJoker(Xg,Hj); Xn:=(Xg @ Hnj); 	Xt:=if (Hsc=1) then Flush else Bust; 	\ Result 	foreach F in (Xn) do Xt+F function isKind(H)= 	\ Check for Pairs, Trips, Quads and Quints 		\Inverse Sort 	Hnj:=H drop {5,6}; \ Remove Jokers 	Hi:=foreach I in Hnj do 500-10*(I/10); 		\ Get Number of each Rank (inverse) 	Hr:=different(foreach S in Hi do ((1000*count(Hi keep S))+S)); 	Hrx:=max Hr; 	Hj:=H keep {5,6}; 	Hrj:=Hrx + 1000*(count Hj); \ Count Jokers with Best Card(s) 	Hrn:=max(Hr drop Hrx); 	Htx:=(Hrj/1000)+500-(Hrx mod 1000); 	Htn:=(Hrn/1000)+500-(Hrn mod 1000); 	Hkx:=call KindRank({Hrj,Hrn}); \call KindRank 	Hkn:=call KindRank(Hrn); \call KindRank 	Hsx:=10*((Htx mod 1000)/10); 	\ Search 	Hsn:=10*((Htn mod 1000)/10);	\ Search 	br:="<br>"; 	\Result 	\"Hsx:" ||Hsx || br ||"Hsn:" ||Hsn || br ||"Hkx:" ||Hkx || br ||"Hkn:" ||Hkn || br ||"Hr:" ||Hr || br ||"Result:"|| 	foreach V in H do ( 		if ((10*(V/10))=Hsx) @ (V keep {5,6}) then 			V + Hkx 		else 			if ((10*(V/10))=Hsn) then 				V + Hkn 			else 				V 	) 	\ Checks 	\"Hsx:" ||Hsx || br ||"Hsn:" ||Hsn || br ||"Hkx:" ||Hkx || br ||"Hkn:" ||Hkn || br ||"Hr:" ||Hr || br ||"Result:"|| 	\Hwx @ Hwn 	 function KindRank(Hg)= 	Quints:=10000; 	Quads:=7000; 	Full:=6000; 	Trips:=3000; 	Twups:=2000; 	Pair:=1000; 	Bust:=0; 	Hg:=foreach G in Hg do G/1000; 	\ Result 		if Hg keep {5} then 			Quints 			\ Five of a Kind 		else 		if Hg keep {4} then 			Quads 			\ Four of a Kind 		else 		if Hg keep {3} then 			if Hg keep {2} then 				Full 			\ Full House 			else 	Trips		\ Three of a Kind 		else 		if Hg keep {2} then 			if (Hg--{2}) keep {2} then 				Twups	 		\ Two Pair 			else Pair 			\ One Pair 		else 			 			Bust 				\ No Pair function GetGaps(H)= \ Fills in Gaps for Straights J:=H keep {5,6}; Jc:=count J; if J then ( 		H:=foreach R in (H drop {5,6}) do (R/10); 		Hn:=min H; 		Hx:=max H; 		Hh:=Hn+4; 		Hl:=Hx-4-(if Hh>13 then Hh-13-Jc else 0); \8 		Hhh:= 			(if Hh>13 then 13 else Hh) 			-(if Hl<0 then Hl+Jc else 0) 			+(if Hn<4 then Jc else 0) \13 		; 		Hll:= 			if Hhh<13 then 				(if Hl<0 then 0 else Hl) 			else 				Hhh-4 		; 		Ys:=least 5 {Hll..Hhh}; 		Yy:=Ys--H; 		foreach Q in Yy do Q*10 ) else {} function GetBest(H)= \ Fills in Gaps for Flush J:=H keep {5,6}; Jc:=count J; H:=foreach R in (H drop {5,6}) do (R/10); 	Hn:=min H; \10 Hx:=max H; \13 Ys:={0..Hx}; Yy:=least Jc {Ys--H}; foreach Q in Yy do Q*10 function EnumJoker(S,J)= 	Sn:=min S; 	Jn:=min J; 	Sr:=S--Sn; 	Jr:=J--Jn; 	Sn & Jn & (Sn + Jn) @ Sr & Jr & call EnumJoker(Sr,Jr)">
Poker Cards
</option>
<option value="\ Erste Grenze Poolsystem \ Erste Grenze \ Würfelpools AnzA := 6; AnzB := 5; \ Feste Werte für Poolwürfel, diese ergeben sich durch Vor- bzw. Nachteile \ Sie werden vor dem Würfeln aus dem Pool entfernt, da ihr Wert feststeht \ Vorteile 4-6, Nachteile 3-1, Bedingung: Anzahl <= Anzahl der Poolwürfel FesteWerteA := {6,1}; FesteWerteB := {}; \ Anhängen von 1en und Bestimmung der maximalen Würfelpoollänge a := {(AnzA - count(FesteWerteA)) d6,FesteWerteA,1}; b := {(AnzB - count(FesteWerteB)) d6,FesteWerteB,1}; laenge := max {count(a),count(b)} - 1; \ Einzelvergleich aller Paare bei absteigender Sortierung der Ergebnisse \ Bspw. Höchstes von a mit Höchstem vom b, Zweithöchstes von a mit Zweith... erg := foreach i in {1..laenge} do count((min largest i (a)) > (min largest i (b))) - count((min largest i (a)) < (min largest i (b))); sum erg">
Erste Grenze Poolsystem
</option>
<option value="\ Dark Heresy - 3d10 Tearing - Auto Fury sum (largest 3 { sum (accumulate x:=d10 while x=10), sum (accumulate y:=d10 while y=10), sum (accumulate y:=d10 while y=10), sum (accumulate y:=d10 while y=10), sum (accumulate y:=d10 while y=10), sum (accumulate y:=d10 while y=10) })">
Dark Heresy - 3d10 Tearing - Auto Fury
</option>
<option value="\ Dark Heresy - 4d10 - Auto Fury sum ( { sum (accumulate x:=d10 while x=10), sum (accumulate y:=d10 while y=10), sum (accumulate y:=d10 while y=10), sum (accumulate y:=d10 while y=10) })">
Dark Heresy - 4d10 - Auto Fury
</option>
<option value="\ d100 variation, opposed \\ "miss" : the attacker fails \\ "resist" : the attacker succeeds, but the defender resists \\ "hit" : the attacker succeeds, the defender fails to resist a:=5; \\ attacker skill (x10 to get the percentage to beat) b:=2; \\ defender skill \\ If you want a side to throw several dice and keep the better \\ then replace the 1 by the chosen number below rolla:=call diceroll(1,a); rollb:=call diceroll(1,b); (if (rolla>(a*10)) then "miss" else if (rollb>(b*10)) then "hit" else if (rolla>=rollb) then if (rollb<=b) then if (rolla<=a) then "hit" else "resist" else "hit" else if (rolla<=a) then if (rollb<=b) then if (rolla>rollb) then "hit" else "resist" else "hit" else "resist") || \\ Shows the criticals and fumbles \\ Replace (1=1) by (0=1) to hide then (or empty individual strings) if (1=1) then ( (if rolla>(90+a) then " att-fumble" else "") || (if rolla<=(a*10) then (if rollb>(90+b) then " def-fumble" else "") else "") || (if rolla<=a then " att-crit" else "") || (if rolla<=(a*10) then (if rollb<=b then " def-crit" else "") else "") ) else "" \\ This function allows to let one side throw several d100 \\ and keep the best one function diceroll (n, skill) = if (n<=1) then d100 else prev:=call diceroll(n-1, skill); next:=d100; if next>(skill*10) then if prev>(skill*10) then if prev<next then prev else next else prev else if next>skill then if prev>skill then if prev<next then next else prev else prev else if prev>skill then next else if prev<next then next else prev">
d100 variation, opposed
</option>
<option value="\ d100 variation \\ To succeed, the roll must equal or be under the target percentage \\ The target percentage is ten times the skill \\ (which can be modified by outside conditions) \\ For a critical success, the roll must be equal or under the skill \\ It is a fumble if the roll is over 90 + the skill a:=5; \\ skill (x10 to get the percentage to beat) \\ If you want a throw several dice and keep the better \\ then replace the 1 by the chosen number below rolla:=call diceroll(1,a); (if (rolla>(90+a))then "4. fumble" else if (rolla>(a*10)) then "3. miss" else if (rolla>a) then "2. success" else "1. critical success") \\ This function allows to throw several d100 \\ and keep the best one function diceroll (n, skill) = if (n<=1) then d100 else prev:=call diceroll(n-1, skill); next:=d100; if next>(skill*10) then if prev>(skill*10) then if prev<next then prev else next else prev else if next>skill then if prev>skill then if prev<next then next else prev else prev else if prev>skill then next else if prev<next then next else prev">
d100 variation
</option>
<option value="\ Fate/Fudge roll using Fate Tokens \ Probability for rolling Fate dice using Fate Tokens \ (pick 4 from 12 coins, with even distribution of the standard +,-,blank results) sum ({-1,-1,-1,-1,0,0,0,0,1,1,1,1} pick 4)">
Fate/Fudge roll using Fate Tokens
</option>
<option value="\ Shadowrun 5 - fun with spirits: mundane attack function simple(N)= count 4< N#(d6) function opposed(a,b)= max{0,call simple(a)-call simple(b)} mundaneAttack:=10; mundaneBaseDV:=10; mundaneArmorPiercing:=4; spiritForce:=4; spiritDefenseMod:=3; \\ spirit's defense is this + (spiritForce*2) spiritDamageReduction:=-2; \\spirit's damage reduction is this + (spiritForce*2) \\\ calculations spiritHardenedArmor:=spiritForce*2; spiritHardenedArmorAutoHits:=(spiritHardenedArmor-mundaneArmorPiercing)/2; spiritDefense:=(spiritForce*2)+spiritDefenseMod; spiritDamageReduction:=(spiritForce*2)+spiritDamageReduction+max{spiritHardenedArmor-mundaneArmorPiercing,0}; mundaneAttackHits:=max{call opposed(mundaneAttack,spiritDefense),0}; totalDV:=if mundaneAttackHits > 0 then mundaneBaseDV+mundaneAttackHits else 0; damage:=if totalDV < spiritHardenedArmor then 0 else totalDV-call simple(spiritDamageReduction)-spiritHardenedArmorAutoHits; max{damage,0}">
Shadowrun 5 - fun with spirits: mundane attack
</option>
<option value="\ Shadowrun 5 - fun with spirits: summoning function simple(N)= count 4< N#(d6) function opposed(a,b)= max{0,call simple(a)-call simple(b)} summonerSummoning:=10; summonerDrainReduction:=10; summonerMagic:=6; spiritForce:=6; \\\ calculations hitsSummoner:=call simple(summonerSummoning); hitsSpirit:=call simple(spiritForce); netHits:=max{hitsSummoner-hitsSpirit,0}; drain:=max{0,hitsSpirit*2 - call simple(summonerDrainReduction)}; drain:=if drain < 10 then "0"||drain else "" || drain; drain || if (hitsSpirit*2)>summonerMagic then "P" else "S"">
Shadowrun 5 - fun with spirits: summoning
</option>
<option value="\ Shadowrun 5 - fun with edge N:=8; E:=6; result:=call rollEdgeAdd(N,E) - call rollEdgeRe(N); if result < 0 then "Rerolling non-hits wins" else if result > 0 then "Adding edge wins" else "zzz draw" function roll(n)= count 4<(n)#(d6) function rollEdgeAdd(n,e)= count 4<(n+e)#(accumulate x:=d6 while x=6) function rollEdgeRe(n)= result:=call roll(n); result+call roll(n-result)">
Shadowrun 5 - fun with edge
</option>
<option value="\ Warhammer 8th ed High Elf Book of Hoeth spellcasting \ Attempt to cast a spell with the Book of Hoeth magic option \ (Warhammer 8th edition High Elf army book) \ This item allows you to reroll one dice on your casting roll \ However, when rolling 2 or more sixes you end up with irresistible \ force (IF), which may or may not be desirable depending on the situation \ NOTE: subtract the level of your wizard from the target number when you \ enter it as a parameter call cast(4, 13, 0) function cast (dice, targetValue, wantIF) = result := dice # d6; \ We want to reroll a dice if we don't meet the casting roll failedCast := if targetValue > sum(result) then 1 else 0; \ We want to reroll a dice if \ (a) you don't risk casting failure if your reroll is a 1 \ (b) your smallest roll is < 4, so your average result increases \ (c) you don't have a 6 (no increased IF risk), or you actively want IF noFailRisk := if targetValue <= (sum(largest (dice-1) result) + 1) then 1 else 0; avgImproved := if 4 > least 1 result then 1 else 0; noIFRisk := if 6 > largest 1 result then 1 else 0; \ Use addition/multiplication to implement and/or conditions described above wantReroll := failedCast + (noFailRisk * avgImproved * (noIFRisk + wantIF)); \ Reroll the lowest dice if we want to: result := if wantReroll > 0 then largest (dice-1) result U 1d6 else result; \ Output 99 if irresistible force, casting value if success, 0 if failure if 2 <= count (6 = result) then 99 else if targetValue <= sum(result) then sum(result) else 0">
Warhammer 8th ed High Elf Book of Hoeth spellcasting
</option>
<option value="\ Rated Roll: smooth zero-to-infinity with specified average R := 20; \ "Rating." Requires R > 0. \ The mean and median equal exactly R. This is not an approximation! \ The mode is a tie between R - 1 and R - 2, or 0 when R = 1. \ This is simply Rd2 using exploding dice numbered 0,1. sum R#(accumulate x:=z1 while x = 1) \ Note that the underlying principle extends to any exploding die numbered \ from 0. A die of N sides counts for (N/2) rating, e.g. a d10 is rating 5. \ This affects distribution and mode/median, but not the mean average.">
Rated Roll: smooth zero-to-infinity with specified average
</option>
<option value="\ Mistborn T:=4; \ Number of dice Roll:=T#d6; \ Roll d6s RN:=Roll drop 6; \ Exclude sixes RM:=max(RN--(different RN)); \ Get the highest duplicate dice under six \ Add number of sixes to highest duplicate dice under six count(Roll keep 6) + if RM then RM else 0 ">
Mistborn
</option>
<option value="\ Mistborn T:=9; \ Number of dice Roll:=T#d6; \ Roll d6s RN:=Roll drop 6; \ Exclude sixes RM:=max(RN--(different RN)); \ Get the highest duplicate dice under six \ Add number of sixes to highest duplicate dice under six count(Roll keep 6) + if RM then RM else 0 ">
Mistborn
</option>
<option value="\ Shadowrun 5 Collected Functions \call fSimple(12) \call fSimpleLimit(12,4) \call fSimpleEdgePush(12,5) \call fSimpleEdgeReroll(12,4) \ Opposed Test Examples \ <pool>, <limit/edge>, <opposing pool>, <opposing limit> \call fOpposed(12,10) \call fOpposedLimit(12,4,10,99) \call fOpposedEdgePush(12,5,10,99) \call fOpposedEdgeReroll(12,4,10,99) \ Combat Tests \ <attack pool>, <limit/edge>, <damage>, <ap>, <opposing defense>, <opposing armor>, <opposing body> call fPrettyPrintAttackDamage(call fAttackDamageLimit(16,7,6,0,5,6,4)) \call fPrettyPrintAttackDamage(call fAttackDamageEdgePush(16,5,6,0,5,6,4)) \call fPrettyPrintAttackDamage(call fAttackDamageEdgeReroll(16,7,6,0,5,6,4)) \------------------------------------------------------------------------------- \-- Simple Tests \------------------------------------------------------------------------------- \-- Simple Pool Test without Limit function fSimple(pool)= count 4 < pool#(d6) \-- Simple Pool Test with Limit function fSimpleLimit(pool,limit)= min{call fSimple(pool), limit} \-- Simple Pool Test with Push the Limit \-- Adds edge rating number of dice to the dice pool, ignores any limits and \-- applies the rule of sixes. function fSimpleEdgePush(pool,edge)= count 4 < (pool + edge)#(accumulate x:=d6 while x=6) \-- Simple Pool Test with Second Chances \-- Reroll all dice that did not hit on the first roll. function fSimpleEdgeReroll(pool, limit)= firstRoll:=call fSimple(pool); secondRoll:=call fSimple(max{pool - firstRoll, 0}); min{firstRoll+secondRoll, limit} \------------------------------------------------------------------------------- \-- Opposed Tests \------------------------------------------------------------------------------- \-- Simple Opposed Test without Limits function fOpposed(pool,poolOpposing)= max{0,call fSimple(pool)-call fSimple(poolOpposing)} \-- Simple Opposed Test with Limits function fOpposedLimit(pool,limit,poolOpposing,limitOpposing)= max{0,call fSimpleLimit(pool,limit)-call fSimpleLimit(poolOpposing,limitOpposing)} \-- Simple Opposed Test with Push the Limit function fOpposedEdgePush(pool, edge, poolOpposing, limitOpposing)= max{0,call fSimpleEdgePush(pool,edge)-call fSimpleLimit(poolOpposing,limitOpposing)} \-- Simple Opposed Test with Second Chances \-- If limits already don't apply to your test, just pass a large number as \-- the limit such as 999. function fOpposedEdgeReroll(pool, limit, poolOpposing, limitOpposing)= max{0,call fSimpleEdgeReroll(pool,limit)-call fSimpleLimit(poolOpposing,limitOpposing)} \------------------------------------------------------------------------------- \-- Simple Combat Tests \------------------------------------------------------------------------------- \-- Simple Damage Calculation \-- AP should be given as a negative \-- Doesn't take into account Stun vs Physical function fDamage(dv,ap,armor,body)= max{0, dv-call fSimple(body+max{0,armor+ap})} \-- Simple Attack (without Limit applied) Damage Calculation \-- AP should be given as a negative \-- Doesn't take into account Stun vs Physical function fAttack(att,dv,ap,def,armor,body)= netHits:=call fOpposed(att,def); if netHits > 0 then call fDamage(dv+netHits,ap,armor,body) else 0 \-- Simple Attack (with Limit applied) Damage Calculation \-- AP should be given as a negative \-- Doesn't take into account Stun vs Physical function fAttackLimit(att,limit,dv,ap,def,armor,body)= netHits:=call fOpposedLimit(att,limit,def,999); if netHits > 0 then call fDamage(dv+netHits,ap,armor,body) else 0 \-- Simple Attack (with Limit applied) Damage Calculation with Push the Limit \-- AP should be given as a negative \-- Doesn't take into account Stun vs Physical function fAttackEdgePush(att,edge,dv,ap,def,armor,body)= netHits:=call fOpposedEdgePush(att,edge,def,999); if netHits > 0 then call fDamage(dv+netHits,ap,armor,body) else 0 \-- Simple Attack (with Limit applied) Damage Calculation with Second Chances \-- AP should be given as a negative \-- Doesn't take into account Stun vs Physical function fAttackEdgeReroll(att,limit,dv,ap,def,armor,body)= netHits:=call fOpposedEdgeReroll(att,limit,def,999); if netHits > 0 then call fDamage(dv+netHits,ap,armor,body) else 0 \------------------------------------------------------------------------------- \-- Complete Combat Tests \------------------------------------------------------------------------------- \-- Helper: Figure damage based on net hits function fAttackDamageNetHits(netHits,dv,ap,armor,body)= damage:=if netHits > 0 then call fDamage(dv+netHits,ap,armor,body) else 0; damageStun:=if (netHits+dv) < armor then min{armor-(netHits+dv),damage} else 0; damagePhysical:=max{0,damage-damageStun}; damagePhysical*100+damageStun \-- Attack (without Limit applied) Damage Calculation \-- AP should be given as a negative \-- Returns damage as physical/stun where for each point the dv is below \-- armor+ap, one point of damage is converted to stun. To return both values, \-- physical damage is multiplied with 100 and stun damage is added -> a \-- result of 1 means 1 stun, a result of 1001 means 10 physical and 1 stun. function fAttackDamage(att,dv,ap,def,armor,body)= netHits:=call fOpposed(att,def); call fAttackDamageNetHits(netHits,dv,ap,armor,body) \-- Attack (with Limit applied) Damage Calculation \-- AP should be given as a negative \-- Returns damage as physical/stun where for each point the dv is below \-- armor+ap, one point of damage is converted to stun. To return both values, \-- physical damage is multiplied with 100 and stun damage is added -> a \-- result of 1 means 1 stun, a result of 1001 means 10 physical and 1 stun. function fAttackDamageLimit(att,limit,dv,ap,def,armor,body)= netHits:=call fOpposedLimit(att,limit,def,999); call fAttackDamageNetHits(netHits,dv,ap,armor,body) \-- Attack (with Limit applied) Damage Calculation with Push the Limit function fAttackDamageEdgePush(att,edge,dv,ap,def,armor,body)= netHits:=call fOpposedEdgePush(att,edge,def,999); call fAttackDamageNetHits(netHits,dv,ap,armor,body) \-- Attack (with Limit applied) Damage Calculation with Second Chances function fAttackDamageEdgeReroll(att,limit,dv,ap,def,armor,body)= netHits:=call fOpposedEdgeReroll(att,limit,def,999); call fAttackDamageNetHits(netHits,dv,ap,armor,body) \-- Helper: to calculate number of attackts to kill function fAttacksToKillHelper(att,limit,dv,ap,def,armor,body,counter,boxesFilled,boxesMax)= if boxesFilled < boxesMax then call fAttacksToKillHelper(att,limit,dv,ap,def,armor,body,counter+1,boxesFilled+call fAttackLimit(att,limit,dv,ap,def,armor,body),boxesMax) else counter \-- Calculate the number of attacks to kill an opponent function fAttacksToKill(att,limit,dv,ap,def,armor,body)= call fAttacksToKillHelper(att,limit,dv,ap,def,armor,body,0,0,9+body/2) \------------------------------------------------------------------------------- \-- Prety Print Combat Tests \------------------------------------------------------------------------------- \-- Helper: Extract physical damage from result from fAttackDamage function fAttackDamageToPhysical(value)= value/100 \-- Helper: Extract stun damage from result from fAttackDamage function fAttackDamageToStun(value)= value mod 100 \-- Prety Print the result of fAttackDamage function fPrettyPrintAttackDamage(value)= phy:=call fAttackDamageToPhysical(value); stun:=call fAttackDamageToStun(value); phy:=if phy < 10 then "0"|| phy else phy; stun:=if stun < 10 then "0"||stun else stun; phy||"P "||stun||"S" \---------------------------------------------------- \--- Extended Tests \---------------------------------------------------- \-- Helper: for extended tests function fExtendedHelper(dice,t,s,dur)= dur:=dur+1; s:=s+call fSimple(dice); dice:=dice-1; if (dice > 0) & (s<t) then call fExtendedHelper(dice,t,s,dur) else if s < t then -1 else dur \-- Simple Extended Test function fExtended(pool,treshold)= call fExtendedHelper(pool,treshold,0,0) ">
Shadowrun 5 Collected Functions
</option>
<option value="\ VG Test \ wyrdR 2015.01.17 DC:=5; \ Difficulty Check DC:=if DC>5 then 5 else DC; DP:=6; \ Dice pool Roll:=DP#d6; count DC<Roll">
VG Test
</option>
<option value="\ VG test \ wyrdR 2015.01.17 DC:=3; \ Difficulty Check DC:=if DC>5 then 5 else DC; DP:=3; \ Dice pool Roll:=DP#d6; count DC<Roll">
VG test
</option>
<option value="\ Highest result of pool of exploding D6 \N is number of dice \AV is the accumulated values of exploded dice, \where fives and sixes count as 5. N:=5; AV:=0; call CDice(N,AV) function CDice(N,AV) = x:= N d6; N:= count 4<x; if N>0 then AV:= AV + 5; call CDice(N,AV) else max x + AV">
Highest result of pool of exploding D6
</option>
<option value="\ CoinDice coins:=2; baseMult:=0; headMult:=1; tailMult:=-1; globalMult:=1; upgMult:=1; impMult:=globalMult*upgMult; impMult * call flip (baseMult, headMult, tailMult, coins) || "" function flip (base, head, tail, coin) = pool:=coin#d2; heads:=count 2 = pool; tails:=count 1 = pool; headContrib:=heads*head; tailContrib:=tails*tail; headContrib + tailContrib + base">
CoinDice
</option>
<option value="\ Dicepool explodes when rolled successes are the same value \Dicepool. Roll N dice. Dice with values equal or higher to TN are successes. If all of the successes have the same value (all fours or all fives or all sixes, for example), add the number of successes of new dice. The new dice succeed on the same TN and individually explode on 6\ N := 5; \ size of pool \ TN := 4; \ target number \ BASE := N# d6; \ type of die \ SUCS := 4<= BASE; \ count the successes in the first roll \ minsucs := sum min SUCS; \ what is the lowest success? \ maxsucs := sum max SUCS; \ what is the highest success? sum is needed to turn max sucs into a singleton because max SUCS returns a collection instead of of that \ \ if minsucs = maxsucs that means all successes have the same value\ \ if so, then return SUCS + SUCSd6 that themselves explode on 6 \ \ else just returns SUCS \ count 4<= if minsucs = maxsucs then SUCS U (count SUCS) # accumulate x := d6 while 6 = x else SUCS">
Dicepool explodes when rolled successes are the same value
</option>
<option value="\ 99% between -10 and +10 sum 2#(accumulate x:=(d6-d6) while (x*x)=25)">
99% between -10 and +10
</option>
<option value="\ 1 second of attacks minDmg:=1; maxDmg:=2; intAPS:=3; extraAChance:=75; critChance:=5; critMult:=2; dmgMult:=if d100<=critChance then critMult else 1; numAttacks:=if d100<=extraAChance then intAPS+1 else intAPS; dmgMult * (sum (numAttacks # choose (minDmg..maxDmg)))">
1 second of attacks
</option>
<option value="\ Heavy Gear Blitz \ Script to Solve Arm/Pen - UN17 2015 \======================================== n:=2; \Number of Dice s:=4; \Skill level p:=6; \Weapon Penetration ap:=0; \AP Value pr:=0; \Precise (1/0 True/False) \======================================== a:=6; \Target Armor e:=5; \Target AVG Roll ag:=0; \Target: Agile (1/0 True/False) th:=3; \Target Hull ts:=3; \Target Structure \ Calculations Below \ h:=0; \Highest Die m:=0; \Modified Skill r:=0; \Result x:= n d6; h:= max x; m:= x -- max x; r:= h; r:= r + (count s <= m); mos:=r-e; dmg:=mos+p-a; \Result: Show MOS \r \Result: Show DMG Probability (Misses are shown as -100) if mos < 0 then "- MISS -" else if mos = 0 & pr = 0 & ag =1 then "- MISS - MOS:"||mos||"AGILE" \NO DMG, NO AP else if dmg < 0 & ap = 0 then "ARMOR - Blocked" \NO DMG, LOW PEN, AP, MOS OK else if dmg <= 0 & mos > 0 & p < a & ap >= 1 then "ARMOR PEN - Damage:"||if ap > mos then mos else ap ||"AP Max" \NO DMG, LOW PEN, AP, MOS 0 else if dmg <= 0 & mos =0 & p < a & ap >= 1 then "ARMOR PEN - Blocked - MOS:"||mos \NO DMG, HIGH PEN, AP else if dmg <= 0 & p >= a & ap >= 1 then "ARMOR - Blocked" \DMG but Lower or Equal to AP else if dmg >= 0 & p < a & dmg <= ap & ap > 0 then "ARMOR PEN - Damage:"||if ap > mos then mos else ap ||"AP Max" \DMG else "DAMAGE - MOS:"||mos||"Damage:"|| if dmg = 0 then "M" else dmg">
Heavy Gear Blitz
</option>
<option value="\ Deck of Fate using regular playing cards \ Take a plain pack of cards. Remove one black and one red ace. Black cards are positive while red cards are negative. The rank determines the magnitude of the card: \ Ace = ±4 \ King = ±3 \ Queen to 10 = ±2 \ 9 to 5 = ±1 \ 4 to 2 = 0 \ Shuffle the deck when appropriate. Always shuffle after a king or ace has been drawn. (This troll simulation shuffles between every draw.) \ The probability distribution closely resembles that of 4dF. choose {-4, 2#-3, 6#-2, 10#-1, 12#0, 10#1, 6#2, 2#3, 4}">
Deck of Fate using regular playing cards
</option>
<option value="\ Median 3d20 + exploding/imploding d6 x := 3d20; m := median x; if 20=x then \ if there is a 20 m + sum accumulate i := d6 while i = 6 else if 1=x then \ if there is a 1 m - sum accumulate i := d6 while i = 6 else m">
Median 3d20 + exploding/imploding d6
</option>
<option value="\ DND 5th Edition Great Weapon Fighting Style x:=1d12; if(x < 3) then 1d12 else x">
DND 5th Edition Great Weapon Fighting Style
</option>
<option value="\ d20 bell (2d8+d6-2) JRW sum d8+d8+d6-2">
d20 bell (2d8+d6-2) JRW
</option>
<option value="\ Most Common Dice R:=7d13; 'call mode (R) |> 'R function mode(R)= Rx:= max R+1; RC:=different (foreach s in R do Rx*count (R keep s)+s); RCx:=(max RC)/Rx*Rx; foreach s in (RCx < RC) do s mod Rx \ wyrdR 2.19.11.28 ">
Most Common Dice
</option>
<option value="\ DND 5th Edition Great Weapon Fighting Style With Half-Orc \ D&D 5e Great Weapon Fighting \ Rerolls die once if less than rerollBelow value and must take second result (even if worse). Configurable options below. Default is 2d6 weapon (ie: Greatsword) with 2d8 bonus damage (ie: Divine Smite). weaponDie := 6; weaponDiceCount := 2; \ Bonus damage (ie: divine smite). Set bonusDiceCount to 0 for no bonus. bonusDie := 8; bonusDiceCount := 0; \ If half orc, set to 1 for extra crit die. halfOrc := 1; \ Set rerollBelow to high value (ie: 999) to disable reroll (for comparison, etc) rerollBelow := 3; \ Min roll to qualify as critical attack roll (roll double # of dice) minCrit := 18; sum( attack := d20; critRollMultiplier := if attack >= minCrit then 2 else 1; extraDie := if attack >= minCrit & halfOrc then 1 else 0; (weaponDiceCount*critRollMultiplier + extraDie)#( wr := d weaponDie; if wr < rerollBelow then d weaponDie else wr ) U (bonusDiceCount*critRollMultiplier)#( br := d bonusDie; if br < rerollBelow then d bonusDie else br ) )">
DND 5th Edition Great Weapon Fighting Style With Half-Orc
</option>
<option value="\ Blades in the Dark basic roll \ Change "8" to the required dice pool size M := 4; \ Dice pool system follows roll := M d6; Max := max(roll); Count := count(maximal(roll)); if 6=Max then if 1<Count then 'roll<>'"Critical success!" else 'roll<>'"Full success" else if 6>Max>3 then 'roll<>'"Partial success" else 'roll<>'"Bad outcome" ">
Blades in the Dark basic roll
</option>
<option value="\ Ninja All Stars combat \ This is the post-beta version of the combat rules \ the desired result (e.g. VOID) is considered equivalent to a 6 A:= 4; \ number of dice for the winner B:= 2; \ number of dice for the loser, should be fewer or equal to the winner winner := A#d6; loser := B#d6; \ cancel the winner's results with loser's winnerpool := winner -- loser; \ count desired results: post-beta, the winner may select only their own dice count 6 = winnerpool">
Ninja All Stars combat
</option>
<option value="\ Ninja All Stars combat v2 \ Each result for on the elemental dice are equivalent to a number on a regular d6. For instance, the desired result (e.g. VOID) is considered equivalent to a 6 on the attacker's dice. In order to account for proper cancellation, equivalent values on the defender's d6 represent the elemental opposite of the attacker's dice, e.g. 6 is a spirit. A:= 2; \ number of dice for the attacker B:= 2; \ number of dice for the defender attacker := A#d6; defender := B#d6; \ cancel the attacker's results with defender's (defender's 6s, aka spirits, cancel attacker's 6s, aka voids.) attackerpool := attacker -- defender; \ cancel the defender's results with attacker's defenderpool := defender -- attacker; \ count voids: taking 6 to be a void for the attacker and a 1 to be a void for the defender. attackervoids := count 6 = attackerpool; defendervoids := count 1 = defenderpool; \ count the total pool of voids from which the attacker may choose. sum attackervoids+defendervoids \ Remember! 'void' here is a placeholder for ANY result, whatever result you are interested in, the probability distribution will be the same.">
Ninja All Stars combat v2
</option>
<option value="\ sum largest 2 of 3d6, re roll if < LD (WHFB VC) \ For Vampire Counts players, this is for Screaming banner LD tests when using the following \ Vampire with Fear Incarnate, Aura of Dark Majesty, Screaming Banner \ Replace {LD} with the enemy units LD value and for column 2 select &#8804; \ Due to Aura, the value you want to compare is 1 less than the enemies LD (but still use the actual LD value in the equation) x:=3d6; if (sum(largest 2 x)) < {LD} then sum largest 2 3d6 else sum(largest 2 x)">
sum largest 2 of 3d6, re roll if < LD (WHFB VC)
</option>
<option value="\ Largest 2 of 3d6, re roll if less than LD (WHFB VC) \ accidental duplicate please delete x:=3d6; if (sum(largest 2 x)) < {LD} then sum largest 2 3d6 else sum(largest 2 x)">
Largest 2 of 3d6, re roll if less than LD (WHFB VC)
</option>
<option value="\ 6 die probabilities \ d12+d8 d12+d8+d4+d6+d10+d20">
6 die probabilities
</option>
<option value="\ The RPG Project \ dice pool using d10's where 0 = zero = z9 T := 2; \ target number on die N := 2; \ number of dice to roll S := 1; \ number of successes needed P := count N#(z9 keep {0..T}); P >= S">
The RPG Project
</option>
<option value="\ 2d10, reroll and replace each 10 as 2d10 function explode(x) = if x=10 then sum 2 # call explode(d10) else x sum 2 # call explode(d10) ">
2d10, reroll and replace each 10 as 2d10
</option>
<option value="\ Modified Risk with many bases and base destruction function baseAttack (captVal) = att:=sum 2d6; def:=sum 2d6; destroy:=if att=12 then 1 else 0; capture:=if att>def & att<12 then 1 else 0; if destroy=1 then 1 else if capture=1 then captVal else 0 atks:=97 # call baseAttack(2); [count 1 = atks, count 2 = atks]">
Modified Risk with many bases and base destruction
</option>
<option value="\ OVA Anime Rollplaying game roll := 3d6; one := count 1 = roll; two := count 2 = roll; three := count 3 = roll; four := count 4 = roll; five := count 5 = roll; six := count 6 = roll; SUMS := {one, 2*two, 3*three, 4*four, 5*five, 6*six}; max SUMS">
OVA Anime Rollplaying game
</option>
<option value="\ Armada Star Wars \ Star wars: Armada 'reds' is for salvation front arc blue := choose{1,1,1,1,1,1,0,0}; black := choose{2,2,1,1,1,1,0,0}; reds := choose{2,2,2,1,1,0,0,0}; red := choose{2,1,1,1,1,0,0,0}; sum 3#reds">
Armada Star Wars
</option>
<option value="\ SubSet or EqualSet \ wyrdR 2015.09.14 \ Fun with collections :) \ Torben's Better Definitions \ See: http://topps.diku.dk/torbenm/thread.msp?topic=572296765 function nsub(A,B) = if A drop B then {} else 1 function sub(A,B) = if A--B then {} else 1 function equ(A,B) = if (A--B) U (B--A) then {} else 1 function EqualSet(A,B)= 	 if (A -- B) then 	 	[0,A -- B] 	 else 		if (B -- A) then 			[0,B -- A] 		else 			if A&B then [1,A] else [0,{}] 			 function SubSet(A,B)= 	BnoA:= B -- A; 	Brem:=B--BnoA; 	EQC:=call EqualSet(A,Brem); 	if B&A&(%1 EQC)=1 then 		[1,A] 	else 		[0,Brem] 	 function StrictSubSet(A,B)= 	BnoA:= B -- A; 	Brem:=B--BnoA; 	EQC:=call EqualSet(A,B); 	EQCrem:=call EqualSet(A,Brem); 	if B& A&(%1 EQCrem)=1 & (%1 EQC)=0 then 		[1,A] 	else 		[0,B keep A] function NotSubSet(A,B)= 	BnoA:= B -- A; 	Brem:=B--BnoA; 	EQC:=call EqualSet(A,Brem); 	if (%1 EQC)=1 then 		[0,A] 	else 		[1,Brem] 	 function NotEqualSet(A,B)= \ give 0 if is equal; give 1 if not equal and what elements are not in either 	EQC:=call EqualSet(A,B); 	if (%1 EQC)=1 then [0,A ] else 			[1,%2 EQC] function Equivalent(A,B)= 	if ((count A) = (count B)) then 			[1,0] 	else 		[0,(count A) - (count B)] 		 X:=3d6; Y:=6d6; '("X: "|| X)|> '("Y: "||Y) |> '("nSub: " || 'call nsub(X,Y) )|> '("Sub: " || 'call sub(X,Y) )|> '("Equ: " || 'call equ(X,Y) )">
SubSet or EqualSet
</option>
<option value="\ Wulin Dice Sets (processor heavy wit higher dice #s) c := 7d10; 1 < (foreach x in 1..10 do count (x = c)) \based on value definition example from PDF - thanks!">
Wulin Dice Sets (processor heavy wit higher dice #s)
</option>
<option value="\ Kismet \ wyrdR 2015.09.12 \ http://en.wikipedia.org/wiki/Poker_dice \ https://en.wikipedia.org/wiki/Kismet_(dice_game) X:={4,4}; \ Dice kept from previous roll; leave empty for first roll Y:=X @ (5-(count X))#d6; \ Total of Five Dice Display:=3; 	\ 0: Rank Only 	\ 1: Rank & Full Hand 	\ 2: Check Code 	\ 3: Kismet Details Kismet:=1; \ 1 - Kismet Results; 0 - Poker Results 	\Kismet Overload (if Display=3) 	Kismet:=if Display=3 then 1 else Kismet; ShowStraight:=1; 	\ Some versions acknowledge Straights 	\ 1: Straights are OK 	\ 0: No Straights please 	\ Kismet Overload, Kismet demands Straights 	ShowStraight:=if Kismet=1 then 1 else ShowStraight; Ys:=({1..6} -- Y); \ Check for Straight M:=foreach X in Y do X + call power(10,count(Y keep X)); Mf:=sum(foreach Me in (different M) do Me/10); Mpa:=count(call digits(Mf,1)); Mx:=max M; Mxx:=max (M drop Mx); Mfn:= 	if ((Mf/10000) mod 10)=1 then 7 else 	if ((Mf/1000) mod 10)=1 then 6 else 	if ((Mf/100) mod 10)=1 & ((Mf/10) mod 10)=1 then 5 else 	if ((Mf/100) mod 10)=1 then 3 else 	if ((Mf/10) mod 10)=2 then 2 else 	if ((Mf/10) mod 10)=1 then 1 else 	if (ShowStraight=1) & (Mx<100) & ((count(Ys keep {1,6}))=1) then 4 else 	0 ; 	 Kcol:=call KismetColor(Y,Mx mod 10); Kcat:=call KismetRow(Mfn,Kcol); Mft:=if (Kismet > 0) then 		call KismetDesc(%1 Kcat) 	else 	 	call PokerDesc(Mfn); Mfnx:=if (Kismet > 0) then 		(%1 Kcat) + 100 	else 		Mfn; if Display=1 then "<noscript>" || Mfn || "</noscript>"||"<em><small><small>"|| Mft || "</small></small></em><br>" || "<big><big>"||'call PokerRank(M) ||"</big></big>" else if Display=2 then 	Mfnx*10 + (Mx mod 10) else if Display=3 then 	'(call DisplayIIIHTML(M,Y,Kcat)) else 	"<em>" || Mfnx || "</em>" || "<em><small><small>" || Mft || "</small></small></em>" \ PokerRank \ Sort Descending, With Colored Sides \ Sort a collection of numbers in Descending order \ N.B. Converts to a String so no longer useful in calculations function PokerRank(X)= \Sort Descending Xmax:=max X; Xrem:=X drop Xmax; Xmax & call RealDice(foreach W in (X keep Xmax) do W mod 10) || Xrem & (" " || 'call PokerRank(Xrem)) \ Simplified Dice (No Colors) \ Xmax & call dice(foreach W in (X keep Xmax) do W mod 10) || Xrem & (" " || 'call PokerRank(Xrem)) \ RealDice \ wyrdR 2015.09.11 \ Support for Kismet Colored Sides function RealDice(R)= \ &#9856; &#9857; &#9858; &#9859; &#9860; &#9861; X:=choose R; Dice:= 	if X=1 then "<font class=1 color=black>&#9856;</font>" else 	if X=2 then "<font class=2 color=red>&#9857;</font> " else 	if X=3 then "<font class=3 color=green>&#9858;</font>" else 	if X=4 then "<font class=4 color=green>&#9859;</font>" else 	if X=5 then "<font class=5 color=red>&#9860;</font>" else 	if X=6 then "<font class=6 color=black>&#9861;</font>" else {} ; Ra:=R--X; Dice || Ra & call RealDice(Ra) \ dice \ Simplified from RealDice, no HTML \ wyrdR 2015.09.11 function dice(R)= \ &#9856; &#9857; &#9858; &#9859; &#9860; &#9861; X:=choose R; Dice:= 	if X=1 then "&#9856;" else 	if X=2 then "&#9857;" else 	if X=3 then "&#9858;" else 	if X=4 then "&#9859;" else 	if X=5 then "&#9860;" else 	if X=6 then "&#9861;" else {} ; Ra:=R--X; 'Dice || '(Ra & call dice(Ra)) function power(X,Y)= \ Raise X to the Power of Y (X ^ Y) 	pwr:=if ((X=0) U (Y<0)) then 0 else if (Y=0) then 1 else X; 	if (pwr=X & Y>1) then pwr*(call power(pwr,Y-1)) else pwr \ digits 	\ Enumerate each digit of a number into a set 	\ Convert form XYZ into {X,Y,Z} 	\ Numbers must not be greater than 10 	\ To allow 2 digit number, t=2, for 3 digits t=3 etc 	\ 2 digits enough for simulation but left here for re-use in other functions function digits(x,t)= 	Base:=call power(10,t); 	if x>=Base then 		{call digits(x mod Base,t), call digits(x/Base,t)} 	else 		x 	 function PokerDesc(P)= \ Get Text Description for Poker Ranks 	if P=7 then "Five of a Kind" else 	if P=6 then "Four of a Kind" else 	if P=5 then "Full House" else 	if P=4 then "Straight" else \ Optional 	if P=3 then "Three of a Kind" else 	if P=2 then "Two Pair" else 	if P=1 then "One Pair" else 	"Bust" 	 function KismetRow(Mc, Kolor)= \ Returns Best Category, All Possible Categories > 6 	if Mc=2 then (if (Kolor>3) then [7,{7,14}] else [14,{14}]) else 	if Mc=3 then [8,{8,14}] else 	if Mc=4 then [9,{9,14}] else 	if Mc=5 then (if (Kolor>4) then [12,{7,8,11,12,14}] else [11,{8,11,14}] ) else 	if Mc=6 then (if (Kolor>4) then [13,{13,14,7,8,10}] else [13,{13,14,7}] ) else 	if Mc=7 then [15,{15,14,13,10,8,7}] else 	[14,{14}] 							 function KismetDesc(X)= \ Gets Text Description for Kismet Categories 	if X=7 then "Two Pair Same Colour" else 	if X=8 then "Three of a Kind" else 	if X=9 then "Straight" else 	if X=10 then "Flush" else 	if X=11 then "Full House" else 	if X=12 then "Full House Same Colour" else 	if X=13 then "Four of a Kind" else 	if X=14 then "Yarborough" else 	if X=15 then "Kismet" else 	'("Sum any "||X) 							 function KismetScore(X, Y)= \ Rules for Kismet Scoring 	if X=15 then 50 + sum Y else 	if X=7 then sum Y else 	if X=8 then sum Y else 	if X=9 then 30 else 	if X=10 then 35 else 	if X=11 then 15 + sum Y else 	if X=12 then 20 + sum Y else 	if X=13 then 25 + sum Y else 	if X=14 then sum Y else 	if X>0 then sum (Y keep X) else 	0 function KismetColor(Y,B)= \ Check if Kismet Colors are matched 	count (Y keep {B,7-B}) function KismetSuit(S)= 	Smod:=S mod 10; 	if (Smod) keep {1,6} then "Black" else 	if (Smod) keep {2,5} then "Red" else 	if (Smod) keep {3,4} then "Green" else "None" 	 function DisplayIIIHTML(M,Y,Kcat)= 	Kc:=call KismetColor(Y,(max M) mod 10); 	Col:=if Kc>3 then call KismetSuit(max M) else "<em>none</em>"; '"<h1 align=center style='margin:0;line-height:70%'>/K//I//S//M//E//T/</h1>"|| '("<div align=center><h2 style=line-height:70%;margin:0;padding:2px;font-size:300%>"||call PokerRank(M) || "</h2>"|| 	'call KismetTable(1,Y,Kcat)||"</div>"|| 	'("<div align=left style='margin:0 10px'><dl><dt>Ranking: <dd>" || call KismetDesc(%1 Kcat)) || 	'("<dt>Best Score: <dd>" || 'max( foreach J in {1..15} do (J<7 @ (%2 Kcat keep J))&call KismetScore(max(0 @ (%2 Kcat keep J)),Y) ) )||\	'("<dt>Average Score: <dd>" || 	'("<dt>Dominate Color: <dd style='color:"||Col||"'>"||Col)|| 	"</div>") 	 function KismetTable(N,Y,Kcat)= 	Kcc:=%2 Kcat; 	'( '(if N=1 then 			"<table id=kismet border=1 style=border-collapse:collapse><tr><th style=text-align:right;padding:5px>#<th style=text-align:center;padding:5px>Category<th style=text-align:right;padding:5px>Score" 		else "" 		)|| 		"<tr><td style=text-align:right;padding:5px>"||N||"<td style=text-align:center;height:2em;padding:5px>"|| 		'call KismetDesc(N)||"<td style=text-align:right;padding:5px>"|| 		(N<7 @ (%2 Kcat keep N)) & call KismetScore(N,Y)|| 		'( 			if N<15 then 				'call KismetTable(N+1,Y,Kcat) 			else 				(N=15) & "</tr></table>" 		) 	) \ Kismet v2.0.2 by wyrdR">
Kismet
</option>
<option value="\ Heavy Gear 4th edition playtest d20 \ System is d20, roll under. N:=1; \ Change N to alter the number of d20 dice used count 15>= N#(d20) \ Change count to alter Difficulty Number">
Heavy Gear 4th edition playtest d20
</option>
<option value="\ Mutant Chronicles 3ED probability calculator \ Mutant Chronicles 3ED probability calculator function rer(a,b,s,f) = if (max a)>s then count s>=b + count f>=b else 0 reroll:=0; \Set to 1 if the character can re-roll a skill die for the test Chronicle:=0; \ Number of successes from Chronicle Dice (not the dice) Skill:=17; Focus:=3; N:=2; \ Change N to alter the number of dice x := N#d20; r:= 1d20; count Skill>=x + count Focus>=x + Chronicle + reroll*(call rer(x,r,Skill,Focus))">
Mutant Chronicles 3ED probability calculator
</option>
<option value="\ 4DNS \ Four Domain Narrative System \ wyrdR 2015.10.06 \ Variables N:=0; \ Domain + Role B:=6; \ Boon S:=0; \ Snag \ Constants C:=2; T:=C#6; \ All Sixes P:=C d6; \ +ve Dice Q:=C d6; \ -ve Dice \ Explode if Double Sixes P:=if (T--P)@(P--T) then P else P@(accumulate X:=min (C d6) while X=6); Q:=if (T--Q)@(Q--T) then Q else Q@(accumulate Y:=min (C d6) while Y=6); \ Domain + Role + +ve -ve \ + (Best of Dice &#8804; Boon) - (Best of Dice &#8804; Snag) N+sum (P@ max (0@B>=P))-sum (Q@ max (0@S>=Q)) \ Compare with Challenge \ ±10 	Average \ ±2±4 	Typical \ ±5±8 	Unusual \ ±8±12	Exceptional \ ±13±16	Legendary \ ±17 	Mythical">
4DNS
</option>
<option value="\ 4dF FUDGE DICE using choose (sum (foreach x in (1..4) do choose {-1, 0, 1}))">
4dF FUDGE DICE using choose
</option>
<option value="\ Tunnels and Bugs function tunnel (x) = ((d6*d6)+d6) - ((d6*d6)+d6) + x function turn (mon, tun, mult) = tunMoney:=sum (tun # call tunnel(5)); (tunMoney*mult)+mon function power (base, val, exp) = if exp = 0 then 1 else if exp = 1 then val else call power (base, val*base, exp-1) function bugNum (bug) = if bug=1 then [1,1] else if bug=2 then [2,3] else if bug=3 then [5,10] else if bug=4 then [10,24] else if bug=5 then [25,70] else if bug=6 then [40,130] else if bug=7 then [75,280] else if bug=8 then [120,500] else if bug=9 then [200,900] else if bug=10 then [500,2600] else if bug=11 then [800,4500] else if bug=12 then [1200,7200] else if bug=13 then [1600,11000] else if bug=14 then [2200,17500] else if bug=15 then [3000,30000] else if bug=16 then [4000,45000] else if bug=17 then [5000,62000] else if bug=18 then [6000,90000] else if bug=19 then [7500,130000] else if bug=20 then [10000,200000] else if bug=21 then [15000,350000] else if bug=22 then [25000,650000] else if bug=23 then [40000,1200000] else if bug=24 then [60000,2200000] else if bug=25 then [100000,4200000] else if bug=26 then [150000,7500000] else if bug=27 then [250000,14000000] else if bug=28 then [350000,21000000] else if bug=29 then [500000,35000000] else if bug=30 then [700000,56000000] else if bug=31 then [1000000,100000000] else if bug=32 then [1500000,180000000] else if bug=33 then [2000000,300000000] else if bug=34 then [3000000,600000000] else if bug=35 then [5000000,1200000000] else if bug=36 then [10000000,4000000000] else if bug=37 then [50000000,100000000000] else [0,0] \ Throws an exception, not a Troll error function bugName (bug) = if bug=1 then "Creekwood Forest" else if bug=2 then "Picnic Panic TD" else if bug=3 then "Katerpillars" else if bug=4 then "Turf war" else if bug=5 then "Worlds Guard 2" else if bug=6 then "Bumble Tumble" else if bug=7 then "Garden Guardians" else if bug=8 then "Robo Slug" else if bug=9 then "Mighty Spidy" else if bug=10 then "Bee Dodger" else if bug=11 then "Worlds Guard" else if bug=12 then "Ladybug" else if bug=13 then "Arachnid Wars" else if bug=14 then "Kawairun" else if bug=15 then "Momentum Master" else if bug=16 then "Wild King" else if bug=17 then "Aqua Slug" else if bug=18 then "Fire Flies" else if bug=19 then "Lt. Fly vs. The Spiders From Above" else if bug=20 then "BigTree Defense" else if bug=21 then "Brink of Alienation 3" else if bug=22 then "Tombscape" else if bug=23 then "Flea 1.5" else if bug=24 then "Arachnid Wars 1.5" else if bug=25 then "BugWar2" else if bug=26 then "Monster Castle Defense" else if bug=27 then "Robo Slug 2" else if bug=28 then "Bug War" else if bug=29 then "Mecharon 2" else if bug=30 then "Colony Defenders TD2" else if bug=31 then "Toxers" else if bug=32 then "The Visitor: Massacre at Camp Happy" else if bug=33 then "Clockwords Act 1" else if bug=34 then "Engage - Insect Island" else if bug=35 then "The Last Shelter" else if bug=36 then "More Mindless Violence" else if bug=37 then "Insectonator" else if bug=38 then "Victory" else "ERROR" str:=0; \ Increases money multiplier. dex:=0; \ More tunnels per turn. ene:=0; \ Reduces cost of beehives. money:=0; \ The amount of money to start a turn. bug:=1; \ The current bug level. bugInfo:=call bugNum (bug); numBugs:=%1 bugInfo; upgCostMult:=%2 bugInfo; baseUpgCost:=3000; \ The base upgrade cost at the beginning of the turn. newBaseUpgCost:=max {100, 10 * call tunnel (baseUpgCost/10)}; actualUpgCost:=newBaseUpgCost*upgCostMult; moneyMultPerBug:=10+str; beehives:=0; \ Number of beehives from previous reset. resetFor:=0; \ Number of beehives gained in the next reset. equivBeehives:=beehives+resetFor; beehiveCostMult:=50-ene; beehiveCost:=1000*beehiveCostMult*call power (2,2,equivBeehives); multiplier:=moneyMultPerBug*(beehives+1)*numBugs; numTunnels:=10+dex; newMoney:=call turn (money, numTunnels, multiplier); ("Current bug is " ||call bugName (bug))|>("Your new money is " ||'newMoney)|>("The new base upgrade cost is " ||'newBaseUpgCost)|>("It costs " ||'actualUpgCost ||"to upgrade to " ||call bugName (bug+1))|>("The next beehive costs " ||'beehiveCost)">
Tunnels and Bugs
</option>
<option value="\ Real Cards \ wyrdR 2017.09.15 \ Output Unicode Playing Cards \ Assuming browser and fonts support this Base:=127136; Sp:=foreach R in {1..11,13,14} do R; He:=foreach R in {1..11,13,14} do R+16; Di:=foreach R in {1..11,13,14} do R+32; Cl:=foreach R in {1..11,13,14} do R+48; Jo:={16+15,48+15}; Pk:=Sp@He@Di@Cl@Jo; Draw:=Pk pick 5; call HTMLCard(Draw) \ call SymbolCard(Draw) \ call TextCard(Draw) function HTMLCard(A)= Base:=127136; An:=min A; C:=if An>16 & An<48 then "#A00" else "#000"; \ Ann:=if (An=31) then 63 else (An); "<div style=height:100%;margin:auto;margin-top:5px;padding:0;width:100%;background:white;font-size:800%;line-height:1em;color:" ||C|| ">&#" ||Ann+Base|| ";</div>" || (A--An) & call HTMLCard(A--An) function TextCard(A)= An:=min A; T:=call CardText(An); R:=An mod 16; Of:={}; Of:=(R<15) & " of "; (%1 T ||Of||%2 T) |> (A--An) & call TextCard(A--An) function SymbolCard(A)= An:=min A; T:=call CardSymbol(An); R:=An mod 16; ('(%1 T) || '(%2 T)) ||" "|| ((A--An) & call SymbolCard(A--An)) function CardText(C)= S:=C / 16; R:=C mod 16; Suit:=if R<15 then ( 	 if S=0 then "Spades" else if S=1 then "Hearts" else if S=2 then "Diamonds" else if S=3 then "Clubs" else "" ) else if S=3 then "Black Joker" else "Red Joker"; Rank:=if R=1 then "Ace" else if R=2 then "Two" else if R=3 then "Three" else if R=4 then "Four" else if R=5 then "Five" else if R=6 then "Six" else if R=7 then "Seven" else if R=8 then "Eight" else if R=9 then "Nine" else if R=10 then "Ten" else if R=11 then "Jack" else if R=12 then "Knight" else if R=13 then "Queen" else if R=14 then "King" else ""; [Rank,Suit] function CardSymbol(C)= S:=C / 16; R:=C mod 16; Suit:=if R<15 then ( 	 if S=0 then "&#9824;" else if S=1 then "&#9829;&#65039;" else if S=2 then "&#9830;&#65039;" else if S=3 then "&#9827;" else "" ) else if S=3 then "&#9733;" else "&#10026;"; Rank:=if R=1 then "A" else if R=2 then "2" else if R=3 then "3" else if R=4 then "4" else if R=5 then "5" else if R=6 then "6" else if R=7 then "7" else if R=8 then "8" else if R=9 then "9" else if R=10 then "10" else if R=11 then "J" else if R=12 then "C" else if R=13 then "Q" else if R=14 then "K" else "?"; [Rank,Suit] function CardSplit(C)= S:=C / 16; R:=C mod 16; S:=if R=15 then 5 else S; [R,S] ">
Real Cards
</option>
<option value="\ Real Fudge \ wyrdR 2015.10.21 N:={-1, 0, 1}; f:=4#(choose N); "<sub><em>"||sum f||"</em></sub><strong style=font-size:2em>"|| call fudge(f) ||"</strong>" function fudge(x)= xa:=x pick 1; \ xa:=min x; xb:=x--xa; (if xa<0 then "&#8722;" else if xa>0 then "+" else "&#11034;") || xb & call fudge(xb)">
Real Fudge
</option>
<option value="\ Geodude fossil attack sum accumulate x :=10*z1 while x=10">
Geodude fossil attack
</option>
<option value="\ Exploding Fudge \ wyrdR 2015.10.21 N:={-1, 0, 1}; f:=4#(choose N); R:=sum f; \ if sum = ±4 then explode while + or - respectively if (R*R)=16 then R+sum(accumulate x:=(choose N) keep f while x) else R ">
Exploding Fudge
</option>
<option value="\ Exploding 2d10 sum 2#(accumulate x:=d10 while x=10)">
Exploding 2d10
</option>
<option value="\ 3d6, re-roll 1's sum { repeat x:=d6 while x=1, repeat x:=d6 while x=1, repeat x:=d6 while x=1 } ">
3d6, re-roll 1's
</option>
<option value="\ poe call rollTwiceTakeLower(200,300) function dmg(dmgmin,dmgmax)= d(dmgmax-dmgmin+1)+dmgmin-1 function rollTwiceTakeLower(dmgmin,dmgmax)= min{call dmg(dmgmin,dmgmax),call dmg(dmgmin,dmgmax)} ">
poe
</option>
<option value="\ 1d4, reroll 1s, drop the lowest \ 4d6, reroll 1s, drop the lowest x:={ repeat x:=d6 while x=1, repeat x:=d6 while x=1, repeat x:=d6 while x=1, repeat x:=d6 while x=1};if (min x) = max(x) then sum(x) else sum(largest 3 x)">
1d4, reroll 1s, drop the lowest
</option>
<option value="\ 4d6, reroll 1s, drop the lowest x:={ repeat x:=d6 while x=1, repeat x:=d6 while x=1, repeat x:=d6 while x=1, repeat x:=d6 while x=1}; sum(largest 3 x)">
4d6, reroll 1s, drop the lowest
</option>
<option value="\ 4d6, reroll 1s&2s, drop the lowest x:={ repeat x:=d6 until x>2, repeat x:=d6 until x>2, repeat x:=d6 until x>2, repeat x:=d6 until x>2}; sum(largest 3 x)">
4d6, reroll 1s&2s, drop the lowest
</option>
<option value="\ Hero System, Body Damage \Calculation, count up the sum of body, where each d6 result gives \body as follows: \1 = 0 body, 2-5 = 1 body, 6 = 2 body N:=10; \ Change N to alter the number of dice x:= N d6 drop {1}; \ Modified to make s and c count from the same dice s:=count x; c:=count (x keep 6); \ doubles tens s+c">
Hero System, Body Damage
</option>
<option value="\ Tassak Roll \ Roll d10, compare to WR (warto&#347;&#263; rzutu / test difficulty). \ If the roll is <= WR, you succeeded. Successes come with an associated \ WS (Warto&#347;&#263; Sukcesu) - success value. It further determines the outcome beyond \ a binary "win / fail". \ For rolls with a difficulty of 10 or more, the roll uses more than one die. \ Split up the WR into sub-WRs of as many 10s as necessary + rest. \ For example, WR 18 = WRs {10, 8}. \ Those are then rolled seperately, and the results summed to find the WS. \ In practice, however, rolls will often end up with WRs of less than 10. WR := 40; \ Test difficulty. Higher means easier. Crits := 1; \ 1 to enable, 0 to disable. \ Crits cause rolls of 1 to count as WR instead. \ When WR > 10, split it into tens + rest. WRs := (WR / 10)#10 U (WR - sum (WR / 10)#10); sum (foreach x in WRs do y := d10; if y = Crits then x else if x >= y then y else 0)">
Tassak Roll
</option>
<option value="\ FizzBuzzWoof function fizzBuzzWoof (argu, num) = argument:='num; argument:=if ((num mod 10) = 3)U((num/10) = 3) then (argument || " Fizz") else argument; argument:=if (num mod 3) = 0 then (argument || " Fizz") else argument; argument:=if ((num mod 10) = 5)U((num/10) = 5) then (argument || " Buzz") else argument; argument:=if (num mod 5) = 0 then (argument || " Buzz") else argument; argument:=if ((num mod 10) = 7)U((num/10) = 7) then (argument || " Woof") else argument; argument:=if (num mod 7) = 0 then (argument || " Woof") else argument; if num<100 then call fizzBuzzWoof(argu|>argument, num+1) else argu|>argument call fizzBuzzWoof ("1", 2)">
FizzBuzzWoof
</option>
<option value="\ Variable Explosion DieCount:=1; FaceCount:=4; ExplodeMin:=4; sum DieCount#(accumulate y:=(d FaceCount) while (y>(ExplodeMin-1)))">
Variable Explosion
</option>
<option value="\ doubles and lonely dice \ Experiment with a custom magic-system in GURPS using HP as blood sacrifice, using 2-10 d6. \ Doubles, triplets and above count as their value, lonely dice only add +1 per dice. \ a roll with 5 dice [4,5,5,2,6] will make 1+5+5+1+1=13. \ n is the number of dice. n:= 7; roll:= n#d6; m:=count 1 = roll; seks:=count 6 = roll; fem:=count 5 = roll; fire:=count 4 = roll; tre:=count 3 = roll; to:=count 2 = roll; m:=if seks > 1 then m+(seks * 6) else m+seks; m:=if fem > 1 then m+(fem * 5) else m+fem; m:=if fire > 1 then m+(fire * 4) else m+fire; m:=if tre > 1 then m+(tre * 3) else m+tre; m:=if to > 1 then m+(to * 2) else m+to; m">
doubles and lonely dice
</option>
<option value="\ Simulating 2d6 by 3 d6 \ Simulating 2d6 by 3d6 x:=3d6; y := (min x)*(max x); if y = {2,3,5,10} then y else if y = 6 then 7 else if y = 12 then 8 else if y = 18 then 4 else if y = 24 then 11 else if y = 30 then 12 else if y = {8,15} then 9 else 6">
Simulating 2d6 by 3 d6
</option>
<option value="\ Focus opposed exploding d10 pools Adice := 6; ATarget := 6; Bdice := 4; BTarget := 5; Adie := {1,(ATarget-2)#2,(10-ATarget)#ATarget,10}; Apool := Adice#(accumulate x:=choose Adie while x=10); Asuccesses := count ATarget<=Apool; Bdie := {1,(BTarget-2)#2,(10-BTarget)#BTarget,10}; Bpool := Bdice#(accumulate x:=choose Bdie while x=10); Bsuccesses := count BTarget<=Bpool; Asuccesses-Bsuccesses">
Focus opposed exploding d10 pools
</option>
<option value="\ Legends of the Wulin's Wuxia Action System roll lakeSize:=7; \ Set this to your lake size, that is, 5 for unranked, 6 for rank 5. 7 for rank 4, and so on. lake:=(lakeSize)z9; result:={}; result:=foreach faceValue in (different lake) do result U {10*(count (faceValue=lake))+faceValue}; result ">
Legends of the Wulin's Wuxia Action System roll
</option>
<option value="\ Normal distribution \ This program creates a normal distribution with a specified average and standard deviation. \ If the standard deviation is set to an odd number, it will actually be a little lower \ because Troll rounds all fraction down to the next lower integer. \ If your probability calculation doesn't give an exact average, your \ iteration bound is too low. It can be set to as high as 99 but defaults to 12. avg := 50; \ Set this to the mean and median of the distribution. stdDev := 20; \ Set this to the standard deviation of the distribution. numDice:= stdDev*stdDev/2; \ In exploding z1, the number of dice determine the standard deviation. sum (numDice)#(accumulate x:=z1 while x = 1) + (avg-numDice)">
Normal distribution
</option>
<option value="\ Setz \ wyrdR 2018.10.08 \ Start with 'Iteration bound' at 5 for N < 6 then drop \ Roll Nd6; If no 1s/6s, roll 3 more dice until there are 1s/6s \ Group dice in sets of equal value, the largest set size \ The result is the largest non-6 set, or zero if all 6s rolled \ Unless the number of 6s is greater than any other set, then the result is the number of 1s \ (Zero if there are no 1s) \ See also SetzDice num := 4 ; \ Number of Dice roll:= num d6; \ Note: (num < 11) is a fudge to stop timeouts on online version \ Iteration bound can be dropped to 1 or 0 for high values of 'num' rollx:= roll @ (num < 11) & ( !(roll keep {1,6}) & accumulate x:=3d6 until x keep {1,6} ) ; set := rollx drop 6 ; countsix:= count (6 = rollx); countone:= count (1 = rollx); frequency:= foreach item in (different set) do count (item = set) ; best:=max (frequency@0); \best if (countsix>best) then countone else best ">
Setz
</option>
<option value="\ SetzDice \ [ Complex Rolls ] \ wyrdR 2018.10.08 \ *** Calculate probabilities not recommended unless showdice:=0; *** \ Start with 'Iteration bound' at 5 for N < 6 then drop \ Roll Nd6; If no 1s/6s, roll 3 more dice until there are 1s/6s \ Group dice in sets of equal value, the counting the number of dice in the two largest sets \ The result is the two best sets; if only the only (other) set is made of 6s it is counted as 0 \ If the largest set is made of 6s is greater than any other set, then the result is the number of 1s \ The result is [ 0, 0 ] if there are no 1s. Only sets of a size less than or equal to the number of 1s can be paired with the 1s; if nothing is left (other than 6s) then the second result is 0 \ If the there is a set with two or more 1s or 6s this is a Sap; one dice (each for 1 or 6 set up to a maximum of 2) is for subsequent rolls \ See also Setz num := 5 ; \ Number of Dice roll:= num#d6; rollx:= roll @ ( !(roll keep {1,6}) & accumulate x:=3#d6 until x keep {1,6} ) ; set := rollx drop 6 ; sixes := 6 = rollx ; ones := 1 = rollx ; countsix:= count sixes; countones:= count ones; setz:=foreach X in (set) do X + 10*count(X = set); bestset:= max (0 @ setz); nextbest:=max (0 @ (setz drop bestset )); leftovers:= ((10 * countsix) > bestset & (0 @ (6 + 10 * countones) > setz)); \ anything occurring less than the number of 1s \ removeset:= remove & (remove/10) # (remove mod 10); resultA:= ( if leftovers then countones else bestset/10) ; resultB:= ( if leftovers then max(leftovers @ 0) else nextbest ) /10 ; M:= (setz drop leftovers)@0; Ch := min 2 @ (count rollx) / 2; Cu := count(1 = rollx); Cs := count(6 = rollx); Mu := Cu > 1 & 1; 	\# Positive Sap for 1s (2 or more 1s) Ms := Cs > 1 & 1 ; 	\# Negative Sap for 6s (2 or more 6s) Mm := foreach Y in (different M) do Y / 10; Mmd:=call Desc(Mm); Mn:=foreach G in Mm do (9000+G); \# For sorting Mnd:=call Desc(Mn); Mx:=rollx keep 6; \ Show Dice Kept showdice:=1; \ show dice rolled if = 1 if showdice = 1 then style:="<style>td span { font-size: 240%; display: block; line-height: 0.7; text-align: center; max-width: 2.8em; word-break: break-all; margin:auto; } td { text-align: center; }</style> " ; style||"<div style='font-size:60%; color:#448; text-align:center;' "||max Mn||Ms||Mu||Mnd||" ><strong>" || [resultA, resultB] || ((Ms@Mu) & ("<sub> --"|| sum(Ms @Mu) || "</sub>" )) ||"</strong></div >" ||"<div style='text-shadow: 4px 4px 12px gray,-2px -2px 2px white;'>"|| ((M @ Mu @ Ms) & M & call PokerRank(M)) || ( sixes & call PokerRank( sixes @ leftovers ) )||"</div> " else [resultA, resultB] function PokerRank(X) = \#Sort Descending Xmax:=max X; Xrem:=X drop Xmax; Xset:=X keep Xmax; R:=sum({Xmax,0}) mod 10; Red:=if R=6 then 160 else 0; \Hue:=25+86*(R-2); Xset & ( "<r r="||R||"/><span style='color: rgb("||Red||",0,0);"||(if R=6 then "border-top:1px dashed #444;margin-top:0.1em;padding-top:0.1em;" else "")||"'>" || call RealDice(Xset) || "</span>" ) || Xrem & call PokerRank(Xrem) \# RealDice 2.16.05.26 function RealDice(R) = \# &#9856; &#9857; &#9858; &#9859; &#9860; &#9861; Rt:=choose R; X:=Rt mod 10; Dice:= 	if X=1 then "&#9856;" else 	if X=2 then "&#9857;" else 	if X=3 then "&#9858;" else 	if X=4 then "&#9859;" else 	if X=5 then "&#9860;" else 	if X=6 then "&#9861;" else {} ; Ra:=R--Rt; Dice|| Ra & call RealDice(Ra) function Desc(S) = Sx:=maximal (S @ 0); Sn:=S drop Sx; Sx||" "||Sn&call Desc(Sn)||" " ">
SetzDice
</option>
<option value="\ Deadlands (4d4) max { sum (accumulate x:=d4 while x=4), sum (accumulate y:=d4 while y=4), sum (accumulate a:=d4 while a=4), sum (accumulate b:=d4 while b=4) }">
Deadlands (4d4)
</option>
<option value="\ Deadlands (4d6) max { sum (accumulate x:=d6 while x=6), sum (accumulate y:=d6 while y=6), sum (accumulate a:=d6 while a=6), sum (accumulate b:=d6 while b=6) }">
Deadlands (4d6)
</option>
<option value="\ &#8734; \ wyrdR 16.06.14 Y:=5d6; Mu:=count(Y keep {1}); \ Positive Mv:=count(Y keep {6}); \ Negative Mw:=((Mu>2)@(Mv>2))&sgn(Mu-Mv); Yx:=count(Mw&((accumulate L:=(d6 keep (median Y)) while L))); Mu-Mv+Yx*(sum Mw) \ Roll 5 dice \ Count 1s as plus \ Count 6s as minus \ If 3 or more 1s/6s then roll an extra dice, repeatedly, until not also a 1/6 \ Results in roughly Normal distribution between -5 and 5, with &#8734; possibilities ">
&#8734;
</option>
<option value="\ Count sux with exploding N:=12; \ Number of dice S:=10; \ Dice size DC:=5; \ DC X:=10; \ Explode Threshold count (DC-1) < N#(accumulate x:=d(S) while x>(X-1)) ">
Count sux with exploding
</option>
<option value="\ Hero System, Killing Attack \___DESCRIPTION___ \Calculates the body and/or stun roles for a killing attack in HERO System. \___________________________________________ \___HOW TO USE___ \Alter values in "INPUT" section. \Uncomment the which output you want in the "OUTPUT" section (It won't work if you don't). \Don't touch the "CALCULATION" section. \___________________________________________ \___INPUT___ \Set the damage dice and stun multiplier for the attack. \You can set the resistive defense, total defense (which should be greater than resistive defense), \and and damage reduction here. \If you don't want to bother with values after defense, just leave those values at "0" \Body Damage roll (IMPORTANT!) k:= sum(2d6)+1; \Stun Multiplier, d6-1 is default s:= d6-1; \Target resistive defense R:= 0; \Target total defense T:= 0; \Target Damage Reduction (rare, but might as well give the option) \Warning: Troll rounds differently than HS, but should be accurate +-1 \Enter the percent reduction, so 25 for 25% reduction A:= 0; \___________________________________________ \___CALCULATION___ \Don't touch! Here be math! \body damage before defense x:= max {1, k}; \stun damage before defense y:= x * s; \body damage after defense i:= ((x - R) * (100-A))/100; \stun damage after defense j:= if (R=0) then max {i, (y * (100-A))/100} else max {i, ((y-T) * (100-A))/100}; \___________________________________________ \Print body, stun, or a {body, stun pair, but commenting out other 2 \___OUTPUT___ \Choose what you want to output. \Remove the "\" in front of the i, j, or {i,j} line, \making sure to keep the "\" in front of the other two. \Uncommenting "i" gives you BODY only, \"j" give you only STUN, \"{i,j}" gives you BODY, STUN in a pair. \The last one works if you want to make a few rolls, \while the first 2 are better for calculating probabilities. \BODY only \i \STUN only \j \BODY, STUN \{i,j}">
Hero System, Killing Attack
</option>
<option value="\ HfL2 A := 3d10; \ The dice H := 4; \ Heat V := 0; \ Violence call test(A,H,V) \ This calls the function below function test(a,h,v) = \ Here is the function itself if (largest 1 a)=10 then "SUCCESS" else if (sum a) < 10 then "CATASTROPHE " || (h*3)+v else if ((least 1 a)+v) > 45 then "TRAUMA x3 " || (least 1 a)+v else if ((least 1 a)+v) > 28 then "TRAUMA x2 " || (least 1 a)+v else if ((least 1 a)+v) > 12 then "TRAUMA " || (least 1 a)+v else if ((least 1 a)+v) > 6 then "COMPLICATION " || (least 1 a)+v else "SPOTLIGHT " || (least 1 a)+v">
HfL2
</option>