Posts

Showing posts from May, 2023

IPL 2023 Season Summary || Moments of IPL 2023

  -  GT vs CSK  - Tushar Deshpande, the first-ever impact sub, proves too expensive. Williamson tears his ACL -  LSG vs DC  - Mark Wood fifer decimates Delhi -  RCB vs MI  - Back at Chinnaswamy, RCB smash MI. Kohli and Faf both got fifties -  CSK vs LSG  - CSK win a high scoring thriller by 12 runs. The difference - Dhoni's two sixes at the death -  KKR vs RCB  - Visitors outdone by spin. Suyash Sharma gets 3 on debut. Varun takes 4 and Shardul scores a match-winning 50 -  MI vs CSK  - Welcome back, Ajinkya Rahane. Scores his fastest IPL fifty -  GT vs KKR  - The Rinku game. Nothi ng more to say -  RCB vs LSG  - Pooran, Stoinis chase down 212. Avesh throws his helmet. Gambhir shushes the crowd. Harshal's failed mankad attempt -  DC vs MI  - MI win off the final ball, running 2 runs. Although Nortje nails 6 out of 6 Yorkers -  RR vs CSK  - Vintage Dhoni almost wins CSK an improbable game, but Sandeep Sharma holds his nerve -  PBKS vs GT  - Tewatia sinks Punjab again. Welcome bac

Chess game

Chess Game ♖ ♙ ♙ ♖

C++ Program to create a Chess game

#include <iostream> #include <string> using namespace std; enum Color { WHITE, BLACK }; enum Type { NONE, PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING }; struct Piece {     Type type;     Color color; }; class ChessGame { public:     ChessGame();     void playGame(); private:     Piece board[8][8];     Color currentPlayer;     bool isGameOver;     void initBoard();     void printBoard() const;     bool handleMove(string move);     bool isValidMove(int srcRow, int srcCol, int destRow, int destCol) const;     bool isKingInCheck(Color color) const;     bool isStalemate(Color color) const;     bool isCheckmate(Color color) const;     void movePiece(int srcRow, int srcCol, int destRow, int destCol); }; ChessGame::ChessGame() {     initBoard();     currentPlayer = WHITE;     isGameOver = false; } void ChessGame::playGame() {     cout << "Welcome to chess!" << endl;     while (!isGameOver) {         printBoard();         if (isKingInCheck(currentPlayer)) {        

Chess code

#include #include using namespace std; enum Color { WHITE, BLACK }; enum Type { NONE, PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING }; struct Piece { Type type; Color color; }; class ChessGame { public: ChessGame(); void playGame(); private: Piece board[8][8]; Color currentPlayer; bool isGameOver; void initBoard(); void printBoard() const; bool handleMove(string move); bool isValidMove(int srcRow, int srcCol, int destRow, int destCol) const; bool isKingInCheck(Color color) const; bool isStalemate(Color color) const; bool isCheckmate(Color color) const; void movePiece(int srcRow, int srcCol, int destRow, int destCol); }; ChessGame::ChessGame() { initBoard(); currentPlayer = WHITE; isGameOver = false; } void ChessGame::playGame() { cout << "Welcome to chess!" << endl; while (!isGameOver) { printBoard(); if (isKingInCheck(currentPlayer)) {

Popular posts from this blog

Diagonal Relationship between Beryllium and Aluminium || Relation between Beryllium and Aluminium

KVS CBSE Worksheets CHAPTER 1 Electric Charges and Fields Class 12

S-Block Elements || S-block element class 11 chapter 8 || Group 1A, 2A elements || S block elements chapter 8 notes class 11 || Chemistry ||

Kinematics Important Questions Of Physics

QUANTUM NUMBERS (Principal, Azimuthal, Magnetic and Spin)