6 kyu

[Code Golf] Fizz-Not-Buzz

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

    Nice little code golf kata, with many different solutions.

  • saudiGuy Avatar

    stuck at 46. :-/

  • mauro-1 Avatar
    • It would be nice if tests show the length of valid solutions
    • In sample/fixed tests there is a section "Testing Simple Numbers", but there aren't numbers.
    • uttumuttu Avatar

      This comment has been hidden.

      Suggestion marked resolved by uttumuttu 5 months ago
    • mauro-1 Avatar

      Test messages show the length only when the solution is too long, and a simple "test passed" when the solution is valid.

      Using it headers, tests can show the lengt even for valid solutions, e.g.:

      @test.describe('Code length test')
      def solution_check():
          limit = 46
          size = __import__('os').stat('/workspace/solution.txt').st_size
          @_test.it(f'Code size should be less than {limit} bytes' + f', actual size: {size}'*(size < limit))  # <------
          def size_test():
              test.expect(size < limit, f'Solution too large, actual size: {size}')
      
    • rowcased Avatar

      Your code is too long: 46 should be less than 46.

      back to the drawing board

    • uttumuttu Avatar

      Thanks for the tip, mauro-1. I've now modified the length test to incorporate your suggestion.