Skip to content

abhishek-0713/swiggy-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

swiggy-assignment - Multiplayer Card Game

Swiggy Round 1 coding test

How to Play the Game :

  1. Download and install an IDE such as Eclipse or IntelliJ IDEA.

  2. Clone or download the project from the source repository.

  3. Open the IDE and import the project into the workspace.

  4. Resolve any project dependencies and ensure that the JDK is installed and configured.

  5. Open the main class, which is likely to be called Main .

  6. Right-click on the main class and select "Run as" > "Java Application" from the context menu.

  7. The application should start running, and you can interact with it from the console or user interface, depending on how the application is designed.

Clone Here :

https://github.com/abhishek-0713/swiggy-assignment.git

Sample Output:


Enter number of players: 2

Enter name of player 1: Abhi
Enter name of player 2: Subhi

Top card: 4 of Spades
Abhi's turn:
Your hand:
3: 7 of Spades
4: 6 of Spades
Enter the index of the card you want to play: 
4
Abhi played 6 of Spades
Top card: 6 of Spades

Subhi's turn:
Your hand:
0: 6 of Hearts
1: 3 of Spades
3: Ace of Spades
Enter the index of the card you want to play: 
1
Subhi played 3 of Spades
Top card: 3 of Spades

Abhi's turn:
Your hand:
0: 3 of Hearts
2: 3 of Diamonds
3: 7 of Spades
Enter the index of the card you want to play: 
3
Abhi played 7 of Spades
Top card: 7 of Spades

Subhi's turn:
Your hand:
2: Ace of Spades
Enter the index of the card you want to play: 
2
Subhi played Ace of Spades
Reverse direction
Top card: Ace of Spades

Subhi's turn:
Subhi has no valid moves.
Top card: Ace of Spades
Subhi's turn:
Subhi has no valid moves.
Top card: Ace of Spades

Subhi's turn:
Your hand:
4: King of Spades
Enter the index of the card you want to play: 
4
Subhi played King of Spades
Top card: King of Spades

Abhi's turn:
Your hand:
1: King of Diamonds
Enter the index of the card you want to play: 
1
Abhi played King of Diamonds
Top card: King of Diamonds

Subhi's turn:
Your hand:
3: 6 of Diamonds
Enter the index of the card you want to play: 
3
Subhi played 6 of Diamonds
Top card: 6 of Diamonds

Abhi's turn:
Your hand:
1: 3 of Diamonds
Enter the index of the card you want to play: 
1
Abhi played 3 of Diamonds
Top card: 3 of Diamonds

Subhi's turn:
Subhi has no valid moves.
Top card: 3 of Diamonds

Subhi's turn:
Your hand:
3: Ace of Diamonds
Enter the index of the card you want to play: 
3
Subhi played Ace of Diamonds
Reverse direction
Top card: Ace of Diamonds

Subhi's turn:
Subhi has no valid moves.
Top card: Ace of Diamonds

Subhi's turn:
Your hand:
3: Ace of Hearts
Enter the index of the card you want to play: 
3
Subhi played Ace of Hearts
Reverse direction
Top card: Ace of Hearts

Subhi's turn:
Your hand:
0: 6 of Hearts
1: 5 of Hearts
Enter the index of the card you want to play: 
1
Subhi played 5 of Hearts
Top card: 5 of Hearts

Abhi's turn:
Your hand:
0: 3 of Hearts

Enter the index of the card you want to play: 
0

Abhi played 3 of Hearts

Abhi wins!
Congratulations, Abhi has won!

About

Swiggy Round 1 coding test

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages