我正在努力做一个非常基本的文本冒险来测试我的基本技能.基本运动提示用户输入,如果它匹配某些字符串,则更改其坐标.我知道,这很愚蠢.但是if,else if,else匹配他们的反应总是返回else,即使你输入的字符串匹配的一个.
string action;
string west = "go west";
string east = "go east";
string north = "go north";
string south = "go south";
string prompt = "Don't just stand around with your dagger in your ass! Do something! ";
//i wrote a bunch of setup story here, it's irrelevant text output
int vertical = 25;
int horizon = 20;
//action begins
start:
{
cout << "What do you do?" << endl; …Run Code Online (Sandbox Code Playgroud) c++ ×1