Nexclap

Rock Paper Scissors Game

This program will have a user play against a computer in a game of rock paper scissors.


rock = 0 paper = 1 scissors = 2 computerwin = 0 userwin = 0 tie = 0 choices = ["rock", "paper", "scissors"] print("Hi welcome to Royce's rock paper scissors game") for x in range (1,6,1): user = str(input("Rock, paper, or scissors?")) import random rand = random.randint(0,2) compchoice = choices[rand] if compchoice == choices[1]: if user == choices[rock]: print("The computer picked paper You lose sorry") computerwin = computerwin + 1 if user == choices[scissors]: print("You win the computer picked paper!") userwin = userwin + 1 if user == choices[paper]: print("oops you both picked paper go again!") tie = tie + 1 if compchoice == choices[2]: if user == choices[rock]: print("You win the computer picked scissors!") userwin = userwin + 1 if user == choices[paper]: print("The computer picked scissors you lose!") computerwin = computerwin + 1 if user == choices[scissors]: print("oops you both picked scissors go again!") tie = tie + 1 if compchoice == choices[0]: if user == choices[paper]: print("You win the computer picked rock") userwin = userwin + 1 if user == choices[scissors]: print("The computer picked rock you lose sorry") computerwin = computerwin + 1 if user == choices[rock]: print("oops you both picked rock go again!") tie = tie + 1 print("you picked " + user) print("the computer picked " + compchoice) print("you won " + str(userwin) + " games") print("the computer won " + str(computerwin) + " games") print("you both tied " + str(tie) + " games") print("thanks for playing")

Machine Learning Classification Model for Heart Disease Prediction from a Clinical Database

objectives: 1) To assist Cardiologist for better diagnosisat early 2) To develop a Robust machine learningmodel to predict Heart Disease with 99% Accuracy Outcome: experimented on clinical database and obtain 95.04% Accuracy

https://drive.google.com/file/d/1VOF2iu3wRINLTAZL7NsDDUrJN879nIaN/view?usp=sharing

C++ RPG Game

This is a game I made as part of my final project for my DVC computer science class. It contain all of the basic features of C++, including functions, arrays, and pointer variables.

// CPP Final Project by Kanishka Verose #include <iostream> #include <iomanip> #include <string> using namespace std; int oppo_choice() //Random Function { srand ( time(NULL) ); //initialize the random seed int oppo_opt[2] = {1, 2}; //Array int rand_choice = rand() % 2; int oppoc = oppo_opt[rand_choice]; return oppoc; } int main() { int choice, oppotype, oppo_health, oppo_magic, oppo_attack_power, player_health = 100, player_magic = 10, playchoice; //Menu: cout << "--------------------------------------------------------------------------------------------------------------\n"; cout << "Welcome to FinalBattle by Kanishka Verose. To start a battle type '1'. To quit type '0'.\n"; cout << "--------------------------------------------------------------------------------------------------------------\n"; cin >> choice; //If choice not within parameters: while (choice != 0 && choice != 1) { cout << "You must enter either a '1' to start or a '0' to quit.\n"; cin >> choice; } //QUIT condition if (choice == 0) { cout << "Quitting...\n"; return 0; } //START condition else { //Allow User to choose opponents with 3 set difficulties: cout << "Who do you want to battle? '1' for Thug (Easy Difficulty). '2' for Criminal (Medium Difficulty). '3' for Gangster(Hard Difficulty).\n"; cin >> oppotype; //Input Validation while (choice != 1 && choice != 2 && choice != 3) { cout << "You must enter either a '1', '2', or '3' to choose an opponent!\n"; cin >> oppotype; } //Opponent type Thug if (oppotype == 1) { int oppo_health = 50, oppo_magic = 10, oppo_attack_power = 5; cout << "You are battling the Thug!\n"; cout << "\nThe Battle has started!\n"; while (player_health > 0) { cout << "\nWhat will you do? '1' for attack or '2' for magic: \n"; cout << "Health is at " << player_health << ", magic is at " << player_magic << ".\n"; cout << "Opponent Health is at " << oppo_health << ", and magic is at " << oppo_magic << ".\n"; cin >> playchoice; if (playchoice == 1) { cout << "\nYou attack!\n"; oppo_health -= 10; } else if (playchoice == 2) { //If player uses magic if (player_magic > 0) { player_health += 10; player_magic -= 1; cout << player_magic << " magic left.\n"; } else { //If magic is insufficient for player cout << "Not enough magic!\n"; } } else { //Input Validation cout << "Input not valid, please enter a '1' or '2'."; cin >> playchoice; } int oppo_decis = oppo_choice(); //Call Opponent Function for Opponent choice if (oppo_decis == 1) { //If Opponent Attacks cout << "\nThe Opponent Attacks!\n"; player_health -= oppo_attack_power; } else { if (oppo_magic > 0) { //If Opponent Uses Magic: cout << "\nThe Opponent uses Magic!\n"; oppo_health -= oppo_magic; } else { //If Opponent magic is insufficient cout << "\nThe Opponent tried to use magic, but has none left!\n"; } } if (oppo_health == 0) { //Player wins by draining opponent's health cout << "\nYou win!\n"; cout << "Player has " << player_health << " left with " << player_magic << " left.\n"; return 0; } } if (player_health == 0) { //player loses by getting health drained cout << "\nGame Over!\n" ; return 0; } } else if (oppotype == 2) { //Opponent type criminal : Med int oppo_health = 100, oppo_magic = 5, oppo_attack_power = 10; cout << "You are battling the Criminal!\n"; cout << "The Battle has started!\n"; while (player_health > 0) { cout << "\nWhat will you do? '1' for attack or '2' for magic: \n"; cout << "Health is at " << player_health << ", magic is at " << player_magic << ".\n"; cout << "Opponent Health is at " << oppo_health << ", and magic is at " << oppo_magic << ".\n"; cin >> playchoice; if (playchoice == 1) { cout << "\nYou attack!\n"; oppo_health -= 10; } else if (playchoice == 2) { //If player uses magic if (player_magic > 0) { player_health += 10; player_magic -= 1; cout << player_magic << " magic left.\n"; } else { //If magic is insufficient for player cout << "Not enough magic!\n"; } } else { //Input Validation cout << "Input not valid, please enter a '1' or '2'."; cin >> playchoice; } int oppo_decis = oppo_choice(); //Call Opponent Function for Opponent choice if (oppo_decis == 1) { //If Opponent Attacks cout << "\nThe Opponent Attacks!\n"; player_health -= oppo_attack_power; } else { if (oppo_magic > 0) { //If Opponent Uses Magic: cout << "\nThe Opponent uses Magic!\n"; oppo_health -= oppo_magic; } else { //If Opponent magic is insufficient cout << "\nThe Opponent tried to use magic, but has none left!\n"; } } if (oppo_health == 0) { //Player wins by draining opponent's health cout << "\nYou win!\n"; cout << "Player has " << player_health << " left with " << player_magic << " left.\n"; return 0; } } if (player_health == 0) { //player loses by getting health drained cout << "\nGame Over!\n" ; return 0; } } else if (oppotype == 3) { //Opponent type Gangster: Hard int oppo_health = 150, oppo_magic = 0, oppo_attack_power = 20; cout << "You are battling the Gangster!\n"; cout << "The Battle has started!\n"; while (player_health > 0) { cout << "\nWhat will you do? '1' for attack or '2' for magic: \n"; cout << "Health is at " << player_health << ", magic is at " << player_magic << ".\n"; cout << "Opponent Health is at " << oppo_health << ", and magic is at " << oppo_magic << ".\n"; cin >> playchoice; if (playchoice == 1) { cout << "\nYou attack!\n"; oppo_health -= 10; } else if (playchoice == 2) { //If player uses magic if (player_magic > 0) { player_health += 10; player_magic -= 1; cout << player_magic << " magic left.\n"; } else { //If magic is insufficient for player cout << "Not enough magic!\n"; } } else { //Input Validation cout << "Input not valid, please enter a '1' or '2'."; cin >> playchoice; } int oppo_decis = oppo_choice(); //Call Opponent Function for Opponent choice if (oppo_decis == 1) { //If Opponent Attacks cout << "\nThe Opponent Attacks!\n"; player_health -= oppo_attack_power; } else { if (oppo_magic > 0) { //If Opponent Uses Magic: cout << "\nThe Opponent uses Magic!\n"; oppo_health -= oppo_magic; } else { //If Opponent magic is insufficient cout << "\nThe Opponent tried to use magic, but has none left!\n"; } } if (oppo_health == 0) { //Player wins by draining opponent's health cout << "\nYou win!\n"; cout << "Player has " << player_health << " left with " << player_magic << " left.\n"; return 0; } } if (player_health == 0) { //player loses by getting health drained cout << "\nGame Over!\n" ; return 0; } } } }
Announcements
  • Test Announcement from Nexclap

    Test message from nexclap - please ignore

    2023-02-13

  • Test message

    Test message from nexclap - please ignore

    2023-02-11

  • Test message

    Test message from nexclap - please ignore

    2023-02-11

  • View all