-墟- 发表于 2020-7-11 16:27:52

秀 技 术

本帖最后由 -墟- 于 2020-7-13 15:01 编辑

其实我很蒻的
<blockquote>#include <bits/stdc++.h>上面是源码,供参考(话说怎么缩进都消失了);下面是exe。
https://wwilliamm.lanzous.com/iTvxEeijp9a
作品介绍:
1)输入你的姓名(其实咋写都行)
2)等待
3)打开CapsLK
4)wasd控制移动(还没做好,以后想做一个解谜游戏)
——————————————————————————————————————
第 二 波 秀 技 术 (感觉自己好不要脸)
https://mozhua.aerfaying.com/Projects/412822
——————————————————————
注意:一切关于秀操作的语言纯属瞎扯,大佬别误会(滑稽)



-墟- 发表于 2020-7-11 16:31:49

???源码呢???
重发一下
#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;

int key, x = 0, y = 0;
string name;

void load(){
        cout << "loading";
        for(int i = 0; i < 10; i++){
                Sleep(300);
                cout << ".";
        }
}

void move(int &x, int &y, int key){
        if(key == 65){
                x -= 3;
                if(x < 0)
                        x = 0;
        }else if(key == 68){
                x += 3;
        }else if(key == 87){
                y--;
                if(y < 0)
                        y = 0;
        }else if(key == 83){
                y++;
        }
}

void printMap(int x, int y){
        system("cls");
        for(int i = 0; i < y; i++){
                cout << endl;
        }
        for(int i = 0; i < x; i++){
                cout << ' ';
        }
        cout << name;
}

void getName(string &name){
        cout << "请输入你的名字" << endl;
        cin >> name;
        Sleep(300);
}

void flicker(){
        Sleep(50);
        for (int i = 0; i < 3; i++){
                Sleep(50);
                system("color 60");
                Sleep(50);
                system("color 06");
        }
        Sleep(100);
        system("cls");
}

int main(){
        system("color 06");
        getName(name);
        flicker();
        load();
       
        system("cls");
        cout << name;
        while(true){
                if (_kbhit()){
                        key = _getch();
                        if(key == 43)
                                break;
                        move(x, y, key);
                        printMap(x, y);
                }
        }
        return 0;
}

黄蕊小白花 发表于 2020-7-11 19:45:07

-墟- 发表于 2020-7-11 16:31
???源码呢???
重发一下

起码讲一下是干什么的啊

Mozilla 发表于 2020-7-11 20:27:10

-墟- 发表于 2020-7-11 16:31
???源码呢???
重发一下

这个程序是干啥的,根本看不懂。。。

-墟- 发表于 2020-7-13 14:59:11

抱歉,没写注释,有空写一下注释
页: [1]
查看完整版本: 秀 技 术