当前位置:网站首页>PHP wechat red packet grabbing algorithm
PHP wechat red packet grabbing algorithm
2022-07-02 22:28:00 【Game programming】
php Wechat red packet algorithm
function qiangHongbao() { $total=10;// Total $num=8;// Divide into 8 Red envelopes , Support 8 People receive at random $min=0.01;// Everyone can at least receive 0.01 element for ($i=1;$i<$num;$i++) { $safe_total=($total-($num-$i)*$min)/($num-$i);// Random safety upper limit $money=mt_rand($min*100,$safe_total*100)/100; $total=$total-$money; echo ' The first '.$i.' Red envelopes :'.$money.' element , balance :'.$total.' element <br/>'; } echo ' The first '.$num.' Red envelopes :'.$total.' element , balance :0 element '; }// Output results // The first 1 Red envelopes :0.08 element , balance :9.92 element // The first 2 Red envelopes :0.82 element , balance :9.1 element // The first 3 Red envelopes :1.4 element , balance :7.7 element // The first 4 Red envelopes :0.87 element , balance :6.83 element // The first 5 Red envelopes :1.07 element , balance :5.76 element // The first 6 Red envelopes :2.47 element , balance :3.29 element // The first 7 Red envelopes :1.01 element , balance :2.28 element // The first 8 Red envelopes :2.28 element , balance :0 element author :. Week week
Game programming , A game development favorite ~
If the picture is not displayed for a long time , Please use Chrome Kernel browser .
边栏推荐
- Market Research - current situation and future development trend of carob chocolate market
- 地理探测器原理介绍
- [shutter] shutter custom fonts (download TTF fonts | pubspec.yaml configure font resources | synchronize resources | globally apply fonts | locally apply fonts)
- 服务可见可观测性
- [001] [arm-cortex-m3/4] internal register
- Bridge emqx cloud data to AWS IOT through the public network
- The source code of the daily book analyzes the design idea of Flink and solves the problems in Flink
- 加了定位的文字如何水平垂直居中
- [staff] Sibelius 7.5.1 score software installation (software download | software installation)
- Reading experience of just because
猜你喜欢

The source code of the daily book analyzes the design idea of Flink and solves the problems in Flink

Ransack组合条件搜索实现
![[shutter] shutter opens a third-party application (url|launcher plug-in search and installation | url| launcher plug-in official example | open browser | open a third-party application)](/img/f7/cb41d159e5c5ef3f4f1b9468d52ccc.jpg)
[shutter] shutter opens a third-party application (url|launcher plug-in search and installation | url| launcher plug-in official example | open browser | open a third-party application)

Pip install whl file Error: Error: … Ce n'est pas une roue supportée sur cette plateforme

Riding the wind of "cloud native" and stepping on the wave of "digitalization", new programmer 003 starts pre-sale
![[shutter] shutter resource file use (import resource pictures | use image resources)](/img/e9/94ae2e3ee315f490eb3cf14bcf2e49.jpg)
[shutter] shutter resource file use (import resource pictures | use image resources)

A specially designed loss is used to deal with data sets with unbalanced categories

如何访问kubernetes API?

An overview of the development of affective computing and understanding research

It's not easy to say I love you | use the minimum web API to upload files (swagger support) # yyds dry inventory #
随机推荐
The failure rate is as high as 80%. What should we do about digital transformation?
【leetcode】1380. Lucky number in matrix
Try to get property'num for PHP database data reading_ rows' of non-object?
[shutter] shutter resource file use (import resource pictures | use image resources)
使用 EMQX Cloud 实现物联网设备一机一密验证
How to write a good program when a big book speaks every day?
Service visibility and observability
Technological Entrepreneurship: failure is not success, but reflection is
加了定位的文字如何水平垂直居中
: last child does not take effect
Market Research - current market situation and future development trend of aircraft audio control panel system
Promise optimized callback hell
情感计算与理解研究发展概述
地理探测器原理介绍
SQL必需掌握的100个重要知识点:使用游标
pip安裝whl文件報錯:ERROR: ... is not a supported wheel on this platform
开发者分享 | HLS, 巧用AXI_master总线接口指令的定制并提升数据带宽-面积换速度...
Regular expression (2)
Market Research - current situation and future development trend of marine clutch Market
phpcms实现订单直接支付宝支付功能