[Community Puzzle] 7-segment display

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Number like that ?

I have a problem with Test4…

2 Likes

where is the problem ?

Vertical segments are extended on first and last lines for digits 1, 4, and 7:

.    # #    #  ####   ####   ####
     # #    #      # #    # #    #
     # #    #      # #    # #    #
     # #    #      # #    # #    #
     # #    #      # #    # #    #
        ####          ####
     #      #      #      # #    #
     #      #      #      # #    #
     #      #      #      # #    #
     #      #      #      # #    #
     #      #      #  ####   ####

Ok, Thank’s !

To me it makes no sense, if it’s a n-segment display it should be “extend” horizontally and vertically or why not : only horizontally or only vertically, but not because the number is too small.

Why we should extend 1,4,7 and not others ?
Why not where there is no horizontal line in the middle ?
If I have “14” and size “4” I need to extend too ? (5 vertically instead of 4)

It clearly lacks a rule.

Note: The questions are rhetorical.

5 Likes

I can’t pass Validator 2, while all the IDE tests are ok.
Any idea on what’s special with this test?

I have the same issue here…

Yes, it lacks a rule, but as all digits are in samples (and you can see sample’s answers), I guess it’s OK.

Still this #2 validator test issue though ; as we cannot see the entry, hard to know what‘s wrong.

Yes, it’s ok. I was disappointed because I made a clean solution with byte and this test case forces me to add dirty condition everywhere or I need to re-do it from scratch to do something clean.
It’s not a big deal, just frustrating.

I’ve no problem with #2 validator (but the #3 don’'t pass for me), but my code works with a size of “1” so maybe there is a size “1” in validator 2 and a mistake in “1 < S < 10”.

EDIT: I added a

if(S > 1) return;

and the test case 2 don’t pass so it’s not that

My code works with a size of 1 as well:

.#    #  #   #  # #  #   #   #   #   #
# #   #   #   # # # #   #     # # # # #
         #   #   #   #   #       #   #
# #   # #     #   #   # # #   # # #   #
 #    #  #   #    #  #   #    #  #   #

As for #3, I may have an idea for you : first digit is a 4, and it must not start with a . (the only case where there is no ‘.’ is when it starts with 4).

I know it because I tried to forcefully print a dot, hoping it would pass the test #2, and not only #2, but #3 failed as well ^^

If you have an idea for us for #2… (with dichotomy, you can know which N it is if you pass the test).

3 Likes

I can passe all the fourth test but in validation the number four does not want to pass…
Someone else have this problem?

I pass all Validators and Tests execpt Test 04… and I know why, but it’s good, I have 100% =)

Validator #4 seems to be a large number (>= 2^31). Still failing on #2, but all digits look good to me:

.   #  ###   ###  #   #  ###   ###   ###   ###   ###   ###
    #     #     # #   # #     #         # #   # #   # #   #
    #     #     # #   # #     #         # #   # #   # #   #
    #     #     # #   # #     #         # #   # #   # #   #
       ###   ###   ###   ###   ###         ###   ###
    # #         #     #     # #   #     # #   #     # #   #
    # #         #     #     # #   #     # #   #     # #   #
    # #         #     #     # #   #     # #   #     # #   #
    #  ###   ###      #  ###   ###      #  ###   ###   ###

I already though about the dot for a four :frowning:
I tried a lot of custom test and I don’t see any error, the only thing that my code do not manage is if “C” is a blank character (space, line feed, carriage return, …) but I added a quick workaround for that and the #3 still don’t pass, I have no more idea.

About #2 I can’t find the number because submit is limited, but I can found the size. So maybe your code does not works with “weird” character (\ , / , µ, £ and so on).

I made a diff with your output Plopx and mine and both are identical.

2 Likes

That was it! Validator #2 apparently uses a multibyte character. Thanks!

1 Like

Not nice, knowing the C template parsing is like:

char C[2];
fgets(C, sizeof(C), stdin);

:confused:

I’m done :cry: there is no reason why #3 validator doesn’t pass, I checked the code again and again and again, tried lot of different tests, … I even added support of stuff like “0478”.

3rd validator test is 4444

I didn’t check the size, but it should look like

#   # #   # #   # #   #
#   # #   # #   # #   #
#   # #   # #   # #   #
#   # #   # #   # #   #
 ###   ###   ###   ###
    #     #     #     #
    #     #     #     #
    #     #     #     #
    #     #     #     #
1 Like