diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index ebea2e5..f0f0f49 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -7,29 +7,16 @@ on: branches: [ "Preview" ] jobs: - linux-pre: + linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: build-linux-pre + - name: build-linux run: make working-directory: src/ - name: Build Preview MCT-Linux uses: actions/upload-artifact@v3.1.2 with: - name: MCT-Linux-Pre - path: src/MCT-Linux - - windows-pre: - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: build-windows-pre - run: g++ MCT-Windows.cpp -o MCT-Windows.exe - working-directory: src/Preview - - name: Build Preview MCT-Windows - uses: actions/upload-artifact@v3.1.2 - with: - name: MCT-Windows.exe - path: src/MCT-Windows + name: MCT-Pre + path: src/MCT diff --git a/README.md b/README.md index 0a7ad71..ba73194 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- +

MathCentralTool

@@ -24,35 +24,21 @@ [🀄简体中文](/README_zh.md) | 🔠[English](/README.md) ## 📃Introduce -A terminal-based math gadget that doesn't seem to be of any use. +A terminal-based math tool that runs on linux. -This program is free and open source, this source code can be used at will. We allow everyone to use the source code for enrichment, compilation, etc. But we don't take any responsibility for any problems! +This program is free and open source. We allow everyone to use the source code for enrichment, compilation, etc. But we don't take any responsibility for any problems! -⚠note: This program is in the development stage and cannot be used for scientific precision calculations! If anything goes wrong, do so at your own risk! +⚠worn: This program is in developing and cannot be used for scientific precision calculations! If anything goes wrong, do so at your own risk! ## ❔How to use -Look for the version in GitAction that matches your device +Look in the GitAction and choose you need. -Or clone and compile by yourself, but the source code of Linux and Windows is not the same, this needs to be noted! +Or clone and compile by yourself. -📦Linux compilation environment requirements: make, gcc +📦Compilation environment requirements: make, gcc -### 🐧Linux - -Stable - -Please open the terminal under src/stable and run "make" to compile. - -Preview - -Please open the terminal under src/stable and run "make" to compile. - -### 💠Windows - -Compile the cpp file yourself using the compiler. - -## 🧑‍💻Contributing people +## 🧑‍💻Contribution and thanks [FTS427](https://github.com/FTS427) responsible for the entire project @@ -62,6 +48,7 @@ Compile the cpp file yourself using the compiler. Thank every developer very much for their help!👍 -## 👀Othres things +## 👀Other +This project also powered by [ECCPH](https://github.com/QuantumLS-Studio/ECCPH) -See for older versions[MathCentralTools](https://github.com/FTS427/MathCentralTools)(Archived🗃️) +Old versions[MathCentralTools](https://github.com/FTS427/MathCentralTools)(Archived🗃️) diff --git a/README_zh.md b/README_zh.md index ab446ed..dddeb55 100644 --- a/README_zh.md +++ b/README_zh.md @@ -17,8 +17,6 @@ [![Stable](https://img.shields.io/github/actions/workflow/status/QuantumLS-Studio/MathCentralTool/stable-build.yml?label=Stable&style=for-the-badge "Stable")](https://github.com/QuantumLS-Studio/MathCentralTool/actions/workflows/stable-build.yml) [![Preview](https://img.shields.io/github/actions/workflow/status/QuantumLS-Studio/MathCentralTool/preview-build.yml?label=Preview&style=for-the-badge "Preview")](https://github.com/QuantumLS-Studio/MathCentralTool/actions/workflows/preview-build.yml) -![C++](https://img.shields.io/badge/c++-4B0082?style=for-the-badge&logoColor=white) - ![邮箱](https://img.shields.io/badge/邮箱-fts427%40outlook.com-4169E1?style=for-the-badge&logoColor=white) @@ -27,7 +25,7 @@ ## 📃介绍 -一个似乎没有什么用的基于终端的数学小工具。 +一个基于终端的数学小工具。 本程序是免费开源的,此源代码可以随意使用。允许任何人使用源代码进行扩充,编译等操作。出现任何问题,本人不承担任何责任! @@ -37,25 +35,11 @@ 在GitAction中寻找符合自己设备的版本 -或自行拉取编译,但Linux和Windows的源代码不一样,注意! +或自行拉取编译 📦编译环境需求(Linux):make,gcc -### 🐧Linux - -Stable - -请在src/Stable下打开终端,执行“make“即可编译 - -Preview - -请在src/Preview下打开终端,执行“make“即可编译 - -### 💠Windows - -自行使用编译器编译cpp文件 - -## 🧑‍💻贡献人员 +## 🧑‍💻感谢 [FTS427](https://github.com/FTS427)负责了整个项目 @@ -67,4 +51,6 @@ Preview ## 👀其他 +本项目使用了头文件[ECPPH](https://github.com/QuantumLS-Studio/ECPPH) + 先前的版本参见[MathCentralTools](https://github.com/FTS427/MathCentralTools)(已归档🗃️) diff --git a/change_log.md b/change_log.md new file mode 100644 index 0000000..b1571df --- /dev/null +++ b/change_log.md @@ -0,0 +1,77 @@ +# 数学集成工具 + +> 注:本更新日志从 v0.0.0.7 开始使用 + +先前的版本参见[MathCentralTools](https://github.com/FTS427/MathCentralTools)(已归档) + +## Stable + +- v0.0.0.7 : + - 功能 : 未更新 + - UI : 微调 , 修复小Bug + - 整体 : 修复小问题 , 简化代码 , 判断方式更新 , 减少无用死循环 +- v0.0.0.8 : + - 功能 : 添加了对乘方的支持 + - UI : "计算器"UI部分更改 + - 整体 : 简化代码(函数) +- v0.0.0.9 : + - 功能 : 未更新 + - UI : 部分更改 + - 整体 : 更新日志采用“MarkDown”文档 +- v0.0.1.0 + - 功能:增加"About" , UI模块 + - UI:部分大改 + - 整体:部分已知Bug修复,代码模块化,简化 +- v0.0.1.1 + - 功能 : 未更新 + - UI:部分更改 + - 整体:部分已知Bug修复,代码简化 +- v0.0.1.2 + - 功能 : 未更新 + - UI:部分更改 + - 整体:部分已知Bug修复,代码简化,引用了“ECPPH”头文件辅助开发 + +## Preview + +> 注:原有的“Insider”于2023年7月8日更名为“Preview” + +- v0.0.0.8-Alpha + - 功能:添加了对乘方的支持 + - UI:未更新 + - 整体:添加了输出函数“print”,简化代码(函数) +- v0.0.1.0-Alpha + - 功能:添加了”设置“部分(未启用)和”清屏“clear()部分 + - UI:部分小更改 + - 整体:运算更新,简化代码(函数) +- v0.0.1.0-Beta-01 + - 功能:增加了”EEOER“函数,报错结构更容易,程序模块化 + - UI:部分区域更改 + - 整体:简化代码,部分已知Bug修复 +- v0.0.1.0-Beta-02 + - 功能:增加显示版本号的功能 + - UI:部分修复 + - 整体:部分已知Bug修复 +- v0.0.1.0-Beta-03 + - 功能:增加显示的“关于”功能 + - UI:部分大改 + - 整体:部分已知Bug修复,代码模块化,简化 +- v0.0.1.0-Beta-04(v0.0.1.0) + - 功能:增加UI模块 + - UI:部分大改 + - 整体:部分已知Bug修复,代码模块化,简化 +- v0.0.1.1-Alpha + - 功能:未更新 + - UI:部分更改 + - 整体:部分已知Bug修复,代码简化 +- v0.0.1.2-Alpha + - 功能:增加“几何”功能 + - UI:未更新 + - 整体:部分微调 +- v0.0.1.2-4-Pre + - 功能:未更新 + - UI:大改界面 + - 整体:引用了“ECPPH”头文件,整体代码逻辑修改,更便于维护 +- v0.0.1.3-3 + - 功能:移除对Windows、Mac平台的支持 + - UI:部分微调 + - 整体:简化代码逻辑,便于维护 diff --git a/src/linux/MCT-Linux b/src/MCT-Linux similarity index 91% rename from src/linux/MCT-Linux rename to src/MCT-Linux index 737ce6b..37f0c68 100755 Binary files a/src/linux/MCT-Linux and b/src/MCT-Linux differ diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..65e2fa2 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,2 @@ +MCT-Build: main.cpp + g++ main.cpp -o ../bin/MCT diff --git a/src/linux/Makefile b/src/linux/Makefile deleted file mode 100644 index 40e6774..0000000 --- a/src/linux/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -MCT-Linux-Build: MCT-Linux.cpp - g++ MCT-Linux.cpp -o MCT-Linux diff --git a/src/linux/MCT-Linux.cpp b/src/main.cpp similarity index 99% rename from src/linux/MCT-Linux.cpp rename to src/main.cpp index 40a31ab..66a9391 100644 --- a/src/linux/MCT-Linux.cpp +++ b/src/main.cpp @@ -1,6 +1,6 @@ //Preview, be careful -#include "../head/ECPPH.h" +#include "./head/ECPPH.h" #include char q; diff --git a/src/win/MCT-Windows.cpp b/src/win/MCT-Windows.cpp deleted file mode 100644 index 4d8435f..0000000 --- a/src/win/MCT-Windows.cpp +++ /dev/null @@ -1,254 +0,0 @@ -//此版本为Preview测试版,有不稳定功能和不完整功能 - -#include "ECPPH.h" - -char q; - -void hy(const char T[]){cout<<"欢迎使用"<> num1 >> o >> num2; - //加 - if (o == '+') - cout << num1 << "+" << num2 << "=" << num1 + num2 << endl; - //减 - else if (o == '-') - cout << num1 << "-" << num2 << "=" << num1 - num2 << endl; - //乘 - else if (o == '*') - cout << num1 << "*" << num2 << "=" << num1 * num2 << endl; - //除 - else if (o == '/'){ - if (num2 == 0) - error(); - else - cout << num1 << "/" << num2 << "=" << num1/num2 << endl; - } - //乘方 - else if (o == '^') { - int n=num2; - if (num1 == 0 && num2 == 0) - error(); - else { - num3 = 1; - while (num2 > 0) { - num3 *= num1; - num2--; - } - } - cout << num1 << "^" << n << "=" << num3 << endl; - } - //退出 - else if(o == 'c' && num1 == 0 && num2 ==0){ - clear(1); - break; - } - //报错 - else - error(); - } -} - -//B函数,计算最大公约数 -void B(){ - clear(1); - double num3, num4; - hy("最大公约数"); - print("\033[1;43;37m注意\033[0m:本功能只支持两个数之间的运算!","no",true); - while(true){ - line("-",20,"yellow"); - print("输入任意值继续,输入\033[33;1mC\033[0m退出...","no",true); - cin >> q; - if(q == 'c' || q == 'C'){ - clear(1); - break; - } - else{ - print("请输入第一个数:","white",true); - cin >> num3; - print("请输入第二个数:","white",true); - cin >> num4; - num3 = abs(num3); - num4 = abs(num4); - while (num3 != num4){ - if (num3 > num4) - num3 -= num4; - else - num4 -= num3; - } - cout << "这两个数的的最大公约数是: " << num3 + num4 << endl; - } - } -} - -//C函数,计算最小公倍数 -void C(){ - clear(1); - hy("最小公倍数"); - print("\033[1;43;37m注意\033[0m:本功能只支持两个数之间的运算!","no",true); - while(true){ - line("-",20,"yellow"); - print("输入任意值继续,输入\033[33;1mC\033[0m退出...","no",true); - cin >> q; - if(q == 'c' || q == 'C'){ - clear(1); - break; - } - else{ - int n3; - double num5, num6; - while (true){ - print("请输入第一个数:","white",true); - cin >> num5; - print("请输入第二个数:","white",true); - cin >> num6; - if (num5 != int(num5) || num6 != int(num6)) - error(); - else - break; - } - n3 = (num5 > num6) ? num5 : num6; - while (true){ - if (n3 % int(num5) == 0 && n3 % int(num6) == 0){ - cout << "这两个数的的最小公倍数是:" << n3 << endl; - break; - } - else - ++n3; - } - } - } -} - - -//D函数,数值分析器 -void D(){ - clear(1); - long double x, a; - hy("数值分析器"); - while(true){ - line("-",20,"yellow"); - print("输入任意值继续,输入\033[1;33mC\033[0m退出...","no",true); - cin >> q; - if (q == 'c' || q == 'C'){ - clear(1); - break; - } - else{ - print("请输入一个数:","blue",true); - cin >> x; - if (x == 0){ - cout << x << "是整数" << endl; - cout << x << "是正数" << endl; - cout << x << "不分质数合数" << endl; - cout << x << "是偶数" << endl; - } - else{ - if (modf(x, &a) == 0.0) - cout << x << "是整数" << endl; - else - cout << x << "是分数" << endl; - if (x > 0) - cout << x << "是正数" << endl; - else - cout << x << "是负数" << endl; - if (x == 1) - cout << x << "不分质数合数" << endl; - else if (int(x) - x != 0) - cout << x << "不分质数合数" << endl; - else{ - int n=0, i; - for(i=2;i0) - cout << x << "是合数" << endl; - else - cout << x << "是质数" << endl; - } - if (int(x) == x){ - if (int(x) % 2 == 0) - cout << x << "是偶数" << endl; - else - cout << x << "是奇数" << endl; - } - else{ - if (x/2 - int(x)/2 == 0) - cout << x << "是偶数" << endl; - else - cout << x << "是奇数" << endl; - } - } - } - } -} - -//E函数,几何计算 -void E(){ - hy("几何计算"); - while(true){ - line("-",20,"yellow"); - print("输入任意键继续,输入“\033[1;33mc\033[0m”退出...","no",true); - cin >> q; - if (q == 'c' || q == 'C'){ - clear(1); - break; - } - else{ - //矩形 梯形 三角形 圆 面积,周长,体积 - } - } -} - -//主函数 -int main(){ - clear(1); - hy("集成数学工具"); - char u; - while(true){ - line("-",20,"yellow"); - dash("\033[1;34m(1)\033[34m计算器\033[0m"); - dash("\033[1;35m(2)\033[35m最大公约数\033[0m"); - dash("\033[1;36m(3)\033[36m最小公倍数\033[0m"); - dash("\033[1;32m(4)\033[32m数值分析器\033[0m"); - dash("\033[1;33m(5)\033[33m几何\033[0m"); - dash("\033[0m(a)关于\033[0m"); - dash("\033[1;33m(e)退出\033[0m"); - print("请键入所需功能:","white",false); - cin >> u; - if (u=='1') - calc(); - else if (u=='2') - B(); - else if (u=='3') - C(); - else if (u=='4') - D(); - else if (u=='5') - E(); - else if (u=='E'||u=='e') - break; - else if (u=='A'||u =='a'){ - clear(1); - line("=",20,"blue"); - dash("MCT Preview v0.0.1.2-4"); - dash("Made by QuantumLS-Studio"); - dash("Github:https://github.com/QuantumLS-Studio/MathCentralTool"); - line("=",20,"blue"); - } - else - error(); - } - return 0; -}