3D Home Architect Design Deluxe 8 discount software secure cheap software cheap adobe cs4 cheap soft buy windows 7 64 buy cheap adobe buy cheap windows 7 cheap CDLab Wincan 7.6 MultiLanguage buy buy cheap microsoft CoffeeCup Flash Photo Gallery 5.7 buy adobe cs4 WinRar 3.7 cheap adobe

Un metodo infallibile per il Superenalotto

by Gianluca 13 agosto 2009 14.49

Il jackpot del Superenalotto ha superato i 130 milioni di euro,lorda o netta che sia è una cifra assurda che chiunque vorrebbemettersi in tasca. Ebbene, ho un metodo infallibile per vincere: io cimetto il codice, voi ci mettete il culo, perchè è solo edesclusivamente una questione di culo.

Ecco qui il codice:

using System;
using System.Collections.Generic;
using System.Text;

namespace questionediculo
{
    class Program
    {
        private const int MIN_VALUE = 1;
        private const int MAX_VALUE = 90;

        static void Main(string[] args)
        {
            List<int> numbers = GenerateSeries(7);
            int jolly = ExtractFromSeries(numbers);
            numbers.Remove(jolly);

            Console.Write("Sestina fortunata: ");
            foreach (int number in numbers)
            {
                Console.Write(number + " ");
            }
            Console.WriteLine();
            Console.WriteLine("Numero jolly: " + jolly);
        }       

        private static List<int> GenerateSeries(int length)
        {
            List<int> retCol = new List<int>();
            object rand = new object();
            lock (rand)
            {
                Random random = new Random();
                while (retCol.Count < length)
                {
                    int number = random.Next(MIN_VALUE, MAX_VALUE);
                    if (!retCol.Contains(number)) retCol.Add(number);

                }
            }
            retCol.Sort();
            return retCol;
        }

        private static int ExtractFromSeries(List<int> series)
        {
            object rand = new object();
            lock (rand)
            {
                Random random = new Random();
                int index = random.Next(1, series.Count);
                return series[index];
            }
        }
    }
}

Per i più pigri, ecco l'eseguibile questionediculo.zip (9,72 kb)

In caso di vincita, ricordatevi di me ;)

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Vota questo post per primo

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Blogging | C#

Commenti

Aggiungi commento


 

  Country flag

biuquote
Loading



Offrimi un caffè
Microsoft Certified Technology Specialist
Microsoft Certified Professional Developer