Store
Subscribe
I made rock paper scissors
Made rock paper scissors in C#. Not sure if people have done it before but I did it my own style. Hope you liked it lol.


Anonymous Quote

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RockPaperScissors
{
public partial class Form1 : Form
{
bool rock;
bool paper;
bool scissors;
bool nameRock;
bool namePaper;
bool nameScissors;
string actionText;
string botName;
int count = 4;
//int timerUpdate = 1;
Random rnd = new Random();

public Form1()
{
InitializeComponent();
timerName.Enabled = true;
}

private void radioButtonRock_CheckedChanged(object sender, EventArgs e)
{
rock = true;

paper = false;
scissors = false;
}

private void radioButtonPaper_CheckedChanged(object sender, EventArgs e)
{
paper = true;

rock = false;
scissors = false;
}

private void radioButtonScissors_CheckedChanged(object sender, EventArgs e)
{
scissors = true;

rock = false;
paper = false;
}

private void buttonOK_Click(object sender, EventArgs e)
{
if (radioButtonRock.Checked || radioButtonPaper.Checked ||
radioButtonScissors.Checked)
{
groupBoxRPS.Enabled = false;
radioButtonClear.Checked = true;
buttonExit.Focus();

int playerBot = rnd.Next(2);
// determining player bot's move
if (playerBot == 0)
{
nameRock = true;
namePaper = false;
nameScissors = false;

actionText = "rock";
}
else if (playerBot == 1)
{
namePaper = true;
nameRock = false;
nameScissors = false;

actionText = "paper";
}
else if (playerBot == 2)
{
nameScissors = true;
namePaper = false;
nameRock = false;

actionText = "scissors";


}

timer1.Enabled = true;
richTextBoxDisplay.Clear();
labelVictory.Text = ("");
}
else MessageBox.Show("Please select an object", "Error");
}

private void timer1_Tick(object sender, EventArgs e)
{

count–;
if (count >= 1)
richTextBoxDisplay.Text += count.ToString() + "…" + Environment.NewLine;


if (count == 0)
{
timer1.Enabled = false;

richTextBoxDisplay.Text += Environment.NewLine + botName + " bot" + " chose " +
actionText + "!";

timer1.Enabled = true;
count = 1;
count–;

if (count == 0)
{
timer1.Enabled = false;
// rock win/loses
if (rock && nameScissors)
labelVictory.Text = ("YOU WIN!!!");

else if (rock && namePaper)
labelVictory.Text = ("YOU LOSE :(");

// paper win/loses
else if (paper && nameRock)
labelVictory.Text = ("YOU WIN!!!");

else if (paper && nameScissors)
labelVictory.Text = ("YOU LOSE :(");

// scissors win/loses
else if (scissors && namePaper)
labelVictory.Text = ("YOU WIN!!!");

else if (scissors && nameRock)
labelVictory.Text = ("YOU LOSE :(");

else labelVictory.Text = ("TIE!!!");

count = 4;
groupBoxRPS.Enabled = true;
}
}
}

User Interface: http://prntscr.com/53ub8u
Outcome: http://prntscr.com/53ubur
 0
PM Link
1v1 me fukr
im 2010 ELO rock
 0
PM Link
im 2015 ELO Paper
 0
PM Link
Stop trying Majinn
 0
PM Link

Azpiring wrote

Stop trying Majinn

Majiinn got hacked you n0b remember? Its Vortaa now n0b (Thanks Archy for giving me another chance <3)
 0
PM Link

Vykz wrote

Azpiring wrote...


Majiinn got hacked you n0b remember? Its Vortaa now n0b (Thanks Archy for giving me another chance <3)


aye SupermanExtreme_
 0
PM Link

Azpiring wrote

Vykz wrote...



aye SupermanExtreme_

aye PvM_Buu
 0
PM Link

Tundrin wrote

Azpiring wrote...


aye PvM_Buu


Wait, what?
 0
PM Link
I like to scissor
 0
PM Link

Azpiring wrote

Vykz wrote...



aye SupermanExtreme_

aye Ezvoy
 0
PM Link

Tundrin wrote

Azpiring wrote...


aye PvM_Buu


@Niv that's not me…
 0
PM Link

Azpiring wrote

Tundrin wrote...



@Niv that's not me…

How did I know that you would go full retard on me :P
PvM_Buu is Vortaa's alt.
 0
PM Link

Tundrin wrote

Azpiring wrote...


How did I know that you would go full retard on me :P
PvM_Buu is Vortaa's alt.


Oh right, no wonder PvM_Buu is trash
 0
PM Link

Azpiring wrote

Tundrin wrote...



jk ily Vortaa
 0
PM Link

Azpiring wrote

Azpiring wrote...



I scissor my cat under the covers
 0
PM Link
ayye ima try and create this in java
might take really long because i started like a week ago, but w/e
 0
PM Link