Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <unistd.h>
- using namespace std;
- int Right = 0;
- int RighterOne;
- int RighterTwo;
- int Up = 0;
- int Upper;
- string Answer;
- int main() {
- cout << "W A S D WA AS WD SD Return End\n";
- cout << "\n";
- sleep(5);
- do {
- for (int x = 40; x >= 0; x--) {
- cout << "\n";
- }
- if (Up < 0) {
- Up = 0;
- }
- if (Right < 0) {
- Right = 0;
- }
- RighterOne = Right;
- RighterTwo = Right;
- Upper = Up;
- for (RighterOne; RighterOne >= 0; RighterOne--) {
- cout << " ";
- }
- cout << ". .\n";
- for (RighterTwo; RighterTwo >= 0; RighterTwo--) {
- cout << " ";
- }
- cout << " - \n";
- for (Upper; Upper >= 0; Upper--) {
- cout << "\n";
- }
- cin >> Answer;
- if (Answer == "A" || Answer == "a") {
- Right--;
- } else if (Answer == "D" || Answer == "d") {
- Right++;
- } else if (Answer == "W" || Answer == "w") {
- Up++;
- } else if (Answer == "S" || Answer == "s") {
- Up--;
- } else if (Answer == "AS" || Answer == "as" || Answer == "SA" || Answer == "sa") {
- Right--;
- Up--;
- } else if (Answer == "WA" || Answer == "wa" || Answer == "AW" || Answer == "aw") {
- Right--;
- Up++;
- } else if (Answer == "WD" || Answer == "wd" || Answer == "DW" || Answer == "dw") {
- Up++;
- Right++;
- } else if (Answer == "SD" || Answer == "sd" || Answer == "DS" || Answer == "ds") {
- Up--;
- Right++;
- } else if (Answer == "Return" || Answer == "return") {
- Up = 0;
- Right = 0;
- }
- } while (Answer != "End" && Answer != "end");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement