Jump to content

Non-transitive dice: Difference between revisions

m
Minor changes.
m (syntax highlighting fixup automation)
m (Minor changes.)
Line 1,206:
{{libheader|itertools}}
<syntaxhighlight lang="nim">
import std/[algorithm, sequtils, sets, strformat]
import itertools
 
Line 1,224:
 
func cmp(die1, die2: Die): int =
## Compare two diedice returning 1, -1 or 0 for operators >, < ==.
var tot: array[3, int]
for d in product(die1.faces, die2.faces):
Line 1,232:
 
func verboseCmp(die1, die2: Die): string =
## Compare towtwo diedice returning a string.
var win1, win2 = 0
for (d1, d2) in product(die1.faces, die2.faces):
256

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.