Giter Site home page Giter Site logo

vit-softwaredev's Introduction

VIT-SoftwareDev

Problem Statement:
https://docs.google.com/document/d/16CNXNQ-VLLSoVe7CvJFBzueawgrCjWorB7zMLNvOF94/edit?usp=sharing #include <bits/stdc++.h> using namespace std;

\two players black and white bool whiteWins(int rowW, int colW, int rowB, int colB) { int white = 0, black = 0;

while (1) { 

    // If white can move 
    if (rowW != 5) { 

        // If white pawn can kill black pawn 
        // White wins 
        if (rowB == rowW + 1 
            && (colB == colW - 1 || colB == colW + 1)) 
            return true; 

        // Make the move forward 
        else
            rowW++; 
    } 

    // White has no moves 
    // White loses 
    else
        return false; 

    // If black can move 
    if (rowB != 1) { 

        // If black pawn can kill white pawn 
        // White loses 
        if (rowB == rowW + 1 
            && (colB == colW - 1 || colB == colW + 1)) 
            return false; 

        // Make the move forward 
        else
            rowB--; 
    } 

    // Black has no moves 
    // White wins 
    else
        return true; 
} 

// If white has got more moves 
if (white > black) 
    return true; 

return false; 

}

// Driver code int main() { int rowW = 2, colW = 2, rowB = 3, colB = 3; if (whiteWins(rowW, colW, rowB, colB)) cout << "White"; else cout << "Black"; return 0; }

vit-softwaredev's People

Contributors

mrmackeymkay avatar originator99 avatar siddhartharora007 avatar kashyap avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.