diff --git a/.vscode/settings.json b/.vscode/settings.json index 2c4cf1d..fb4d0bb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -60,5 +60,6 @@ "cinttypes": "cpp", "typeinfo": "cpp", "strstream": "cpp" - } + }, + "C_Cpp.errorSquiggles": "enabledIfIncludesResolve" } \ No newline at end of file diff --git a/C++/scripts/md5 b/C++/scripts/md5 index 5520048..da48c26 100644 --- a/C++/scripts/md5 +++ b/C++/scripts/md5 @@ -1,7 +1,7 @@ build.sh:c073187e65d0e23aa77aa94af4ec6382 - commit.sh:1af81bf417dfb932284d8a14fdd10657 - -debug.sh:849488515cab075948653c15eec4177b - +debug.sh:8125f303032b6cbc137223df63d10096 - lines.sh:3b907786f7fc9204025993016c9080de - -release.sh:0ab321c3fa2f1a1b2f03b1aec3bce816 - +release.sh:b1ce8461a303e8e7aa9ed74259db3873 - temp:d41d8cd98f00b204e9800998ecf8427e - -web.sh:4bbe9c5710a0ae4289468c3f7f340ff1 - +web.sh:dd7eec9825587db99063877da2839506 - diff --git a/C++ProjectTemplate b/C++ProjectTemplate index c678470..29534df 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/main.cpp b/main.cpp index dbb67ae..4191b9d 100644 --- a/main.cpp +++ b/main.cpp @@ -1,4 +1,5 @@ #include "pixelGameEngine.h" +#include "utils.h" using namespace olc; @@ -60,9 +61,8 @@ struct Data{ int main() { - Example demo; - if (demo.Construct(640, 480, 4, 4)) - demo.Start(); - + utils::PowMod(5,117,19); + utils::PowMod(5,117,19); + std::cout<<"Works!"< + +std::maputils::mapping; + +int utils::PowMod(int a,int b, int mod){ + int shift=0; + for(int n=1;n<=b;n*=2){ + if(utils::mapping.find({a,n,mod})!=utils::mapping.end()){ + std::cout< +#include + +namespace internal{ + struct PowModStruct{ + int a,b,mod; + friend std::ostream& operator << (std::ostream& os, const internal::PowModStruct& rhs) { os << rhs.a << "^" << rhs.b << "%" << rhs.mod; return os; }; + bool operator<(const internal::PowModStruct&rhs)const{return amapping; + public: + //a^b % mod + static int PowMod(int a,int b,int mod); +}; \ No newline at end of file