make "secretCode "

    to rotate :num :wd
      if equal? :num 0 [output :wd]
      output rotate (difference :num 1) (word butfirst :wd first :wd)
      end

    to makeSecretHelper :choices
      if equal? count :secretCode 4 [stop]
      make "choices rotate (random count :choices) :choices
      make "secretCode word :secretCode first :choices
      makeSecretHelper butfirst :choices
      end

    to makeSecretCode
      make "secretCode "
      makeSecretHelper "roygbv
      end