zoukankan      html  css  js  c++  java
  • 一些常用的随机实现

    if (RandomUtil.randomInt(10) > 2)
    {
    // 1.高频
    }else if (RandomUtil.randomInt(10) > 3)
    {
    // 2
    } else if (RandomUtil.nextBoolean())
    {

    }


    int result = RandomUtil.randomInt(3);
    switch (result)
    {
    case 0:
    //搜索帮派
    csGuildSearch();
    break;
    case 1:
    //请求帮派列表和申请帮派
    csGuildList();
    break;
    case 2:
    //创建帮派
    csGuildCreate(getClientObject().getActorID());
    break;
    default:
    break;
    }



    int rankId = 0;
    int[] keys = DictRankDetailData.getServerTypeKeys();
    if (keys.length > 0)
    {
    int random1 = RandomUtil.randomInt(keys.length);
    TIntArrayList records = DictRankDetailData.getRecordsByServerType(keys[random1]);
    int randomRankIndex = RandomUtil.randomInt(records.size());
    if (randomRankIndex > 0)
    {
    rankId = records.get(randomRankIndex);
    }
    }

  • 相关阅读:
    python安装教程
    protobuf安装教程
    PlantUML安装教程
    题解-CF1140E Palindrome-less Arrays
    FST
    线段树
    题解-CF677D Vanya and Treasure
    最短路
    后缀自动机
    虚树
  • 原文地址:https://www.cnblogs.com/lizb0907/p/10067601.html
Copyright © 2011-2022 走看看