Set variable as random letter between A and Z

Right now, in CoBlocks, I can for example set a variable to be a random integer between 1 and 100.


Is it possible to do the same, but now instead a random letter between A and Z?

Hi @sj187,

right now we don’t have such a block unfortunately. What would you like to use it for?

1 Like

For a puzzle.

Thanks for letting me know; I have simply instead used the If operator to execute this, though it adds many lines of code.

Couldn’t you just set the the code to pick a random integer from 0 to 26?

Yes but then there is still the problem of producing the letters.

Create an array, each item as a letter. Then pick item [random number 0-25] from the array.

How do I do that in CoBlocks?



Thanks for the suggestion.

But that is not significantly simpler than what I actually did.