proc RandomImg(ctx: Context) {.async.} =
    

let images = [
    1.jpeg", "2.jpeg", "3.jpeg", "4.jpeg", "5.jpeg", "6.jpeg" ]

let pick = sample(images) doAssert pick in images resp "<img src='" & pick & 
"'/>"

I'm using the random library to do a function that returns a random image but 
when I use randomize() and initRand(), it doesn't return a random result, it 
just returns a fixed result Is this a problem with my code?

How do I use initRand() and randomize() correctly in this code?

Reply via email to