*********************************************** * NSFCWT - Rules for round 6 * *********************************************** This is a tough one, and we thought to give you some extra time by posting this early. It's game time. In this round we are going to play the PAPER- SCISSORS- STONE game. Wait, you're saying, I play this every time I send my P-space warriors to the hill. Well, this is different: instead of starting up a paper-, scissors-, or stone-type warrior, you simply show your hand (symbolically at least) the way you did when you played this game as a kid. This round is an exercise in P-space programming and calls for a sophisticated switching algorithm that anticipates and beats an opponent's switching algorithm. We supply a skeleton warrior as well as white warriors. The skeleton warrior takes care of the bookkeeping. Your job is to write a switching mechanism. In every round your warrior chooses a strategy (paper, scissors or stone) and then loads a number representing this choice into a special location in core (my_hand). After both warriors in core made their choices, the bookkeeping part of your skeleton warrior decides who won and commits suicide or waits until the end of the round depending on this comparison. This decision is based on the well known fact that SCISSORS beats PAPER (cut), STONE beats SCISSORS (damage), PAPER beats STONE (wrap). To simplify bookkeeping the warriors are loaded symmetrically in core at locations 0 and 4000. So you we are going to use the pmars -d 4000 -c 1000 -r 1000 command line. Notice that the number of cycles is limited to 1000 and so the warriors have a sufficient but finite time to make a decision. This small cycle number allows us to run 1000 rounds per game. Length limit is the maximum length that pMARS supports (500 instructions). The round consists of a round robin between the 10 white warriors and the competing warriors (white warriors hopefully in the last spots :-) This means you have to beat the white warriors and your opponents as well. The 10 white warriors (uuencoded zip archive below) are very simple; they are either completely predictable (don't learn from previous results) or use a very simplistic adaptation routine. A hint: it is possible to write a warrior that beats all white warriors 9 times out of 10. On the other hand it is also possible to create a switching mechanism that kills this warrior 9 times out of 10... Please send your warrior to sieben@imap1.asu.edu by Friday, Nov. 17, 20:00, MST. Good luck, Nandor and Stefan Skeleton warrior: --------------8<---------------------------------------------------- ;redcode-94 ;name ??? ;author ??? ;Warrior that plays the game of Paper-Scissors-Stone in NSFCWT round 5 ;Needs to be paired with one opponent exactly half the coresize apart (-d 4000) ;assert WARRIORS==1 || (WARRIORS == 2 && MINDISTANCE == CORESIZE/2) ;assert VERSION >= 80 ;my/your_hand are used to communicate between players your_hand equ (my_hand+CORESIZE/2) PAPER equ #1 ;some useful constants SCISSORS equ #2 STONE equ #3 org start my_hand dat 0,0 ; ; Variable part starts here. This is were I decide what hand to ; use next. I can use the value of the RESULTS cell (0 if lost, ; 1 if won, 2 if tied last round) and any other values I chose ; to store in pspace. The hand I decide to show is stored in the ; B-field of instruction 'my_hand'. ;---BEGIN-VARIABLE-PART----------------------------------------------------- Don't change any code outside this area. See the white warriors below for examples what could go in here. Do not bomb your opponent or peak at your_hand before making your move or do anything else unfair, we're watching your code with eagle's eyes :-). ;---END-VARIABLE PART------------------------------------------------------- ; End of variable part. I wait for the other player to show his hand. ; I then analyze the outcome of the game. ; wait jmz.b wait,your_hand work mov.b your_hand,#work sub.b my_hand,work ;your_hand minus my_hand, loss=1,-2 add #2,work ;loss=3,0 mod #3,work ;loss=0 live jmn live,work ;die if lost, live if won or tied end