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

LOVEcalc

Jdi na stránku 1, 2  Další  Poslední [vše]
Odpovědět
Obsah fóra VySemNesmíte » Vtipy a jiné legrácky
jenda^^ (+36)
Wannabe pussy
Šéfík


Věk: 33 let
Příspěvky: 27846
Bydliště: Schlackenwerth
826 606,- VK

LOVEcalc

Zasláno: ne 17. únor 2008 02:13
Tohle potěší:
Obrázek

Ale co potěší ještě víc?
Obrázek
  Mr. Green Anxious

//online verze na http://www.lovecalculator.com (díky jirkacv)
Moje nejoblíbenější téma (´・ω・`)
Příspěvek upravil 1× jenda^^, naposledy ne 17. únor 2008 02:45.

krrttek (+24)
vynálezce vybrátoru
VIP Čestný šéfík


Příspěvky: 5344

25 450,- VK
Zasláno: ne 17. únor 2008 02:18
a co to ukáže při zadání Markéta?
nebo Pepa? Mr. Green
 

jenda^^ (+36)
Wannabe pussy
Šéfík


Věk: 33 let
Příspěvky: 27846
Bydliště: Schlackenwerth
826 606,- VK
Zasláno: ne 17. únor 2008 02:23
Když tam dam dlouhý é, tak ty procenta klesnou ještě na půlku, jinak rozdíl mezi Markéta a Markétka bez i s diakritikou neni.....
Pepa taky ukazuje 26 Mr. Green Think
 
Moje nejoblíbenější téma (´・ω・`)

krrttek (+24)
vynálezce vybrátoru
VIP Čestný šéfík


Příspěvky: 5344

25 450,- VK
Zasláno: ne 17. únor 2008 02:24
takže Markétkaje stejně dobrá jako Pepa Think

jirkacv (+24)
Real pussy
VIP Řízek
Řízek


Narozen: 24.1.2007 (17 let)
Příspěvky: 6736
Bydliště: Praha
400 990,- VK

jenda^^ (+36)
Wannabe pussy
Šéfík


Věk: 33 let
Příspěvky: 27846
Bydliště: Schlackenwerth
826 606,- VK
Zasláno: ne 17. únor 2008 02:30
Heh... Mně by zajímalo, podle čeho to počítá.
Moje nejoblíbenější téma (´・ω・`)

jirkacv (+24)
Real pussy
VIP Řízek
Řízek


Narozen: 24.1.2007 (17 let)
Příspěvky: 6736
Bydliště: Praha
400 990,- VK
Zasláno: ne 17. únor 2008 02:32
urcite je to nejaky vysoce vedecky a podlozeny algoritmus Laughing
Obrázek

jenda^^ (+36)
Wannabe pussy
Šéfík


Věk: 33 let
Příspěvky: 27846
Bydliště: Schlackenwerth
826 606,- VK
Zasláno: ne 17. únor 2008 02:37
Heh, to určitě... Jen ze zvědavosti.. našel jsem k tomu zdroják v Céčku, jenže v tom se nevyznam Mr. Green
Moje nejoblíbenější téma (´・ω・`)

jirkacv (+24)
Real pussy
VIP Řízek
Řízek


Narozen: 24.1.2007 (17 let)
Příspěvky: 6736
Bydliště: Praha
400 990,- VK
Zasláno: ne 17. únor 2008 02:41
cecko neni tak tezky, v tom by se snad dalo trochu vyznat Laughing Je to dlouhy? Very Happy
Obrázek

jenda^^ (+36)
Wannabe pussy
Šéfík


Věk: 33 let
Příspěvky: 27846
Bydliště: Schlackenwerth
826 606,- VK
Zasláno: ne 17. únor 2008 02:44
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!";
   }
}

}
 
Moje nejoblíbenější téma (´・ω・`)

Odpovědět
Obsah fóra VySemNesmíte » Vtipy a jiné legrácky
Strana 1 z 2




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