control 3x 7 segment single digits with 6 buttons

By "segment", do you mean "digit"? What is

this huge thing of code..