Add `random()` and `random_seed()`
还没有人认领这个 Issue。
评估
调研方向
先从 issue 中链接的 random() 和 randomSeed() 参考页面开始,然后在 libprocessing 中找到对应的 Processing API 入口点。按照文档实现这两个函数,使其具有一个参数和两个参数时的行为,并产生使用种子时的确定性输出,然后验证所得 API 与这些示例一致。
由索引模型根据 Issue 内容生成。
描述
From the random() reference page:
Generates random numbers. Each time the
random()function is called, it returns an unexpected value within the specified range. If only one parameter is passed to the function, it will return a float between zero and the value of the high parameter. For example,random(5)returns values between 0 and 5 (starting at zero, and up to, but not including, 5).If two parameters are specified, the function will return a float with a value between the two values. For example,
random(-5, 10.2)returns values starting at -5 and up to (but not including) 10.2. To convert a floating-point random number to an integer, use theint()function.
From the randomSeed() reference page:
Sets the seed value for
random(). By default, random() produces different results each time the program is run. Set the seed parameter to a constant to return the same pseudo-random numbers each time the software is run.
- 主要语言
- Rust
- 星标
- 69
- 派生
- 14
- 平均合并
- 15 天 22 小时
- 30 天内合并 PR
- 3
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
processing/libprocessing 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
processing/libprocessing#233 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
processing/libprocessing#229 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
processing/libprocessing#201 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
processing/libprocessing#194 ·
-
documentation
难度 2/5 1-3 小时 新手友好度 72/100
processing/libprocessing#146 · 1 条评论 ·
查看 processing/libprocessing 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
bug rules
难度 2/5 1-3 小时 新手友好度 72/100
-
app bug
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 88/100
IronCoreLabs/ironcore-alloy#346 ·
-
good first issue
难度 2/5 1-3 小时 新手友好度 65/100