Why was it not working properly? If your are using Windows 10 as your OS, I suggest enabling legacy console in command prompt.Also, the code is long, because I didn't know how to use for loops back then...