app/xy_scores.rb
# -----------------------------------------------------------------------
# HERE ARE LINES YOU EDIT
# They score one round of decisions for 3 squads in a company.
# o) last line to return the overall scores
# o) one line for each squad's 5 letter decisions
#    - letter is illegal/illegible? see EXAMPLE#2
#    - more than 3 squads? see EXAMPLE#2,3
#    - letters form a word? see EXAMPLE#2,3
#    - letters are lowercase? see EXAMPLE#3
#
# If you have docker installed, and this file is called XY.rb
# and lives in the current directory, then you can run:
# $ docker run --rm --volume ${PWD}/XY.rb:/tmp/XY.rb ruby:alpine ruby /tmp/XY.rb
HERE ARE LINES YOU EDIT
They score one round of decisions for 3 squads in a company.
o) last line to return the overall scores
o) one line for each squad's 5 letter decisions
letter is illegal/illegible. see EXAMPLE#2
more than 3 squads. see EXAMPLE#2,3
letters form a word. see EXAMPLE#2,3
letters are lowercase. see EXAMPLE#3


HERE ARE LINES YOU EDIT They score one round of decisions for 3 squads in a company . o ) last line to return the overall scores o ) one line for each squad ' s 5 letter decisions letter is illegal / illegible . see EXAMPLE#2 more than 3 squads . see EXAMPLE#2 3 letters form a word . see EXAMPLE#2 3 letters are lowercase . see EXAMPLE#3
def xy_scores(sentence, profound, a, b, c)
  s = company_score(sentence, profound, a, b, c)
  squad_names = "ABCDEFGHIJKLMN"[0...s.size].chars
  totals = s.map{ |n| thou(sum(n)) }
  {
    "Company-score" => thou(sum(s)),
    "Squads-totals" => squad_names.zip(totals),
    "Squads-scores" => squad_names.zip(s.map{|s| thou(s)})
  }
end
def xy_scores ( sentence , profound , a , b , c ) s = company_score ( sentence , profound , a , b , c ) squad_names = "ABCDEFGHIJKLMN" [ 0 ... s . size ] . chars totals = s . map { | n | thou ( sum ( n ) ) } { "Company-score" => thou ( sum ( s ) ) , "Squads-totals" => squad_names . zip ( totals ) , "Squads-scores" => squad_names . zip ( s . map { | s | thou ( s ) } ) } end
HERE ARE LINES YOU EDIT
They score one round of decisions for 3 squads in a company.
HERE ARE LINES YOU EDIT They score one round of decisions for 3 squads in a company .
sentence
profound
a
b
c