In this video, we explore 10 different approaches to solve the Scrabble Score exercise on Exercism. We explore pattern matching, higher order functions, generator expressions, helper classes and more!
We look at a variety of different languages including Go, F#, Python, Groovy, Ruby, Raku, Rust, AWK, JavaScript, and MIPS Assembly
Kick back and enjoy half an hour of learning with Jeremy and Erik, then go solve the exercise in your favourite way on Exercism.
Solve the exercise at: https://exercism.org/exercises/scrabb...
Join #48in24 at: https://exercism.org/challenges/48in24
Featured Solutions:
https://exercism.org/tracks/go/exerci...
https://exercism.org/tracks/fsharp/ex...
https://exercism.org/tracks/python/ex...
https://exercism.org/tracks/groovy/ex...
https://exercism.org/tracks/raku/exer...
https://exercism.org/tracks/rust/exer...
https://exercism.org/tracks/mips/exer...
https://exercism.org/tracks/awk/exerc...
https://exercism.org/tracks/javascrip...
https://exercism.org/tracks/ruby/exer...
Timestamps:
00:00:00 Introduction
00:01:00 Go: iteration and switch
00:02:39 F#: pattern matching and higher-order function
00:06:03 Python: char as key via IntEnum and generator expression
00:09:00 Groovy: string as key
00:12:14 Ruby: Multi-key hashtable
00:15:45 Raku: define strings but transform to char as key
00:19:00 Rust: lookup table based on zero-based letter index
00:23:45 MIPS Assembly: lookup table based on zero-based letter index
00:29:12 AWK: multiple score by finding number of matching characters in string via regex
00:31:40 JavaScript: build equation via regex replace of chars with their addition and eval
00:34:09 Conclusion