Yes of course.
It has been done years ago.
A senior in my hostel in IIT Bombay wrote a program in FORTRAN to solve the Rubik’s Cube in 1982. This was for his B.Tech Project. Memory serves, it had 10,000 lines.
Since IIT Bombay didn’t have interactive computers back then, the program had to be punched https://levitralab.com into so-called Hollerith Cards, one line per card. The entire deck comprising 10K cards occupied a good portion of his hostel room!
UPDATE DATED 26 MARCH 2020:
I recently happened to find a Hollerith Card of my B.Tech Project program from 1985. This is how it looks:
Inspired by Brian R, I scoured my archives and found this Hollerith Card. 35 years after I wrote the line of code in my engineering college days, I'm amazed that the print hasn't faded. The "I = I+1" is still visible clearly! pic.twitter.com/Y4m53msKmj
— Ketharaman Swaminathan (@s_ketharaman) March 21, 2020