当前位置:网站首页>flutter dart生成N个区间范围内不重复随机数List
flutter dart生成N个区间范围内不重复随机数List
2022-07-26 10:39:00 【Flutter萌新学院】
List<int> resultList = [];
var rng = new Random();
int count = 0;
while (count < 6) {
//生成6个
int index = rng.nextInt(12) + 1; // 1-12之间区间
if (!resultList.contains(index)) {
resultList.add(index);
count++;
}
}
resultList.sort();
print(resultList);
边栏推荐
- mysql20210906
- Redis docker instance and data structure
- 11 handle "self assignment" in operator=
- Application of.Net open source framework in industrial production
- [leetcode每日一题2021/2/14]765. 情侣牵手
- [leetcode daily question 2021/2/13]448. Find all the missing numbers in the array
- 英语基础句型结构------起源
- centos8(liunx)部署WTM(ASP.NET 5)使用pgsql
- putty的使用教程
- (转载)ArcGIS Engine中各种点的创建方法
猜你喜欢

Issue 6: which mainstream programming language should college students choose
![[leetcode daily question 2021/2/13]448. Find all the missing numbers in the array](/img/9b/624416fa6a408bf64ca5438273176b.png)
[leetcode daily question 2021/2/13]448. Find all the missing numbers in the array

el-table实现可编辑表格

【小程序】onReachBottom 事件为什么不能触发 ?(一秒搞定)
![[leetcode每日一题2021/2/14]765. 情侣牵手](/img/be/8639a05c733638bf0b3fdeb11abccf.png)
[leetcode每日一题2021/2/14]765. 情侣牵手

【机器学习小记】【风格迁移】deeplearning.ai course4 4th week programming(tensorflow2)

Introduction to data analysis | kaggle Titanic mission (I) - > data loading and preliminary observation

.NET5WTM(ASP.NET Core) PGSql开箱操作

RT-Thread 学习笔记(五)---编辑、下载、调试程序

Issue 5: the second essential skill for College Students
随机推荐
mysql20210906
【小程序】onReachBottom 事件为什么不能触发 ?(一秒搞定)
Issue 7: how do you choose between curling up and lying flat
12 don't forget every component when copying an object
Application of.Net open source framework in industrial production
Redis特殊数据类型使用场景
[leetcode每日一题2021/8/31]1109. 航班预订统计【中等】差分数组
(转载)ArcGIS Engine中各种点的创建方法
IAR sprintf 浮点 在UCOS 总格式化成0.0的问题
.NET5WTM(ASP.NET Core) PGSql开箱操作
[leetcode每日一题2021/4/29]403. 青蛙过河
[leetcode daily question 2021/4/29]403. Frogs cross the river
sigmod 函数与softmax 函数对比
构造器、方法重载、对象数组和static
剑指Offer(十):矩形覆盖
使用flex实现左中右布局,中间自适应
13 以对象管理资源
What if MySQL can't get in
如何实现临时的图形要素现实
kali 查看ip地址