#include<bits/stdc++.h> using namespace std; int main(){ while(ture){ string feedback; command = ...; cout << command<< endl; cin>>feedback; if(all-explored){ cout<<"END"<<endl; cout<<n<<" "<<m<<endl; for(int i = 0;i < n;i++){ for(int j = 0;i < 0;j++){ cout<< map[i][j]; } cout<<endl; } break; }else{ ... } return 0; }