using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
StringBuilder input = new StringBuilder(textBox1.Text);
StringBuilder yahoo = new StringBuilder();
if (input.Length == 11)
{
yahoo = input.Remove(4, 7);
switch (yahoo.ToString())
{
case "0906":
label1.Text = "GLBOE";
break;
case "0927":
label1.Text = "GLBOE";
break;
case "0926":
label1.Text = "GLBOE";
break;
case "0915":
label1.Text = "GLBOE";
break;
case "0917":
label1.Text = "GLBOE";
break;
case "0905":
label1.Text = "GLBOE";
break;
case "0916":
label1.Text = "GLBOE";
break;
case "0978":
label1.Text = "smart";
break;
case "0909":
label1.Text = "smart";
break;
case "0919":
label1.Text = "smart";
break;
case "0920":
label1.Text = "smart";
break;
case "0921":
label1.Text = "smart";
break;
case "0908":
label1.Text = "smart";
break;
case "0922":
label1.Text = "sun";
break;
case "0923":
label1.Text = "sun";
break;
case "0933":
label1.Text = "sun";
break;
case "0932":
label1.Text = "sun";
break;
case "0935":
label1.Text = "TM";
break;
default:
label1.Text = "wrong answer";
break;
}
}
else
MessageBox.Show("yahoo");
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace palindrome
{
class Program
{
public static string ReverseString(string str)
{
if (str == null || str.Length <= 1)
{
return str;
}
StringBuilder revStr = new StringBuilder(str.Length);
for (int count = str.Length - 1; count > -1; count--)
{
revStr.Append(str[count]);
}
return revStr.ToString();
}
public static void Main()
{
string temp = "";
do
{
Console.WriteLine("Enter String");
temp = Console.ReadLine();
Console.WriteLine(ReverseString(temp));
}
while (temp != (ReverseString(temp)));
{
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void lblPlayer_Click(object sender, EventArgs e)
{
}
private void btnDraw_Click(object sender, EventArgs e)
{
}
private void lblComp1_Click(object sender, EventArgs e)
{
}
private void lblComp2_Click(object sender, EventArgs e)
{
}
private void btnPass_Click_1(object sender, EventArgs e)
{
Random random = new Random();
int rndNum1 = random.Next(1, 14);
int rndNum2 = random.Next(1, 14);
lblComp1.Text = rndNum1.ToString();
lblComp2.Text = rndNum2.ToString();
}
private void Form1_Load(object sender, EventArgs e)
{
Random random = new Random();
int rndNum3 = random.Next(1, 14);
int rndNum4 = random.Next(1, 14);
lblComp1.Text = rndNum3.ToString();
lblComp2.Text = rndNum4.ToString();
}
private void btnDraw_Click_1(object sender, EventArgs e)
{
Random random = new Random();
int rndNum5 = random.Next(1, 14);
lblPlayer.Text = rndNum5.ToString();
}
private void btnExit_Click(object sender, EventArgs e)
{
MessageBox.Show("Do you want to play again?", "In Between", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
this.Close();
}
private void btnPass_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r')
{
btnDraw_Click(null, null);
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
StringBuilder tok = new StringBuilder(textBox1.Text);
StringBuilder burac = new StringBuilder(textBox2.Text);
if (checkBox1.Checked == true)
{
tok.Append(burac);
label1.Text = tok.ToString();
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btndraw_Click(object sender, EventArgs e)
{
int input;
if (txtinput1.Text == "")
{
MessageBox.Show("Enter a number from 1-9", "Lucky 9 ", MessageBoxButtons.OK, MessageBoxIcon.Error);
SendKeys.Send("{Home}+{End}");
txtinput1.Focus();
}
else
{
if (Int32.TryParse(txtinput1.Text, out input))
{
if (input > 9 || input <0) {
MessageBox.Show("Number's from 0-9 only", "Lucky 9 ", MessageBoxButtons.OK, MessageBoxIcon.Error);
SendKeys.Send("{Home}+{End}");
txtinput1.Focus();
}
else
{
Random rnd = new Random();
int random = rnd.Next(10);
lblout.Text = random.ToString();
if (input > random)
{
lblout2.Text = "You Win";
}
else if (input<random)
{
lblout2.Text = "You Lose!";
}
else
{
lblout2.Text = "DRAW!";
}
}
}
else
{
MessageBox.Show("Please enter number's from 0-9 only", "Lucky 9 ", MessageBoxButtons.OK, MessageBoxIcon.Error);
SendKeys.Send("{Home}+{End}");
txtinput1.Focus();
}
}
}
private void btn_Click(object sender, EventArgs e)
{
lblout.Text = "";
lblout2.Text = "";
txtinput1.Text = "";
SendKeys.Send("{Home}+{End}");
txtinput1.Focus();
}
private void btnexit_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are Your Sure?", "Lucky 9 ", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
this.Close();
}
private void txtinput1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r')
{
btndraw_Click(null, null);
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace RockPaperScissors
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label5_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure you want to exit?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
Close();
}
}
private void button2_Click(object sender, EventArgs e)
{
picCom.Image = null;
picYou.Image = null;
rdbPaper.Checked = false;
rdbRock.Checked = false;
rdbSci.Checked = false;
lblOutput.ResetText();
}
private void btnDraw_Click(object sender, EventArgs e)
{
if (rdbPaper.Checked == false && rdbRock.Checked == false && rdbSci.Checked == false)
{
MessageBox.Show("No Input Detected..", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else if (rdbPaper.Checked)
{
picYou.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Paper.png");
Random random = new Random();
switch (random.Next(1, 4))
{
case 1:
picCom.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Paper.png");
lblOutput.Text = "Draw";
break;
case 2:
picCom.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Scissors.png");
lblOutput.Text = "You Lose";
break;
default:
picCom.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Rock.png");
lblOutput.Text = "You Win";
break;
}
}
else if (rdbSci.Checked)
{
picYou.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Scissors.png");
Random random = new Random();
switch (random.Next(1, 4))
{
case 1:
picCom.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Paper.png");
lblOutput.Text = "You Win";
break;
case 2:
picCom.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Scissors.png");
lblOutput.Text = "Draw";
break;
default:
picCom.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Rock.png");
lblOutput.Text = "You Lose";
break;
}
}
else if (rdbRock.Checked)
{
picYou.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Rock.png");
Random random = new Random();
switch (random.Next(1, 4))
{
case 1:
picCom.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Paper.png");
lblOutput.Text = "You Lose";
break;
case 2:
picCom.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Scissors.png");
lblOutput.Text = "You Win";
break;
default:
picCom.Image = new Bitmap(@"C:\Users\ALB-4.ALB4-PC\Pictures\Rock.png");
lblOutput.Text = "Draw";
break;
}
}
}
private void picYou_Click(object sender, EventArgs e)
{
}
}
}