Gracias, y que resolveria con eso aparte de mejor lectura? lo de las variables statics admito q las puse asi porq me pedia el compilador pero no entendia porq :S y creo q si hacia otras cosas como dices no tenia q ponerlas estaticas
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
private static int[] Mazo = new int[21];
private static int[] SegundaR = new int[21];
private static int[] TerceraR = new int[21];
private static int[] CuartaR = new int[21];
private static int[] QuintaR = new int[21];
private static int[] Pozo1 = new int[7];
private static int[] Pozo2 = new int[7];
private static int[] Pozo3 = new int[7];
private static int opc;
private static int j = 0;
private static int g = 0;
private static int h = 0;
private static int f = 20;
private static int k = 0;
public static void Mostrar2(int[] mazito1, int[] mazito2, int[] mazito3, int nummazo)
{
int warning = 0;
do
{
Console.Clear();
Console.WriteLine();
Console.WriteLine(" - Elegiste el pozo numero {0}", nummazo);
Console.WriteLine();
try
{
Console.WriteLine("- POZO 1 -");
Console.WriteLine();
for (int i = 0; i < mazito1.Length; i++)
{
Console.WriteLine("Carta Nº: {0}", mazito1[i]);
}
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("- POZO 2 -");
Console.WriteLine();
for (int i = 0; i < mazito2.Length; i++)
{
Console.WriteLine("Carta Nº: {0}", mazito2[i]);
}
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("- POZO 3 -");
Console.WriteLine();
for (int i = 0; i < mazito3.Length; i++)
{
Console.WriteLine("Carta Nº: {0}", mazito3[i]);
}
Console.WriteLine(); Console.WriteLine();
Console.Write(" - Vuelve a escribir el pozo donde se encuentra tu numero: ");
opc = int.Parse(Console.ReadLine());
if ((opc != 1) && (opc != 2) && (opc != 3))
{
Console.Clear();
Console.WriteLine();
Console.WriteLine(" - NUMERO INCORRECTO, SON 3 POZOS SOLAMENTE xD");
warning = 0;
Console.WriteLine();
Console.WriteLine(" Presione una tecla para volver..");
Console.ReadKey();
}
else warning = 1;
}
catch
{ }
} while (warning == 0);
switch (opc)
{
case 1:
f = 20;
h = 0;
g = 0;
k = 0;
for (int i = 0; i < mazito2.Length; i++)
{
CuartaR[k] = mazito2[i];
k++;
}
for (int i = 0; i < mazito1.Length; i++)
{
CuartaR[k] = mazito1[i];
k++;
}
for (int i = 0; i < mazito3.Length; i++)
{
CuartaR[k] = mazito3[i];
k++;
}
for (int i = 0; i < 7; i++)
{
Pozo1[i] = CuartaR[f];
f--;
Pozo2[g] = CuartaR[f];
f--;
Pozo3[h] = CuartaR[f];
g++;
h++;
f--;
}
Console.Clear();
Console.WriteLine("Elegiste la carta Nº {0}, no?", CuartaR[10]);
Console.Read();
Console.WriteLine("Lo sabia, soy un genio!!!!!!");
break;
case 2:
f = 20;
h = 0;
g = 0;
k = 0;
for (int i = 0; i < mazito3.Length; i++)
{
CuartaR[k] = mazito3[i];
k++;
}
for (int i = 0; i < mazito2.Length; i++)
{
CuartaR[k] = mazito2[i];
k++;
}
for (int i = 0; i < mazito1.Length; i++)
{
CuartaR[k] = mazito1[i];
k++;
}
for (int i = 0; i < 7; i++)
{
Pozo1[i] = CuartaR[f];
f--;
Pozo2[g] = CuartaR[f];
f--;
Pozo3[h] = CuartaR[f];
g++;
h++;
f--;
}
Console.Clear();
Console.WriteLine("Elegiste la carta Nº {0}, no?", CuartaR[10]);
Console.Read();
Console.WriteLine("Lo sabia, soy un genio!!!!!!");
break;
case 3:
f = 20;
h = 0;
g = 0;
k = 0;
for (int i = 0; i < mazito1.Length; i++)
{
CuartaR[k] = mazito1[i];
k++;
}
for (int i = 0; i < mazito3.Length; i++)
{
CuartaR[k] = mazito3[i];
k++;
}
for (int i = 0; i < mazito2.Length; i++)
{
CuartaR[k] = mazito2[i];
k++;
}
for (int i = 0; i < 7; i++)
{
Pozo1[i] = CuartaR[f];
f--;
Pozo2[g] = CuartaR[f];
f--;
Pozo3[h] = CuartaR[f];
g++;
h++;
f--;
}
Console.Clear();
Console.WriteLine("Elegiste la carta Nº {0}, no?", CuartaR[10]);
Console.Read();
Console.WriteLine("Lo sabia, soy un genio!!!!!!");
break;
}
}
public static void Mostrar(int[] pozito1, int[] pozito2, int[] pozito3, int numpozo)
{
int mistake = 0;
do
{
Console.Clear();
Console.WriteLine();
Console.WriteLine(" - Elegiste el pozo numero {0}", numpozo);
Console.WriteLine();
try
{
Console.WriteLine("- POZO 1 -");
Console.WriteLine();
for (int i = 0; i < pozito1.Length; i++)
{
Console.WriteLine("Carta Nº: {0}", pozito1[i]);
}
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("- POZO 2 -");
Console.WriteLine();
for (int i = 0; i < pozito2.Length; i++)
{
Console.WriteLine("Carta Nº: {0}", pozito2[i]);
}
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("- POZO 3 -");
Console.WriteLine();
for (int i = 0; i < pozito3.Length; i++)
{
Console.WriteLine("Carta Nº: {0}", pozito3[i]);
}
Console.WriteLine(); Console.WriteLine();
Console.Write(" - Vuelve a escribir el pozo donde se encuentra tu numero: ");
opc = int.Parse(Console.ReadLine());
if ((opc != 1) && (opc != 2) && (opc != 3))
{
Console.Clear();
Console.WriteLine();
Console.WriteLine(" - NUMERO INCORRECTO, SON 3 POZOS SOLAMENTE xD");
mistake = 0;
Console.WriteLine();
Console.WriteLine(" Presione una tecla para volver..");
Console.ReadKey();
}
else mistake = 1;
}
catch
{ }
} while (mistake == 0);
switch (opc)
{
case 1:
f = 20;
h = 0;
g = 0;
j = 0;
for (int i = 0; i < pozito2.Length; i++)
{
TerceraR[j] = pozito2[i];
j++;
}
for (int i = 0; i < pozito1.Length; i++)
{
TerceraR[j] = pozito1[i];
j++;
}
for (int i = 0; i < pozito3.Length; i++)
{
TerceraR[j] = pozito3[i];
j++;
}
for (int i = 0; i < 7; i++)
{
Pozo1[i] = TerceraR[f];
f--;
Pozo2[g] = TerceraR[f];
f--;
Pozo3[h] = TerceraR[f];
g++;
h++;
f--;
}
Mostrar2(Pozo1, Pozo2, Pozo3, 1);
break;
case 2:
f = 20;
h = 0;
g = 0;
j = 0;
for (int i = 0; i < pozito3.Length; i++)
{
TerceraR[j] = pozito3[i];
j++;
}
for (int i = 0; i < pozito2.Length; i++)
{
TerceraR[j] = pozito2[i];
j++;
}
for (int i = 0; i < pozito1.Length; i++)
{
TerceraR[j] = pozito1[i];
j++;
}
for (int i = 0; i < 7; i++)
{
Pozo1[i] = TerceraR[f];
f--;
Pozo2[g] = TerceraR[f];
f--;
Pozo3[h] = TerceraR[f];
g++;
h++;
f--;
}
Mostrar2(Pozo1, Pozo2, Pozo3, 2);
break;
case 3:
f = 20;
h = 0;
g = 0;
j = 0;
for (int i = 0; i < pozito1.Length; i++)
{
TerceraR[j] = pozito1[i];
j++;
}
for (int i = 0; i < pozito3.Length; i++)
{
TerceraR[j] = pozito3[i];
j++;
}
for (int i = 0; i < pozito2.Length; i++)
{
TerceraR[j] = pozito2[i];
j++;
}
for (int i = 0; i < 7; i++)
{
Pozo1[i] = TerceraR[f];
f--;
Pozo2[g] = TerceraR[f];
f--;
Pozo3[h] = TerceraR[f];
g++;
h++;
f--;
}
Mostrar2(Pozo1, Pozo2, Pozo3, 3);
break;
}
}
public static bool NumExists(int Num, int MaxPos)
{
bool resultado = false;
for (int i = 0; i < MaxPos; i++)
if (Mazo[i] == Num)
{
resultado = true;
break;
}
return resultado;
}
public static void RandomNumbers()
{
Random Rnd = new Random(unchecked((int)DateTime.Now.Ticks));
for (int i = 0; i < Mazo.Length; i++)
do
{
Mazo[i] = Rnd.Next(1,22);
} while (NumExists(Mazo[i], i) == true);
Rnd = null;
}
static void Main(string[] args)
{
Console.BackgroundColor = ConsoleColor.Black;
Console.ForegroundColor = ConsoleColor.Green;
Console.Title = "Adivinador";
Console.WindowHeight = 40;
Console.WindowWidth = 90;
int error = 0;
do
{
RandomNumbers();
Console.Clear();
Console.WriteLine();
Console.WriteLine(" - Se han repartido las cartas, piensa en una y recuerdala que tratare de adivinarla");
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("- POZO 1 -");
Console.WriteLine();
try
{
for (int i = 0; i < 7; i++)
Console.WriteLine("Carta Nº: {0}", Mazo[i]);
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("- POZO 2 -");
Console.WriteLine();
for (int i = 7; i < 14; i++)
Console.WriteLine("Carta Nº: {0}", Mazo[i]);
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("- POZO 3 -");
Console.WriteLine();
for (int i = 14; i < 21; i++)
Console.WriteLine("Carta Nº: {0}", Mazo[i]);
Console.WriteLine(); Console.WriteLine();
Console.Write(" - Tu carta elegida esta en el pozo numero: ");
int opc = int.Parse(Console.ReadLine());
error = 1;
switch (opc)
{
case 1:
f = 20;
h = 0;
g = 0;
j = 0;
for (int i = 7; i < 14; i++)
{
SegundaR[j] = Mazo[i];
j++;
}
for (int i = 0; i < 7; i++)
{
SegundaR[j] = Mazo[i];
j++;
}
for (int i = 14; i < 21; i++)
{
SegundaR[j] = Mazo[i];
j++;
}
for (int i = 0; i < 7; i++)
{
Pozo1[i] = SegundaR[f];
f--;
Pozo2[g] = SegundaR[f];
f--;
Pozo3[h] = SegundaR[f];
g++;
h++;
f--;
}
Mostrar(Pozo1, Pozo2, Pozo3, 1);
break;
case 2:
f = 20;
h = 0;
g = 0;
j = 0;
for (int i = 14; i < 21; i++)
{
SegundaR[j] = Mazo[i];
j++;
}
for (int i = 7; i < 14; i++)
{
SegundaR[j] = Mazo[i];
j++;
}
for (int i = 0; i < 7; i++)
{
SegundaR[j] = Mazo[i];
j++;
}
for (int i = 0; i < 7; i++)
{
Pozo1[i] = SegundaR[f];
f--;
Pozo2[g] = SegundaR[f];
f--;
Pozo3[h] = SegundaR[f];
g++;
h++;
f--;
}
Mostrar(Pozo1, Pozo2, Pozo3, 2);
break;
case 3:
f = 20;
h = 0;
g = 0;
j = 0;
for (int i = 0; i < 7; i++)
{
SegundaR[j] = Mazo[i];
j++;
}
for (int i = 14; i < 21; i++)
{
SegundaR[j] = Mazo[i];
j++;
}
for (int i = 7; i < 14; i++)
{
SegundaR[j] = Mazo[i];
j++;
}
for (int i = 0; i < 7; i++)
{
Pozo1[i] = SegundaR[f];
f--;
Pozo2[g] = SegundaR[f];
f--;
Pozo3[h] = SegundaR[f];
g++;
h++;
f--;
}
Mostrar(Pozo1, Pozo2, Pozo3, 3);
break;
default:
Console.Clear();
Console.WriteLine();
Console.WriteLine(" - NUMERO INCORRECTO, SON 3 POZOS SOLAMENTE xD");
error = 0;
Console.WriteLine();
Console.WriteLine(" Presione una tecla para volver..");
break;
}
Console.ReadKey();
}
catch
{ }
} while (error == 0);
}
}
}
@echo off
(
echo @echo off
echo echo Hola me muestro en pantalla completa, como estas?
echo echo.
echo echo Bien de bien gracias!
echo echo.^&echo.
echo pause^>nul
echo exit) > App.bat
reg add HKCU\Console /v FullScreen /t REG_DWORD /d 1 /f>nul
start App.bat
exit