Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Proposal] How about using “卦” for random numbers? #284

Open
Lotayou opened this issue Dec 20, 2019 · 4 comments
Open

[Feature Proposal] How about using “卦” for random numbers? #284

Lotayou opened this issue Dec 20, 2019 · 4 comments
Labels
stdlib Issues related to standard library

Comments

@Lotayou
Copy link

Lotayou commented Dec 20, 2019

Syntax

wenyan Python
吾观一书。名曰「周易」 import random
自「周易」之书引「卦」引「间」引「签」引「时」引「乱」 from random import random, randint, choice, seed, shuffle
吾有一「间」。名曰「俸禄」。欲卜此卦。必先得两数。曰「低」「高」 salary = random.randint(low, high)
吾有一「签」。名曰「彩」。欲卜此卦。必先得一列。曰「签筒」 lot = random.choice(lottery_pool)
设「周易」之「时」于「贞观元年」 random.seed(627)
施「乱」于「寰宇」 random.shuffle(universe)

Reference: #87 [Feature Request] Random

@xubaiw
Copy link

xubaiw commented Dec 21, 2019

random 内部应该都是术吧
为什么会变成欲卜此卦。
这样以后写其他库会不会每个都要实现一个各自的写法?
(或者欲卜此卦。的作用是起到randint加上random.的作用?

@LingDong-
Copy link
Member

See #290 for the new baseline Random standard library inspired by this syntax. Thanks!

@guxd
Copy link

guxd commented Dec 21, 2019

易经是个包罗万象的哲学观,不应该局限在生成随机数或者算卦之类的

@LingDong- LingDong- added the stdlib Issues related to standard library label Dec 24, 2019
@mountain
Copy link

mountain commented Dec 30, 2019

吾观一书。名曰「卜」

易经内涵太丰富,用“卜”似乎是个简洁的名字。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Issues related to standard library
Projects
None yet
Development

No branches or pull requests

5 participants