609 @verb #9595:"my_rules" this none this rxdo #8034 @program #9595:"my_rules" this none this " Dumps rules for the current feature object. Not called directly by the player; they can have many roshambo features to work with and how can we know which one? This verb is called by @roshambo_rules, which tries to list rules for all the roshambo games the player has at his disposal in the current room. " msg = {"Rules for " + $string_utils:name_and_number(this)} if (!this.valid_throws) return {@msg, " Valid throws not defined."} endif " test for balance" counts = $list_utils:make(length(this.valid_throws), 0) for rule in (this.rules) {winner, loser} = rule[1] counts[winner in this.valid_throws] = counts[winner in this.valid_throws] + 1 counts[loser in this.valid_throws] = counts[loser in this.valid_throws] - 1 endfor " dump list of throws" if ($list_utils:count(0, counts) < length(counts)) msg = {@msg, " This game is unbalanced."} endif for myThrow in (this.valid_throws) weaker_opponents = {} for rule in (this.rules) default_predicate = rule[1][1] == rule[1][2] ? "ties" | "beats" {throws, scripts, ?predicate = default_predicate} = rule if (myThrow == throws[1]) weaker_opponents = {@weaker_opponents, predicate + " " + throws[2]} endif endfor msg = {@msg, tostr(" ", myThrow, ": ", $string_utils:from_list(weaker_opponents ? weaker_opponents | {"not defined"}, ", "))} endfor return msg "Last modified by Pentomino (#8034) on Sun Aug 29 19:22:29 2004 MDT." . 0