Move History

Fork Selected
  • Code
    USING: kernel sequences qw ;
    IN: foo
    
    : x ( seq -- counts ) qw{ n e w s } [ [ = ] curry count ] with map ; inline
    Test Cases
    ! Use vocabulary tools.testest for testing.
    ! See https://github.com/codewars/testest
    
    USING: foo tools.testest ;
    IN: example.tests
    
    : run-tests ( -- )
      "Example" describe#{
        "test case" it#{
          <{ { "s" } x -> { 0 0 0 1 } }>
        }#
      }#
    ;
    
    MAIN: run-tests