Hlavní stránka Přidej se FAQ Mužstvo Hledat Nastavení Skupiny Zprávy SZ Přihlásit se


Odeslat odpověď
Uživatelské jméno
Předmět
Tělo zprávy
Barva písma:  Velikost písma:
Vložit média:
Smajlíky
Very Happy Smile Sad Surprised Shocked Confused
Cool Laughing Mad Razz Embarassed Crying or Very sad
Evil or Very Mad Twisted Evil Rolling Eyes Wink Exclamation Question
Idea Arrow Neutral Mr. Green Applause d'oh!
Drool Liar Shame on You Pray Anxious Not Talking
Think Brick Wall Whistle Angel Hand Sick
Shhh Eh? Dance Silence Slinták Magor
Thumb up! Thumb down! Zvracím Potěšený Mňau!
Předvolby
HTML: VYPNUTO
BBcode: POVOLENY
Smajlíky: POVOLENY


Antispamová jazyková kontrola:
Zadej (číslem) správnou odpověď.
Kolik je devět krát šest?

Přehled tématu [obnovit]
inana
Příspěvek Zaslal: po 18. únor 2008 15:58 Předmět:
Mr. Green nechci vám odporovat, ale já si dala jméno bejvalýho a vyšlo mi, že je dvojtá nula - ať to počítá jak to počítá, tohle je pravda Applause

MAO
Příspěvek Zaslal: po 18. únor 2008 15:53 Předmět:
z žádnou ze svých bývalek jsem se nedostal přes 50% Mr. Green

Beat
Příspěvek Zaslal: po 18. únor 2008 15:05 Předmět:
Hmmm. Tak jsem si dal také pivo po vzoru Dieg0 a vyšel mi velice zajímavý výsledek. Tak to fkt nechápu podle čeho to počítá. Shocked

romulus
Příspěvek Zaslal: po 18. únor 2008 13:56 Předmět:
jirka: hezký... Applause

jirkacv
Příspěvek Zaslal: po 18. únor 2008 13:54 Předmět:
a deti planujete? Laughing

Dieg0
Příspěvek Zaslal: po 18. únor 2008 13:49 Předmět:
Obrázek
 

Beat
Příspěvek Zaslal: po 18. únor 2008 09:23 Předmět:
Tak jsem si tam zadal všechna jména ženských za poslední dobu a nejvíce mi vyšla bejvalka! Shocked Shocked Brick Wall Brick Wall Brick Wall Mr. Green Mr. Green Mr. Green
To je pěkná ptááákovina. Je ale zase fakt, že jsem s ní byl 21let Think Think

krrttek
Příspěvek Zaslal: ne 17. únor 2008 12:10 Předmět:
podle mně sečte všechny písmenka a vydělí to dvěma Mr. Green

jirkacv
Příspěvek Zaslal: ne 17. únor 2008 02:51 Předmět:
tak priblizne jediny co sem z toho vycetl byly nazvy metod Laughing

jenda^^
Příspěvek Zaslal: ne 17. únor 2008 02:44 Předmět:
Takhle je ten kód, doufam, že je to vůbec ono:

kód:
/*
 * Lovecalc.cs -- Lovecalculator class
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * Copyright (C) Meilof Veeningen <meilof@wanadoo.nl>, 2004
 */
 
namespace Lovecalculator
{

using System;

public class Lovecalc
{
   /**
    * Calculation step event handler
    *
    * This event handler will be called for every calculation step. The first
    * argument is the current calculation string, the second argument will
    * always be null.
    */
   public static event EventHandler onStep;
   
   /** Maximum number of calculation steps */
   public static int patience = 50;
   
   /** Maximum length of calculation string */
   public static int maxLength = 100;
   
   static int numberOfOccurences(String haystack, char needle)
   {
       int n = 0, ix = -1;
       while ((ix = haystack.IndexOf(needle, ix + 1)) != -1) n++;
       return n;
   }
   
   public static String countCharacters(String str)
   {
      String strL = str.ToLower();
      String searchStr = "loves";
      String ret = "";
      for (int t = 0; t < searchStr.Length; t++)
         ret += numberOfOccurences(strL, searchStr[t]).ToString();
      return ret;
   }
   
   public static String step(String previous)
   {
      String ret = "";
      for (int t = 0; t < previous.Length - 1; t++) {
         ret += (int.Parse(""+previous[t])+int.Parse(""+previous[t+1])).ToString();
      }      
      return ret;
   }
      
   /**
    * Runs the lovecalc algoritm on the two given names
    *
    * @param name1 String  First name
    * @param name2 String  Second name
    *
    * @return  The percentage resulting from the lovecalc algorithm
    */
   public static int loveCalc(String name1, String name2)
   {
      return loveCalc(countCharacters(name1+name2));
   }
   
   /**
    * Runs the lovecalc algoritm on the given histogram string
    *
    * @param countstr String  Histogram string
    *
    * @return  The percentage resulting from the lovecalc algorithm
    */
   public static int loveCalc(String countstr)
   {
      int mypatience = patience, val;
      while (--mypatience >= 0 && countstr.Length < maxLength) {
         if (onStep != null) onStep(countstr, null);
         try { val = int.Parse(countstr); }
         catch (Exception ex) { val = -1; }
         if (val >= 0 && val < 100) return val;
         countstr = step(countstr);
      }
      return 100;
   }
   
   /**
    * Returns text description for the given percentage
    *
    * @param value int  Percentage as returned by #loveCalc
    *
    * @return  String describing the percentage
    */
   public static String getDescription(int value)
   {
      if (value < 20) return "Sorry, poor match!";
      else if (value < 40) return "Well, worth trying...";
      else if (value < 60) return "It's a good chance";
      else if (value < 80) return "Fine match!";
      else if (value < 100) return "Go for it!";
      else return "Eternal Flame!";
   }
}

}
 



Powered by phpBB © 2001, 2002 phpBB Group
Czech translation by Azu; Revised by drake127

www.elektrocigler.cz | Tisk v Brně | Barel Rock | Bejci.cz | Dětská lékárna