Giter Club home page Giter Club logo

Comments (4)

liyiheng avatar liyiheng commented on August 27, 2024

当前版本是按照Redis,根据一个浮点型的值作为判断分值。
可以将多个条件组合成一个分值, 例如

// 假设等级范围是[0,100), 境界范围是[0,10), 
// 不考虑溢出
score  = 战力 * 1000 + 等级 * 10 + 境界

可以将比较的分值改为接口,这样比较起来灵活。但是无法根据分值查找

from zset.

15951836388 avatar 15951836388 commented on August 27, 2024

恩,我改借口。游戏,一般没有按分值查询的需求

from zset.

15951836388 avatar 15951836388 commented on August 27, 2024

@XanthusL

考虑是用接口,还是像官方sort那样传入一个排序方法方便?

尝试了下,作者看看如何?
image

image

image

好像结果不对,问题出在哪里了?

from zset.

liyiheng avatar liyiheng commented on August 27, 2024

需要把所有比较score的地方都换掉。

from zset.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.