当前位置:网站首页>Flutter dart generates a list of random numbers that are not repeated in n intervals
Flutter dart generates a list of random numbers that are not repeated in n intervals
2022-07-26 12:55:00 【Flutter Mengxin College】
List<int> resultList = [];
var rng = new Random();
int count = 0;
while (count < 6) {
// Generate 6 individual
int index = rng.nextInt(12) + 1; // 1-12 Between
if (!resultList.contains(index)) {
resultList.add(index);
count++;
}
}
resultList.sort();
print(resultList);
边栏推荐
- Kubernetes----PV和PVC的生命周期简介
- 数据库组成存储过程和函数
- LCD notes (5) LCD driver framework_ Use device tree
- Backtracking - 46. Full arrangement
- Implementation of dynamic and static libraries (packaging dynamic and static libraries for others to use)
- 0基础编程资源大全(先收藏~慢慢看~)
- 回溯——46. 全排列
- Where is safe to open an account when buying stocks on mobile phones?
- 食品安全 | 无菌蛋真的完全无菌吗?
- From January to June, China's ADAS suppliers accounted for 9%, and another parts giant comprehensively laid out the new smart drive track
猜你喜欢

Food safety | what food can be heated in a microwave oven? You should know these potential safety hazards

HCIP-9.OSPF的各种拓展

Problems encountered in byte stream exercises and Solutions

Detailed interpretation of hole convolution (input and output size analysis)

What is a callback function? Understanding of the word "back"

若有声明”int x=5,y=1;”,则表达式x<y?x++:y++的结果是:

回溯——46. 全排列

酷早报:7月25日Web3加密行业新闻大汇总

全国职业院校技能大赛网络安全B模块wirshark数据包分析 wireshark0051.pcap

After being fined "paid leave" for one month, Google fired him who "loves" AI
随机推荐
If there is a declaration "int x=5, y=1;", Then the expression x < y? The result of x++: y++ is:
Guys, how can CDC Oracle set the reading from the specified SCN number, or how to set the read-only full archive, not to read fast
mqtt send receive
什么是回调函数,对于“回”字的理解
.eslintrc.js configuration description
Knowledge points of C language documents
一款超好用的神器Apifox,甩 Swagger 几条街...(荣耀典藏版)
Kubernetes----安装部署NFS服务器
Minesweeping games - easy to play addictive (C language version)
Where is safe to open an account when buying stocks on mobile phones?
Microsoft has shut down two attack methods: Office macro and RDP brute force cracking
数据查询WHERE
The "2022 Huawei developer competition eastern China division opening ceremony" was successfully held in Fuzhou
Examples of ThreadLocal usage scenarios under multithreading
编程式导航路由跳转到当前路由(参数不变), 多次执行会抛出NavigationDuplicated的警告错误?
如何组装一个注册中心?
LCD notes (7) LCD driver framework_ Configure clock
The.Net webapi uses groupname to group controllers to render the swagger UI
Kubernetes----高级存储之PV和PVC简介
Optical distance sensing chip 4530a combining ambient light, proximity sensing and infrared ranging