vendredi 23 juin 2017

How can i let a function randomly return either a true or a false in go

I want to have a function that I can call to get a random true or false on each call:

  randBoolean() // true
  randBoolean() // false
  randBoolean() // false
  randBoolean() // true

How can I return a random boolean?

Problem 1: Generating a random number with go produces the same result on each call




Aucun commentaire:

Enregistrer un commentaire