7 segment counter

see i now understand to the answer to my problem , but i dont know how i would make the code?