the hand speaks

main
magical 2023-12-08 03:35:54 +00:00
parent 16bf45bcbf
commit a3d768bdb5
1 changed files with 4 additions and 2 deletions

View File

@ -68,12 +68,14 @@ proc cmp {a b} { return [expr {($b < $a) - ($a < $b)}] }
proc xbeats {hand1 hand2} { proc xbeats {hand1 hand2} {
set x [beats $hand1 $hand2] set x [beats $hand1 $hand2]
if {$x < 0} {puts "$hand1 beats $hand2"} \ if {$x < 0} {puts "$hand1 beats $hand2"} \
elseif {$x > 0} {puts "$hand2 beats $hand1"} \ elseif {$x > 0} {puts "$hand2 beats $hand1"} \
else {puts "$hand1 ties $hand2"} else {puts "$hand1 ties $hand2"}
return $x return $x
} }
# take a look at these hands
# take a look at these hands
proc beats {hand1 hand2} { proc beats {hand1 hand2} {
#puts "cmp $hand1 $hand2" #puts "cmp $hand1 $hand2"
set r1 [type $hand1] set r1 [type $hand1]