Basically I want to input a pass code composed of 4 digits from the terminal. I have some sloppy solutions but I want something clean. I want the user to write a digit and I'll put it in an array without having to press "enter". And then the user will give the second digit and I'll put it in the array... So for example it will give some thing like this:
>1 the array [1, 0, 0, 0]
>12 the array [1, 2, 0, 0]
>123 the array [1, 2, 3, 0]
>1234 the array [1, 2, 3, 4]
>the rest of the program