当前位置:网站首页>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);
边栏推荐
- 鹏哥C语言第七节课总结
- IAR sprintf 浮点 在UCOS 总格式化成0.0的问题
- Asynctask < T> decoration and await are not used in synchronous methods to obtain asynchronous return values (asynchronous methods are called in synchronous methods)
- .NET操作Redis Hash对象
- SAP ABAP 守护进程的实现方式
- display-inline+calc实现左中右布局,中间自适应
- 鹏哥C语言第六节课
- The problem of large fluctuation of hx711 data
- Error[Pe147]: declaration is incompatible with '错误问题
- 扫雷pro版2021-08-19
猜你喜欢

英语基础句型结构------起源

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

20210807#1 C语言程序结构

【论文下饭】Deep Mining External Imperfect Data for ChestX-ray Disease Screening
![[leetcode每日一题2021/5/8]1723. 完成所有工作的最短时间](/img/e7/a48bb5b8a86cbc4cd5b37bb16661a8.png)
[leetcode每日一题2021/5/8]1723. 完成所有工作的最短时间

vscode上使用anaconda(已经配置好环境)

【dectectron2】跟着官方demo一起做
![[machine learning notes] [style transfer] deeplearning ai course4 4th week programming(tensorflow2)](/img/94/ff52b043320b6dea5ca1238e314de8.png)
[machine learning notes] [style transfer] deeplearning ai course4 4th week programming(tensorflow2)

STM32 Alibaba cloud mqtt esp8266 at command
![[leetcode每日一题2021/4/29]403. 青蛙过河](/img/fb/612777c77df5a611506e72f4f4c3c8.png)
[leetcode每日一题2021/4/29]403. 青蛙过河
随机推荐
解决:无法加载文件 C:\Users\user\AppData\Roaming\npm\npx.ps1,因为在此系统上禁止运行脚本 。
剑指Offer(十):矩形覆盖
第8期:云原生—— 大学生职场小白该如何学
.net5wtm (asp.net core) PgSQL unpacking operation
粽子大战 —— 猜猜谁能赢
.NET操作Redis sorted set有序集合
MySQL速学-2021-09-01
超图 影像 如何去除黑边(两种方法)
【机器学习小记】【搭建循环神经网络及其应用】deeplearning.ai course5 1st week programming(keras)
JS对象赋值问题
Uniapp uses the simple method signalr (only for web debugging, cannot package apps)
Koin
.NET操作Redis Hash对象
[leetcode每日一题2021/8/31]1109. 航班预订统计【中等】差分数组
使用定位实现左中右布局,中间内容自适应
sigmod 函数与softmax 函数对比
RT-Thread 学习笔记(六)--- 开启基于SPI Flash的elmfat文件系统(上)
在神州IV开发板上成功移植STemWin V5.22
反射机制简述
.net operation redis set unordered collection