1. Список говнокодов пользователя Segfault

    Всего: 2

  2. Java / Говнокод #21468

    −20

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    public static float xTicksBelow(int numTicks, float price){
        float pricePoint = price;
        DecimalFormat threeDigit = new DecimalFormat("0.000");
        for(int i = 0; i < numTicks; i++){
          if(pricePoint > 0.001f && pricePoint < 0.1f && pricePoint > 0){
            pricePoint -= 0.001;
          }else if(pricePoint > 0.1f && pricePoint < 2.0f){
            pricePoint -= 0.005;
          }else if(pricePoint > 2.0f){
            pricePoint -= 0.01f;
          }else if(pricePoint == 0.1f){
            pricePoint -= 0.001;
          }else if(pricePoint == 2.0f){
            pricePoint -= 0.005f;
          }else if(pricePoint == 0.001f){
            pricePoint = 0.001f;
          }
          String  prices = threeDigit.format(pricePoint);
          pricePoint = Float.parseFloat(prices);
        }
        //JOptionPane.showMessageDialog(null, "Pricepoint is now " + pricePoint);
        return pricePoint;
      }

    Segfault, 17 Октября 2016

    Комментарии (2)
  3. Java / Говнокод #21234

    −47

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    /**
     * Find Saucers patterns in StockData objects.
     * @version        0.9f  12 Nov 1998
     */
    
    ...
    float[] array = new float[41];
    //first make array;
    array[0] = (float)10;
    array[1] = (float)9.025;
    array[2] = (float)8.1;
    array[3] = (float)7.225;
    array[4] = (float)6.4;
    array[5] = (float)5.625;
    array[6] = (float)4.9;
    array[7] = (float)4.225;
    array[8] = (float)3.6;
    array[9] = (float)3.025;
    array[10] = (float)2.5;
    array[11] = (float)2.025;
    array[12] = (float)1.6;
    array[13] = (float)1.225;
    array[14] = (float)0.9;
    array[15] = (float)0.625;
    array[16] = (float)0.4;
    array[17] = (float)0.225;
    array[18] = (float)0.1;
    array[19] = (float)0.025;
    array[20] = (float)0;
    array[21] = (float)0.025;
    array[22] = (float)0.1;
    array[23] = (float)0.225;
    array[24] = (float)0.4;
    array[25] = (float)0.625;
    array[26] = (float)0.9;
    array[27] = (float)1.225;
    array[28] = (float)1.6;
    array[29] = (float)2.025;
    array[30] = (float)2.5;
    array[31] = (float)3.025;
    array[32] = (float)3.6;
    array[33] = (float)4.225;
    array[34] = (float)4.9;
    array[35] = (float)5.625;
    array[36] = (float)6.4;
    array[37] = (float)7.225;
    array[38] = (float)8.1;
    array[39] = (float)9.025;
    array[40] = (float)10;

    Похоже на лабу, но вот хуй!
    Забугорный "серьезный" финансовый проект.

    Segfault, 22 Сентября 2016

    Комментарии (12)