using System;using System.Collections.Generic;namespace _1kRl{class Program{ class M{Dictionaryd=new Dictionary();int p=9,x,y,u, v;char a='@',w='#',f='.';Random r=new Random();public M(){x=p;y=p;d[S(x,y)]=a; ConsoleKey k = K();while(k!=ConsoleKey.Escape){Console.Clear();u=x;v=y;switch (k){case ConsoleKey.LeftArrow:x--;break;case ConsoleKey.RightArrow:x++;break; case ConsoleKey.UpArrow:y--;break;case ConsoleKey.DownArrow:y++;break;}if(C(S( x,y))==w){x=u;y=v;}d[S(u,v)]=f;d[S(x,y)]=a;for(int j=0;j