Retired

Broken seven-segment display (retired)

Description
Loading description...
Puzzles
  • Please sign in or sign up to leave a comment.
  • anter69 Avatar

    Naming convention: sevSeg --> ``sev_seg`

  • Blind4Basics Avatar
    [['B', 'C'], ['G'], ['A', 'B', 'C', 'D'], [], ['A', 'C', 'D', 'F'], ['A', 'C', 'D', 'E', 'F', 'G'], ['B', 'E'], ['B', 'C'], [], [], ['F', 'G'], ['D', 'G'], ['A', 'B', 'C', 'D', 'F', 'G']]
    should equal
    [['C', 'B'], ['G'], ['A', 'C', 'D', 'B'], [], ['A', 'F', 'C', 'D'], ['E', 'A', 'F', 'C', 'D', 'G'], ['E', 'B'], ['C', 'B'], [], [], ['F', 'G'], ['D', 'G'], ['A', 'F', 'C', 'D', 'G', 'B']]
    

    your lists aren't ordered correctly, meaning that your random tests enforce useless boilerplate to keep the order of the original lists (or even to find how to order them...). As suggested by Voile (but as an issue, so), please use a good design for the task => use sets.

  • Voile Avatar

    There are too many random tests. 25000 tests isn't going to do anything other than choking user's browser on every submission.

    If you want complete test coverage just perform all the combinations in the fixed tests.

  • Voile Avatar

    The broken digits should be a set, not a list, because we do not care about the order.

    Similarly, the returned result should be a list of sets ;-)

  • Voile Avatar

    If the input is invalid, return -1.

    What is a invalid input? It is not mentioned anywhere, and it could be anything (String length not equal? Some input not strings? String contains invalid characters?).

  • Voile Avatar

    Returning -1 is a bad design. It makes your code incompatible in other languages.

    Plesae use proper design and throw an exception instead so others will learn the right thing ;-)

  • ZED.CWT Avatar
    Traceback (most recent call last):
      File "main.py", line 40, in <module>
        randTest = random_test(True)
      File "main.py", line 32, in random_test
        choice.append([j for j in let if Test_check(a[i], j) != False])
      File "main.py", line 32, in <listcomp>
        choice.append([j for j in let if Test_check(a[i], j) != False])
      File "main.py", line 14, in Test_check
        for i in SSD['8']:
    NameError: name 'SSD' is not defined
    

    Dont rely on user solutions that will define a CORRECT SSD for your, copy your own in the complete test