Suppose the following set-up of the world: A 3x3 scene "Forest" numbered f00 to f22 (where e.g,. f02 is the top right tile). And a 2x2 scene "Swamp" numbered s00 to s11 in the same fashion. Legend: T=Trap, OOO=Obstacle, D=Door, k=Key, w=Weapon, g=Goal, H=Hero, V=Villain Forest: |---|---|---| | H | T | w | |---|---|---| | |OOO|V,k| |---|---|---| | T | | D | |---|---|---| Swamp: |---|---| | D | V | |---|---| | T | g | |---|---| The key k is needed to go through door D in the forest, which leads to the door D in swamp. Once the hero is in the swamp, he cannot return (as this door is locked and there is no key). When simulating, the result below might be printed (put print statements in your operational semantics!). Note that execution is random and will be different each time the simulation runs. This scenario shows how the Hero Perceval fights first Kay in the forest, is weakened as he walks several times in a trap, finds a weapon and a key and goes through the door to the swamps and then fights Morgan in the swamps only to succumb to his wounds... The scenario can be read as follows: You can see time steps. In every time step the hero Perceval does an action (move or attack), as well as the villain in the same scene (in de first stage Kay, in the second stage Morgan). The current health ("H=") and damage value ("A=") are shown for every character in every timestep. Between brackets (e.g., "(f00->Set {f10, f01}:f10)" for Perceval in the first time slice), the current location ("f00") is shown, and the Set of choices to move to (or attack) are shown ("Set {f10, f01}"), from which one is chosen. At the end of the line, the movement is shown with the necessary notifications ("f00->f01" for Perceval in the first time slice, which means he moved to a trap, and he was "attacked" by this trap). You can see that in the next time slice, Perceval's health has decreased. The scenario goes on as Perceval encounters a locked door, and successfully fights Kay while finding the key. Now Perceval can go through the door and arrives in the swamp. Here, he attacks Morgan, and finds the holy grail. Simulating the RPG TIME STEP: [Perceval(H=150,A=50)(f00->Set {f10, f01}:f10) moved : f00->f10 [Kay(H=100,A=20)(f12->Set {f11, f02, f22}:f02) moved : f12->f02 TIME STEP: [Perceval(H=150,A=50)(f10->Set {f20, f11, f00}:f20) moved : f10->f20 [Kay(H=100,A=20)(f02->Set {f12, f01}:f12) moved : f02->f12 TIME STEP: [Perceval(H=140,A=50)(f20->Set {f21, f10}:f21) moved : f20->f21 [Kay(H=100,A=20)(f12->Set {f11, f02, f22}:f02) moved : f12->f02 TIME STEP: [Perceval(H=140,A=50)(f21->Set {f20, f11, f22}:f22) moved : f21->f22 [Kay(H=100,A=20)(f02->Set {f12, f01}:f12) moved : f02->f12 TIME STEP: [Perceval(H=140,A=50)(f22->Set {f21, f12}:f12) fought : Kay-> [Kay(H=50,A=20)(f12->Set {f11, f02, f22}:f02) moved : f12->f02 TIME STEP: [Perceval(H=140,A=50)(f22->Set {f21, f12}:f12) moved : f22->f12 [Kay(H=50,A=20)(f02->Set {f12, f01}:f12) fought : Perceval-> TIME STEP: [Perceval(H=120,A=50)(f12->Set {f11, f02, f22}:f02) fought : Kay-> TIME STEP: [Perceval(H=120,A=50)(f12->Set {f11, f02, f22}:f22) moved : f12->s00 [Morgan(H=100,A=50)(s01->Set {s00, s11}:s11) moved : s01->s11 TIME STEP: [Perceval(H=120,A=50)(s00->Set {s10, s01}:s10) moved : s00->s10 [Morgan(H=100,A=50)(s11->Set {s10, s01}:s01) moved : s11->s01 TIME STEP: [Perceval(H=110,A=50)(s10->Set {s00, s11}:s11) moved : s10->s11 [Morgan(H=100,A=50)(s01->Set {s00, s11}:s11) fought : Perceval-> HERO SUCCEEDED