Created
April 12, 2022 09:08
-
-
Save RedyAu/3a74f1901d52579efae4eb2322759b68 to your computer and use it in GitHub Desktop.
Energetika vezeték-keresztmetszet kerekítés gyakorláshoz számgenerátor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "dart:math"; | |
List<double> sor = [0,1.5,2.5,4,6,10,16,25,35,50,70,95,120,150,185,240,300,400,500]; | |
void main() { | |
var r = Random(); | |
for (int i = 0; i < 400; i++) { | |
int place = r.nextInt(sor.length - 1) + 1; | |
int max = (sor[place] * 10).floor(); | |
int min = (sor[place - 1] * 10).floor(); | |
print((r.nextInt(max - min) + min) / 10); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment