From 60786fdee0a80a0cd0303358d75122141838920e Mon Sep 17 00:00:00 2001 From: Gaminee Ram <54733618+Gaminee@users.noreply.github.com> Date: Sat, 30 Oct 2021 10:12:21 +0530 Subject: [PATCH] Create MemoryGame.cpp Simple memory game built in c++ --- MemoryGame.cpp | 277 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 MemoryGame.cpp diff --git a/MemoryGame.cpp b/MemoryGame.cpp new file mode 100644 index 0000000..7479f2e --- /dev/null +++ b/MemoryGame.cpp @@ -0,0 +1,277 @@ +#include +#include +#include +#include +#include +using namespace std; +class game +{ + bool ans; + char comma,a; + int q,m,n; + int i,j,row,col,x; + + int r1, c1, r2, c2,cards[100][100]; +public: + void getdata() + { + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),11); + cout<>m; + cout<<"Enter no of rows: "; + cin>>n; + cout<>r1>>comma>>c1; + cout<<"Please insert the second card row and column seperated by a comma:\n"; + cin>>r2>>comma>>c2; + //fix + r1--; + c1--; + r2--; + c2--; + } + //reveal + void reveal() + { + cout<>x; + // int i,j,row,col,x,cards[100][100]; + for(i=0;i"<>a; + if(a=='Y'||a=='y') + { + goto A; + } + else + { + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),11); + cout<