12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
// Rock_Paper_Scissors.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdio.h> int _tmain(int argc, _TCHAR* argv[]) { char choice, player1, player2; do { printf("Welcome to Rock - Papper - Scissors.\n"); printf("PLAYER 1\nPlease enter:\nR for Rock\nP for Papper\nS for Scissors\n"); scanf("%c", &player1); printf("PLAYER 2\nPlease enter:\nR for Rock\nP for Papper\nS for Scissors\n"); scanf("%c", &player2); //Ties!!! if (((player1 == 'r') || (player1 == 'R')) && ((player2 == 'r') || player2 == 'R')); { printf("TIE!!!"); } if (((player1 == 'p') || (player1 == 'P')) && ((player2 == 'p') || player2 == 'P')); { printf("TIE!!!"); } if (((player1 == 's') || (player1 == 'S')) && ((player2 == 's') || player2 == 'S')); { printf("TIE!!!"); } //Player 1 Wins!!! if (((player1 == 'r') || (player1 == 'R')) && ((player2 == 's') || player2 == 'S')); { printf("Player 1 Wins!!!"); } if (((player1 == 's') || (player1 == 'S')) && ((player2 == 'p') || player2 == 'P')); { printf("Player 1 Wins!!!"); } if (((player1 == 'p') || (player1 == 'P')) && ((player2 == 'r') || player2 == 'R')); { printf("Player 1 Wins!!!"); } //Player 2 Wins!!! if (((player2 == 'r') || (player2 == 'R')) && ((player1 == 's') || player1 == 'S')); { printf("Player 2 Wins!!!"); } if (((player2 == 's') || (player2 == 'S')) && ((player1 == 'p') || player1 == 'P')); { printf("Player 2 Wins!!!"); } if (((player2 == 'p') || (player2 == 'P')) && ((player1 == 'r') || player1 == 'R')); { printf("Player 2 Wins!!!"); } //Loop printf("Would you like to play again?\nPlease enter:\nY for Yes\nN for NO"); scanf("%c", &choice); if(choice == 'N' || choice == 'n') { printf("Good Bye!\n"); break; } }while(choice != 'N' || choice != 'n'); return 0; }
" %c"