This code is an answer to an exercise I found on the cplusplus forums.I'm a beginner so any reviews will be appreciated :)Make a program that outputs a simple grid based gameboard to the screen using either numbers or characters. Allow the user  to move either up, down, left, or right each turn. If the player steps on a trap then they lose. If they make it to the treasure 'X' then they win.#include <iostream>#include <string>#include <time.h>#include <Windows.h>#include <algorithm>int main(){std::string grid = 0000000000\n    0000000000\n    0000000000\n    0000000000\n    0000000000\n    0000000000\n    0000000000\n;char trap = 'T';grid[15] = trap;grid[35] = trap;grid[45] = trap;grid[67] = trap;char player = 'G';int n = 1;grid[n] = player;char end = 'X';grid[75] = end;char wasd;std::cin >> wasd;while (n != 15 && n != 35 && n != 45 && n != 67 && n!=11 && n!=21 && n!=31 && n!=41 && n!=51 && n!=61 && n!=71 ){    if (wasd == 'd'){        grid[n] = '0';        n++;        grid[n] = player;        std::cout << grid;        std::cin >> wasd;    }    else if (wasd == 'a'){        grid[n] = '0';        n--;        grid[n] = player;        std::cout << grid;        std::cin >> wasd;    }    else if (wasd == 's'){        grid[n] = '0';        n = n + 11;        grid[n] = player;        std::cout << grid;        std::cin >> wasd;    }    else if (wasd == 'w'){        grid[n] = '0';        n = n - 11;        grid[n] = player;        std::cout << grid;        std::cin >> wasd;    }    }if (grid[15] == player || grid[35] == player || grid[45] == player || grid[67] == player){    std::cout << You lose!;}}
Text-based Dungeon Crawl game
c++;beginner;console