Skip to content

ciloi/Fun

 
 

Repository files navigation

Fun

fun programing, some interesting programs

lottery

a program to test how luck you are, it simulates buying lottery, in China, it calls 大乐透, if you match all the number, you will get 10,000,000 CNY. let's figure out how long will it take to win the biggest prize. 大乐透模拟,选定一注号码,连续投注,每期都买,看看需要多少年你才能中奖。 要自己选注,修改balls变量,前五个球是红球,后两个是蓝球,我选的号是 3,4,12,16,28 + 5,12。

if __name__ == "__main__":
	balls = [3,4,12,16,28,5,12]
	red = 5
	p = printer(red)
	l = lottery(p, balls, red)
	n = 1;
	while(l.draw(n) < 7):
		n += 1
	
	p.print_win(n, l.getBalls())

screenshot

参见文章:你能中1000万吗

algorithms

An algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. An algorithm is thus a sequence of computational steps that transform the input into the output.

其他内容

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 69.0%
  • Python 11.0%
  • C# 7.0%
  • Java 3.5%
  • Kotlin 3.3%
  • C++ 2.2%
  • Other 4.0%