猫史档案馆


Jvav源代码

用户:ZH-Y-QZH-Y-Q查看:6 回复:3 评论:6 创建时间:2020-06-07T11:05:54


/*
    Jvav Programmer Ver.02w05c Snapshot
    By 30266
    Compilation time 2020-04-16 21:00
*/
/*
    版本1.2 Pre3 日志
    哇上面那位巨佬……awa
    代码都用中喵变量的吗……而且还跑不了。
    您的环境可能和我们不一样吧。
    哇通过文件0的个数来判断版本哈哈哈哈哈想不到啊。

    修复了在windows系统上不能运行的bug。
    简化了选择语言的部分。
    尝试简化在线更新的部分。(通过另一个程序下载,没有java的机子也上可以运行)
    这个程序是用python打包的,需要找我qq awa。

    by johnvp22 5.16 15:00 qq1341994820
*/
#include <iostream>
#include <fstream>
#include <windows.h>
using namespace std;
int main()
{
    cout << "Initializing program...\n";
    string language;
    string comm, typ, inputstr;
    string command, type, inputcharacter;
    language = "English";
    cout << "Configuring the online update service...\n";
    system("del upgrade.txt");
    system("cls");
    /*en_main*/
    en_main:
    cout << "--------------------------------------------\n";
    cout << "| Jvav Program                Ver.1.2 Pre3 |\n";
    cout << "| By Dr.ZhangHaoYang      Programmer 30266 |\n";
    cout << "| Enter'help'to get help!         johnvp22 |\n";
    cout << "| Online push updates are now supported!   |\n";
    cout << "--------------------------------------------\n";
main:
    cout << "Jvav>";
    cin >> command;
    if (command == "help") {
        cout << "----Jvav help------Page(1/1)---\n";
        cout << "  help [page]:Get help\n  leave:Exit Jvav\n  output:Output characters\n  input:Input characters\n  upgrade:Online detection of version updates\n  language:setting the program language\n  info:Jvav information\n";
        cout << "----Jvav help------Page(1/1)---\n";
        goto main;
    }
    else if (command == "leave") {
        cout << "Are you sure to leave jvav?(y/n)";
        string L;
        cin >> L;
        if (L == "y") {
            return 0;
        }
        else {
            goto main;
        }
    }
    else if (command == "output") {
        cout << "Jvav>output>";
        cin >> type;
        cout << type << endl;
        goto main;
    }
    else if (command == "info") {
        cout << "Jvav Programm Ver.1.2 Pre1\nIt's just a joke, but we still make it, and the joke was first brought by Zhang Haoyang.\nThis version supports running away from jdk.\nThe person writing the program is 30266.\n";
        goto main;
    }
    else if (command == "input") {
        cout << "Jvav>input>";
        cin >> inputcharacter;
        goto main;
    }
    else if (command == "upgrade") {
        cout << "Jvav>upgrade>Getting a version list...\n";
        goto upgrade;
    }
    else if (command == "language") {
        cout << "Please enter the setting language(en/zh):";
        string language;
        cin >> language;
        if (language == "en") {
            goto main;
        }
        else if (language == "zh") {
            system("cls");
            goto ch;
        }
        else {
            cout << "Unknown language.\n";
            goto main;
        }
    }
    else {
        cout << "Unknown command\n";
        goto main;
    }

    /*cn_main*/
ch:
    language = "简体中文";
    cout << "--------------------------------------------\n";
    cout << "| Jvav编译器             版本:1.2 预览版3 |\n";
    cout << "| 作者:张浩洋大师           编写者:30266 |\n";
    cout << "| 通过输入'帮助'来获得帮助        johnvp22 |\n";
    cout << "| 现已支持在线推送更新!                   |\n";
    cout << "--------------------------------------------\n";
cn_main:
    cout << "Jvav>";
    cin >> comm;
    if (comm == "帮助") {
        cout << "----Jvav帮助---第(1/1)页----\n";
        cout << "  帮助 [页码]:获取帮助\n  退出:退出Jvav\n  输出:输出字符\n  输入:输入字符以便调用\n  更新:在线检测版本更新\n  语言:设置Jvav的语言\n  关于:获取关于Jvav的信息\n";
        cout << "----Jvav帮助---第(1/1)页----\n";
        goto cn_main;
    }
    else if (comm == "退出") {
        cout << "你确定要退出Jvav吗?(是/否)";
        string ba;
        cin >> ba;
        if (ba == "是") {
            return 0;
        }
        else {
            goto cn_main;
        }
    }
    else if (comm == "输出") {
        cout << "Jvav>输出>";
        cin >> typ;
        cout << typ << endl;
        goto cn_main;
    }
    else if (comm == "输入") {
        cout << "Jvav>输入>";
        cin >> inputstr;
        goto cn_main;
    }
    else if (comm == "关于") {
        cout << "Jvav编程器,版本为1.2预览版3。\n这只是一个梗,但是我们依然把它变成了现实。最早是张浩洋提出的这个梗。\n该版本支持脱离jdk的运行(实际上更新需要)。\n该程序编写者为30266和johnvp22(做了一些说明和bug修复)。\n";
        goto cn_main;
    }
    else if (comm == "更新") {
        cout << "Jvav>更新>正在获取版本列表...\n";
        goto upgrade;
    }
    else if (comm == "语言") {
        cout << "请输入您要切换的语言(zh/en):";
        string lan;
        cin >> lan;
        if (lan == "zh") {
            goto cn_main;
        }
        else if (lan == "en") {
            system("cls");
            language = "English";
            goto en_main;
        }
        else {
            cout << "未知的语言。\n";
            goto cn_main;
        }
    }
    else {
        cout << "未知的命令!\n";
        goto cn_main;
    }
/*upgrade*/
    upgrade:
    system("java -jar upgrade.jar > upgrade.txt");
    ifstream readFile("upgrade.txt");
    int ret;
    readFile >> ret;
    readFile.close();
    if (ret == -1) {
        if (language == "English") {
            cout << "Jvav>upgrade>Error! The update failed! Because the version list cannot be obtained on the authentication server!\n";
            goto main;
        }
        else if (language == "简体中文") {
            cout << "Jvav>更新>错误!无法从认证服务器获取版本列表!\n";
            goto cn_main;
        }
    }
    else if (ret > 15) {
        if (language == "English") {
            cout << "Jvav>upgrade>Updated versionavailable for upgrades, please go to https://30266-official.github.io/updates/Jvav.zip download!\n";
            goto main;
        }
        else if (language == "简体中文") {
            cout << "有更新版本可供升级,请前往https://30266-official.github.io/updates/Jvav.zip下载!\n";
            goto cn_main;
        }
    }
    else if (ret == 15) {
        if (language == "English") {
            cout << "Congratulations! You've upgraded to the latest version!\n";
            goto main;
        }
        else {
            cout << "恭喜你!你已升级至最新版本!\n";
            goto cn_main;
        }
    }
    else {
        if (language == "English") {
            cout << "Jvav>upgrade>Error!We can't get a version list because your version is coming from a future version, so we don't support it.\n";
            goto main;
            cout << ret;
        }
        else if (language == "简体中文") {
            cout << "Jvav>更新>错误!我们无法获取版本列表,因为您的版本是来自未来的版本,故我们不提供支持。\n";
            goto cn_main;
        }
    }
}


回复

上一页1 页 / 共 1下一页
许某某呱呱呱X凌点编程许某某呱呱呱X凌点编程

点赞0


评论


霸道的疾风雀3KNp霸道的疾风雀3KNp

但是报错了

点赞0


评论


果断的木叶龙4_E1果断的木叶龙4_E1

。。。这明明是C++好吧

点赞0


评论