adventurevideogames.IthasbeenworBackground:TheLegendofZeldaisanepicfantasyserialofaction-ldwiderenownedformorethan35years.ThestoryhappensinanancientKingdomcalledHyrule.TheseriesofgamescentreonthevariousincarnationsofLink,acourageousknightofthekingdom,andZelda,amagicalprincessofthekingdom.TheyfighttogethertosaveHyrulefromGanon,adevilthatwantstodestroythekingdom.Attheendofeachgameoftheseries,Linkusesalegendarysword,mastersword,todefeatandsealthedevilGanonandsuccessfullysavethekingdom.
Now,considerthefollowingscenario:PrincessZeldaislockedupbyGanoninacastle.TosaveZelda,LinkmustbeatGanonandopenthecastle’sgate.ButhecannotbeatGalonwithoutthemastersword.Thisscenarioisabstractedintoa3×4gridworld.Initially,Linkisat(1,1),masterswordat(3,1),Ganonat(2,2),andthreegatesat(1,3),(2,3)and(3,3).Eachtimestep,Linkcantakeanactionfromthefollowingoptions:
Moveto an adjacent grid.(Note that Link cannot move across the gate without openingit.)Description:Linkwillbeatthenextgrid.
Pickupthemastersword.Description:Linkwillbewiththesword.
AttackGanon.Description:GanonwillbedefeatedifLinkiswiththemasterswordandisatthesamegridasGanon.•
Openthegate.Description:ThecorrespondinggatewillbeopenedifGanonisdefeatedandLinkisatthesamegridasthegate.