Menú

Mostrar Mensajes

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ú

Mensajes - Edu

#1111
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
#1112
Si leen bien lo q comento al principio de todo todo, parece q solo pide crear un array de labels, para hacer P(0) , P(1) etc xD
Se fueron lejos si tengo razon xD pero no creo.
#1113
Perdon [D4N93R] por el doble post y por el inconveniente anterior, pero queria decir que ya logre hacerlo por cuenta propia, solo q siento q no fui muy profesional codeando y por eso quisiera si pueden criticar mi code aca:

http://foro.elhacker.net/net/me_pueden_dar_consejos_para_optimizar_mi_code_c-t314679.0.html

Gracias!
#1114
Bueno resulta q logre hacer un proyecto q tanto queria, ahora quiero ver si puedo optimizarlo y quede mas corto y mas profesional, quiero ver si me ayudan con eso, critiquen todo lo q sea, lo mas minimo critiquen.
Bueno aca dejo, es largo perdonen:

Código (csharp) [Seleccionar]


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);

         
           

        }
    }
}

#1115
Pero si haciendo lo q digo es facil, mira:

Código (dos) [Seleccionar]


@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



Ejecuta eso y veras
#1116
Dudas Generales / Re: No se ve la pantalla completa.
22 Diciembre 2010, 15:24 PM
Cambia de resolucion xD
#1117
Creo q tienes q redireccionar si, es decir crear un bat q cree el otro bat y cree la entrada al registro y luego ejecute ese otro bat
#1118
Bueno pero como ves tambien es una ayuda, es decir estaria bueno q puedan completar o arreglar mi code para q funcione, no me vengan tampoco con lo de q nadie te va a hacer las cosas q tenes q estudiar y bla bla bla, porq ya esta planteada mi idea el error q tengo es lo q quiero si me pueden dar una mano, y este post recibio 280 visitas ya xD se ve q nadie se anima
#1119
Programación General / Re: crear nuevo scripter
20 Diciembre 2010, 00:25 AM
Muy buena respuesta skapunky y decir q aveces me dicen de todo por decir las cosas de tu forma xD
#1120
Se me hizo larguisimo el post perdonen, pero nadie se ha animado, no entiendo porq xD, yo si fuera un gran programador como mucho de ustedes me gustaria hacer todos los ejercicios q me propongan, les doy la oportunidad de q repasen, practiquen, comprueben si saben o no, y de paso ayudarme y no quieren xD
Lo dejare al post, talvez dentro de 2 años se anima alguien xD