jeudi 28 mars 2019

Generate number by groovy X and Y with range

I want to create a keyword that following method to generate two value X and Y with limitation starting the value X = from 120 -200 and Y = from 140 to 200

Thank you

@Keyword
def generatorNumber(int number, int n) {
    return new Random().with({
        (1..n).collect({
            number[nextInt(number.length())]
        }).join()
    })
}

enter image description here enter image description here




Aucun commentaire:

Enregistrer un commentaire