# a tit for tat, but a bit more friendly at the beginning # to avoid hacking on forever on evil-tit-for-tat, # but be very stringent when the other one defects too often sub moritz-ctft(:@theirs, :$total, |$) { return True if @theirs < 3; return False if @theirs.grep(*.not).elems > ($total / 10); @theirs[*-1]; }; %strategies = &moritz-ctft; # the evil clone... sub moritz-ectft(:@theirs, :$total, |$) { return True if @theirs < 3; return False if @theirs.grep(*.not).elems > ($total / 10); # did you believe in happy ends? return False if @theirs + 1 == $total; @theirs[*-1]; }; %strategies = &moritz-ectft;