If you are asking if this is possible, then the answer is yes. One option is to use an array which is something we have not yet been taught but would be somewhat easy to learn.
Another way to do it that we do know would be to generate a random number of 1-4 and then assign if/else statements for each value and a certain result.
For example:
if (randomNumber == 1) {
result = "left";
}
followed by if statements for 2-4 assigning a direction to each.