Yes, but it is a lot of work. Since it is homework, I will tell you what to do, but I am mostly not giving code blocks.
Assign each key a value from 1 to 36, (1=1, 2=2, …0=10,a=11,….z=36)
Make a list 36 long
Pick random numbers (1 to 36) for each of the four keys and put up, down, left and right in the list for that key (make sure each of the 4 keys is represented only once)