elo

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// K is the default K-Factor
	K = 32
	// D is the default deviation
	D = 400
)

Variables

This section is empty.

Functions

func Decimal

func Decimal(value float64, f string) float64

f 保留2 位小数 %.2f

func EloRating

func EloRating(elo Elo) (a uint32, b uint32)

Types

type Elo

type Elo struct {
	//输入值
	A  uint32  //A玩家当前的Rating
	B  uint32  //B玩家当前的Rating
	Sa float64 //实际胜负值,胜=1,平=0.5,负=0   传入值默认A的胜负 / 1 A胜利 B失败 / 0 B胜利 A失败

}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL