You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package main
import (
"fmt"
)
func main() {
n := 4
fmt.Printf("%f\n", 1+float64(n)/10)
fmt.Printf("%f\n", 1+float64(n)/10*0.9)
fmt.Printf("%f\n", 1-float64(n)/10)
//// 获取区块Hash的后5位
//lastFive := "4aef2"
//
//// 获取庄闲的值
//bankStr, playStr := lastFive[0:2], lastFive[3:]
//// 计算庄闲
//bank, play := 0, 0
//for _, i := range []int{0, 1} {
// switch bankStr[i] {
// case 'a', 'b', 'c', 'd', 'e', 'f':
// bank += 0
// case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
// v, _ := strconv.Atoi(string(bankStr[i]))
// bank += v
// }
//
// switch playStr[i] {
// case 'a', 'b', 'c', 'd', 'e', 'f':
// play += 0
// case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
// v, _ := strconv.Atoi(string(playStr[i]))
// play += v
// }
//}
//// 余数
//bank, play = bank%10, play%10
//fmt.Printf("TRX======猎物庄闲竞猜区块哈希:%s。庄%d%d\n", lastFive, bank, play)
// 获取区块Hash的后5位
//// 获取庄闲的值
//lastFive := "4aef2"
//bankStr, playStr := lastFive[0:3], lastFive[2:]
//// 计算庄闲
//bank, play := 0, 0
//for _, i := range []int{0, 1, 2} {
// switch bankStr[i] {
// case 'a', 'b', 'c', 'd', 'e', 'f':
// bank += 10
// case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
// v, _ := strconv.Atoi(string(bankStr[i]))
// bank += v
// }
//
// switch playStr[i] {
// case 'a', 'b', 'c', 'd', 'e', 'f':
// play += 10
// case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
// v, _ := strconv.Atoi(string(playStr[i]))
// play += v
// }
//}
//// 余数
//bank, play = bank%10, play%10
//if bank == 0 {
// bank = 10
//}
//if play == 10 {
// play = 10
//}
//fmt.Printf("TRX======猎物牛牛竞猜区块哈希:%s。庄%d%d\n", lastFive, bank, play)
////// 结果
//if bank > play {
// fmt.Println(1, bank) // 庄赢
//} else if bank < play {
// fmt.Println(2, bank) // 闲赢
//} else {
// fmt.Println(3, bank) // 和
//}
}