Codigo para programa de juego adivina tres numeros

Solo disponible en BuenasTareas
  • Páginas : 2 (256 palabras )
  • Descarga(s) : 0
  • Publicado : 10 de abril de 2010
Leer documento completo
Vista previa del texto
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 adivinatresveces
{
public partial class Form1 : Form
{



public Form1()
{
InitializeComponent();Random num = new Random();
int guessa = num.Next(1, 25);
valora = guessa ;
int guessb = num.Next(1, 25);
valorb = guessb;
intguessc = num.Next(1, 25);
valorc = guessc;
this.label4.Text = guessa.ToString();
this.label5.Text = guessb.ToString();
this.label6.Text =guessc.ToString();
this.textBox1.KeyPress += new
System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);


}

int valora, valorb, valorc,c;private void verificarguess(int n)
{

if ((valora == n) || (valorb == n) || (valorc == n))
if (valora == n){
label1.Text = this.valora.ToString();
c++;
this.numericUpDown1.Value++;
}
else if (valorb ==n)
{
label2.Text = this.valorb.ToString();
c++;
this.numericUpDown1.Value++;
}else if (valorc == n)
{
label3.Text = this.valorc.ToString();
c++;
this.numericUpDown1.Value++;}
else
numericUpDown1.Value = (numericUpDown1.Value + 1);

else
numericUpDown1.Value = (numericUpDown1.Value + 1);...
tracking img