Posts

Showing posts from 2020

Ludo In CPP

Image
Ludo In CPP code:   #include<iostream.h> #include<graphics.h> #include<conio.h> #include<stdlib.h> #include<dos.h> #include<time.h> static int csc=0;//static variable for counting 3 consecutive 6 //class for storing coordinates of circles where players will move class Position { private: int x,y; public: void setcoord(int x,int y){ this->x=x; this->y=y; } void display(int b){ setcolor(15); circle(x,y,10); if(b==1){ setfillstyle(SOLID_FILL,RED); floodfill(x,y,15); } if(b==2){ setfillstyle(SOLID_FILL,YELLOW); floodfill(x,y,15); } if(b==3){ setfillstyle(SOLID_FILL,GREEN); floodfill(x,y,15); } if(b==4){ setfillstyle(SOLID_FILL,BLUE); floodfill(x,y,15); } } }; //class for player with required properties class Player{ private: Position pos;//player has attribute of type class Position public: int posindex; int status; int homeway; Player(){ status=0; homeway=0; } void setposition(int pindex,Position p){ posindex=pindex; pos=p; } void di...