当前位置:网站首页>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);
边栏推荐
- Centos8 (liunx) deploying WTM (asp.net 5) using PgSQL
- 使用Geoprocessor 工具
- Application of.Net open source framework in industrial production
- SuperMap IClient for Leaflet 加载高斯克吕格投影三度分带CGCS2000大地坐标系WMTS服务
- Dry goods likeshop takeout order system is open source, 100% open source, no encryption
- 剑指Offer(八):跳台阶
- Analysis of the transaction problem of chained method call
- RT-Thread 学习笔记(一)---配置RT-Thread开发环境
- [leetcode每日一题2021/5/8]1723. 完成所有工作的最短时间
- Database functions
猜你喜欢

Tradingview tutorial
![[leetcode每日一题2021/2/18]【详解】995. K 连续位的最小翻转次数](/img/de/62fca587cde95110c2a967ca93eea5.png)
[leetcode每日一题2021/2/18]【详解】995. K 连续位的最小翻转次数
![[leetcode每日一题2021/2/14]765. 情侣牵手](/img/be/8639a05c733638bf0b3fdeb11abccf.png)
[leetcode每日一题2021/2/14]765. 情侣牵手

Redis docker instance and data structure
![[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实现可编辑表格

Issue 8: cloud native -- how should college students learn in the workplace
![[leetcode每日一题2021/2/13]448. 找到所有数组中消失的数字](/img/9b/624416fa6a408bf64ca5438273176b.png)
[leetcode每日一题2021/2/13]448. 找到所有数组中消失的数字

.net5wtm (asp.net core) PgSQL unpacking operation
随机推荐
.net operation redis string string
Issue 5: the second essential skill for College Students
Centos8 (liunx) deploying WTM (asp.net 5) using PgSQL
Datav beautiful data screen production experience
oracle 启动不了 tnslistener服务启动不了
在altium designer中禁用USBJATG
[leetcode daily question 2021/2/14]765. Lovers hold hands
px2rem-loader将px转化为rem,适配移动端vant-UI等框架
常见的类(了解)
.net operation redis hash object
[leetcode daily question 2021/2/13]448. Find all the missing numbers in the array
剑指Offer(五):用两个栈实现队列
使用float实现左中右布局,中间内容自适应
Flutter 防止科学计数并去除尾数无效0
剑指Offer(五十三):表示数值的字符串
剑指Offer(十):矩形覆盖
C language calculation date interval days
Summary of common skills in H5 development of mobile terminal
使用grid实现左中右布局,中间内容自适应
剑指Offer(二十):包含min函数的栈