MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    摸鱼人日历

    插件发布
    12
    34
    8219
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • daisy524
      daisy524 @初然inside last edited by

      @初然inside 用之前先仔细阅读mirai-api的文档

      1 Reply Last reply Reply Quote 0
      • daisy524
        daisy524 @MokouTyan last edited by

        @MokouTyan 因为是摸鱼写的,所以我有多懒,你应该能感觉的到(dog)

        1 Reply Last reply Reply Quote 0
        • daisy524
          daisy524 last edited by

          目前已知的问题是官方的api有时候会出问题,更新的图床链接访问不了,暂时莫得办法

          1 Reply Last reply Reply Quote 0
          • Referenced by  Samarium150 Samarium150 
          • tsudzuki
            tsudzuki 摸鱼 @Executor-Cheng last edited by

            @Executor-Cheng 为什么不while diff != 0
            ()

            daisy524 Executor-Cheng 2 Replies Last reply Reply Quote 0
            • daisy524
              daisy524 @tsudzuki last edited by

              @tsudzuki 以前刚学python, 我一直写的是while 1+1=2 XD

              tsudzuki 1 Reply Last reply Reply Quote 0
              • Executor-Cheng
                Executor-Cheng ⭐2021⭐ @tsudzuki last edited by

                @tsudzuki 如果用 while (diff != 0), 那就必须给 diff 赋初值, 还会进行多余的两次 add 操作

                tsudzuki 1 Reply Last reply Reply Quote 0
                • tsudzuki
                  tsudzuki 摸鱼 @Executor-Cheng last edited by tsudzuki

                  @Executor-Cheng 我觉得是不是可以改成这样

                  int total = 5, bottle = 5, cap = 5, diff = 5;
                  
                  for(;; diff = total) {
                      total += bottle >> 1;
                      total += cap >> 2;
                      bottle %= 2;
                      cap %= 4;
                      diff = total - diff;
                      if (!diff) return total;
                      bottle += diff;
                      cap += diff;
                  }
                  

                  我也不太懂这些东西,不知道有没有问题

                  Executor-Cheng 1 Reply Last reply Reply Quote 0
                  • tsudzuki
                    tsudzuki 摸鱼 @daisy524 last edited by tsudzuki

                    以前刚学python, 我一直写的是while 1+1=2 XD

                    @daisy524 草

                    1 Reply Last reply Reply Quote 0
                    • Executor-Cheng
                      Executor-Cheng ⭐2021⭐ @tsudzuki last edited by Executor-Cheng

                      @tsudzuki 没问题, 还可以再快一点, 因为 bottle 和 cap 都可以视作 unsigned int, 那么 bottle %= 2 和 cap %= 4 等效于 bottle &= 1 和 cap &= 3
                      让编译器去优化的话, 定义成 unsigned int total ..... 就可以了

                      tsudzuki 2 Replies Last reply Reply Quote 0
                      • tsudzuki
                        tsudzuki 摸鱼 @Executor-Cheng last edited by tsudzuki

                        @Executor-Cheng 草,想了好久没想懂,取余我只会这样(

                        int a = 17;

                        Int foo = (a>>2)<<2;

                        return a ^ foo;

                        1 Reply Last reply Reply Quote 0
                        • tsudzuki
                          tsudzuki 摸鱼 @Executor-Cheng last edited by

                          @Executor-Cheng 突然懂了(
                          和我那个一样,只不过我绕了弯路

                          1 Reply Last reply Reply Quote 1
                          • Hoshino Tented
                            Hoshino Tented ⭐2021⭐ last edited by

                            牛逼
                            ×错误
                            请增添发帖内容,不能少于 5 个字符。

                            1 Reply Last reply Reply Quote 0
                            • siscleaire
                              siscleaire last edited by

                              请问可以加一下关键词触发推送的开关吗
                              已经设置了每日定时推送 就不太需要这个功能呢

                              1 Reply Last reply Reply Quote 0
                              • M
                                Mroach233 last edited by

                                image.png刚才试了试,好像公众号的url已经换了,可以手动改“Kuriyama-Mirai.py”文件里的down_img()方法,现在新的url是这个“https://api.j4u.ink/v1/store/other/proxy/remote/moyu.json”

                                1 Reply Last reply Reply Quote 0
                                • 1
                                • 2
                                • 2 / 2
                                • First post
                                  Last post
                                Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact